本文整理汇总了C#中IPTV2_Model.IPTV2Entities类的典型用法代码示例。如果您正苦于以下问题:C# IPTV2Entities类的具体用法?C# IPTV2Entities怎么用?C# IPTV2Entities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPTV2Entities类属于IPTV2_Model命名空间,在下文中一共展示了IPTV2Entities类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Convert
static string DefaultCurrency = "USD"; // Use for cross conversion
public static decimal Convert(IPTV2Entities context, string baseCurrency, string targetCurrency, decimal amount)
{
decimal newAmount = amount;
if (baseCurrency == targetCurrency)
return amount;
var thisRate = context.Forexes.Find(new string[] { baseCurrency, targetCurrency });
if (thisRate != null)
{
return (decimal)((double)amount * thisRate.ExchangeRate);
}
else
{
thisRate = context.Forexes.Find(new string[] { targetCurrency, baseCurrency });
if (thisRate != null)
{
return (decimal)((double)amount / thisRate.ExchangeRate);
}
else
{
// convert baseCurrency to DefaultCurrency first
thisRate = context.Forexes.Find(new string[] { DefaultCurrency, baseCurrency });
if (thisRate == null) throw new Exception("Cannot convert from base currency.");
newAmount = (decimal)((double)amount / thisRate.ExchangeRate);
// convert DefaultCurrency to targetCurrency
thisRate = context.Forexes.Find(new string[] { DefaultCurrency, targetCurrency });
if (thisRate == null) throw new Exception("Cannot convert to target currency.");
newAmount = (decimal)((double)newAmount * thisRate.ExchangeRate);
}
}
return (newAmount);
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:37,代码来源:Forex.cs
示例2: TestProducts
public static void TestProducts()
{
var context = new IPTV2Entities();
var lite1M = context.Products.Find(5);
var lite3M = context.Products.Find(6);
var lite12M = context.Products.Find(7);
var is1MUsAllowed = lite1M.IsAllowed("US"); // false
var is3MUsAllowed = lite3M.IsAllowed("US"); // false
var is12MUsAllowed = lite12M.IsAllowed("US"); //false
var is1MJpAllowed = lite1M.IsAllowed("JP"); // true
var is3MJpAllowed = lite3M.IsAllowed("JP"); // true
var is12MJpAllowed = lite12M.IsAllowed("JP"); //true
var prem1M = context.Products.Find(1);
var prem3M = context.Products.Find(3);
var prem12M = context.Products.Find(4);
var prem10D = context.Products.Find(2);
var isPrem1M = prem1M.IsAllowed("US"); // true
var isPrem3M = prem3M.IsAllowed("US"); // true
var isPrem12M = prem12M.IsAllowed("US"); // true
var isPrem10D = prem10D.IsAllowed("US"); // true
var ae = context.Countries.Find("AE");
var aePricePrem1M = prem1M.GetPrice(ae);
var us = context.Countries.Find("US");
var usPriceLite1M = lite1M.GetPrice(us);
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:33,代码来源:ProductTester.cs
示例3: Verify
public ActionResult Verify(string id)
{
if (String.IsNullOrEmpty(id))
return new HttpNotFoundResult();
System.Guid g;
if (!System.Guid.TryParse(id, out g))
return new HttpNotFoundResult();
var context = new IPTV2Entities();
var tester = context.BetaTesters.FirstOrDefault(b => b.InvitationKey == new System.Guid(id) && b.DateClaimed == null);
if (tester != null)
{
//tester.DateClaimed = DateTime.Now;
//tester.IpAddress = Request.GetUserHostAddressFromCloudflare();
//if (context.SaveChanges() > 0)
//{
// HttpCookie cookie = new HttpCookie("testerid");
// cookie.Value = id;
// cookie.Expires = DateTime.Now.AddYears(10);
// this.ControllerContext.HttpContext.Response.SetCookie(cookie);
// //return RedirectToAction("Index", "Home");
// return RedirectToAction("Register", "User");
//}
HttpCookie cookie = new HttpCookie("testerid");
cookie.Value = id;
cookie.Expires = DateTime.Now.AddYears(10);
this.ControllerContext.HttpContext.Response.SetCookie(cookie);
return RedirectToAction("Register", "User", new { iid = id });
}
else
return Content("Key already used.", "text/html");
//return new HttpNotFoundResult();
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:35,代码来源:BetaController.cs
示例4: GetPlayList
public PartialViewResult GetPlayList(int? id)
{
var context = new IPTV2Entities();
if (id == null)
{
id = GlobalConfig.FreeTVPlayListId;
}
var feature = context.Features.FirstOrDefault(f => f.FeatureId == id && f.StatusId == GlobalConfig.Visible);
if (feature == null)
return null;
List<FeatureItem> featureItems = context.FeatureItems.Where(f => f.FeatureId == id && f.StatusId == GlobalConfig.Visible).ToList();
List<JsonFeatureItem> jfi = new List<JsonFeatureItem>();
foreach (EpisodeFeatureItem f in featureItems)
{
if (f is EpisodeFeatureItem)
{
Episode ep = context.Episodes.Find(f.EpisodeId);
if (ep != null)
{
Show show = ep.EpisodeCategories.FirstOrDefault(e => e.CategoryId != GlobalConfig.FreeTvCategoryId).Show;
if (show != null)
{
string img = String.IsNullOrEmpty(ep.ImageAssets.ImageVideo) ? GlobalConfig.AssetsBaseUrl + GlobalConfig.BlankGif : String.Format("{0}{1}/{2}", GlobalConfig.EpisodeImgPath, ep.EpisodeId.ToString(), ep.ImageAssets.ImageVideo);
string showImg = String.IsNullOrEmpty(show.ImagePoster) ? GlobalConfig.AssetsBaseUrl + GlobalConfig.BlankGif : String.Format("{0}{1}/{2}", GlobalConfig.ShowImgPath, show.CategoryId.ToString(), show.ImagePoster);
JsonFeatureItem j = new JsonFeatureItem() { EpisodeId = ep.EpisodeId, EpisodeDescription = ep.Description, EpisodeName = ep.EpisodeName, EpisodeAirDate = (ep.DateAired != null) ? ep.DateAired.Value.ToString("MMMM d, yyyy") : "", ShowId = show.CategoryId, ShowName = show.CategoryName, EpisodeImageUrl = img, ShowImageUrl = showImg, Blurb = MyUtility.Ellipsis(ep.Synopsis, 80) };
jfi.Add(j);
}
}
}
}
ViewBag.FeaturedId = id;
return PartialView("_GetPlayList", jfi);
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:34,代码来源:FreeTVController.cs
示例5: List
public ActionResult List(int id = 1)
{
int page = id;
var context = new IPTV2Entities();
var episodeIds = context.EpisodeCategories1.Where(e => e.CategoryId == GlobalConfig.KwentoNgPaskoCategoryId && e.Episode.OnlineStatusId == GlobalConfig.Visible).OrderByDescending(e => e.Episode.AuditTrail.CreatedOn)
.Skip((page - 1) * pageSize)
.Take(pageSize)
.Select(e => e.EpisodeId);
var totalCount = context.EpisodeCategories1.Count(e => e.CategoryId == GlobalConfig.KwentoNgPaskoCategoryId && e.Episode.OnlineStatusId == GlobalConfig.Visible);
ViewBag.CurrentPage = page;
ViewBag.PageSize = pageSize;
var totalPage = Math.Ceiling((double)totalCount / pageSize);
ViewBag.TotalPages = totalPage;
ViewBag.TotalCount = totalCount;
var maxCount = page * pageSize > totalCount ? totalCount : page * pageSize;
ViewBag.OutOf = String.Format("{0} - {1}", (page * pageSize) + 1 - pageSize, maxCount);
var episodes = context.Episodes.Where(e => episodeIds.Contains(e.EpisodeId) && e.OnlineStatusId == GlobalConfig.Visible);
ViewBag.Previous = page == 1 ? String.Empty : (page - 1) == 1 ? String.Empty : (page - 1).ToString();
ViewBag.Next = page == (int)totalPage ? (int)totalPage : page + 1;
if ((page * pageSize) + 1 - pageSize > totalCount)
return RedirectToAction("List", "KuwentongPasko", new { id = String.Empty });
if (episodes != null)
return View(episodes);
return RedirectToAction("Index", "Home");
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:30,代码来源:KuwentongPaskoController.cs
示例6: EntitlePackage
public static void EntitlePackage()
{
var context = new IPTV2Entities();
var user = context.Users.First(u => u.EMail == "[email protected]");
var product = context.Products.Find(5);
// user.Entitle((PackageSubscriptionProduct)product);
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:7,代码来源:UserTester.cs
示例7: Migration
public ActionResult Migration(string start, string end)
{
DateTime StartDate = Convert.ToDateTime(start);
DateTime EndDate = Convert.ToDateTime(end);
var context = new IPTV2Entities();
foreach (DateTime day in MyUtility.EachDay(StartDate, EndDate))
{
DateTime startDt = Convert.ToDateTime(String.Format("{0} {1}", day.ToString("yyyy/MM/dd"), "00:00:00"));
DateTime endDt = Convert.ToDateTime(String.Format("{0} {1}", day.ToString("yyyy/MM/dd"), "23:59:59"));
var report = context.Users
.Join(context.Countries, userdetails => userdetails.CountryCode, country => country.Code, (userdetails, country) => new { userdetails, country })
.Join(context.GomsSubsidiaries, user => user.country.GomsSubsidiaryId, subsidiary => subsidiary.GomsSubsidiaryId, (user, subsidiary) => new { user, subsidiary })
.Where(result => result.user.userdetails.RegistrationDate >= @startDt && result.user.userdetails.RegistrationDate <= @endDt && result.user.userdetails.TfcNowUserName != null)
.GroupBy(result => result.subsidiary.Description)
.Select(result => new { description = result.Key, count = result.Count() })
.OrderByDescending(result => result.count).ToList();
string filePath = @"C:\bin\global dropbox\Audie\Migration\";
string fileName = startDt.ToString("yyyyMMdd") + ".csv";
using (StreamWriter writer = new StreamWriter(filePath + fileName))
{
var csv = new CsvWriter(writer);
csv.WriteRecords(report);
}
}
return null;
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:29,代码来源:ReportController.cs
示例8: FillCache
public void FillCache(IPTV2Entities context, int offeringId, RightsType rightsType, TimeSpan cacheDuration)
{
var packageList = context.PackageTypes.Where(p => p.OfferingId == offeringId).ToList();
var countries = context.Countries.ToList();
// fill cache of all packages
long totalSize = 0;
foreach (var p in packageList)
{
foreach (var c in countries)
{
// loop and fill cache for 1 hour
// fill show IDs
var shows = p.GetAllShowIds(c.Code, rightsType, false);
var cacheKey = p.GetCacheKey(c.Code, rightsType);
DataCache.Cache.Put(cacheKey, shows, cacheDuration);
totalSize += GetObjectSize(shows);
// fill channel IDs
cacheKey = p.GetChannelsCacheKey(c.Code, rightsType);
var channels = p.GetAllChannelIds(c.Code, rightsType, false);
DataCache.Cache.Put(cacheKey, channels, cacheDuration);
}
}
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:26,代码来源:PackageCacheRefresher.cs
示例9: CheckUser_Entitlement
public static bool CheckUser_Entitlement(Show model)
{
if (!HttpContext.Current.User.Identity.IsAuthenticated)
{
return false;
}
else
{
using (IPTV2Entities context = new IPTV2Entities())
{
Guid userID = new Guid(HttpContext.Current.User.Identity.Name);
var user = context.Users.FirstOrDefault(u => u.UserId == userID);
var off = context.Offerings.Find(GlobalConfig.offeringId);
if (user.IsShowEntitled(off, model, RightsType.Online))
{
if (user.Entitlements.Where(t => t.OfferingId == GlobalConfig.offeringId && t.EndDate >= DateTime.Now).Count() > 0)
{
return true;
}
}
}
}
return false;
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:25,代码来源:UserPackages.cs
示例10: Run
public override void Run()
{
// This is a sample worker implementation. Replace with your logic.
Trace.WriteLine("$projectname$ entry point called", "Information");
int waitDuration = Convert.ToInt32(RoleEnvironment.GetConfigurationSettingValue("LoopWaitDurationInSeconds"));
int fillCacheDurationInMinutes = Convert.ToInt32(RoleEnvironment.GetConfigurationSettingValue("FillCacheDurationInMinutes"));
bool fillCache = Convert.ToBoolean(RoleEnvironment.GetConfigurationSettingValue("FillCache"));
while (true)
{
try
{
Thread.Sleep(TimeSpan.FromSeconds(waitDuration));
int offeringId = 2;
var service = new GomsTfcTv();
var context = new IPTV2Entities();
var offering = context.Offerings.Find(offeringId);
Trace.WriteLine("Process start.");
// Update Forex
// service.GetExchangeRates(context, "USD");
// Process Transactions
// service.ProcessAllPendingTransactionsInGoms(context, offering);
Trace.WriteLine("Process finish.");
}
catch (Exception ex)
{
Trace.TraceError("fail in Run", ex);
}
}
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:31,代码来源:WorkerRole.cs
示例11: Index
public ActionResult Index()
{
var ReturnCode = new TransactionReturnType()
{
StatusCode = (int)ErrorCodes.NotAuthenticated,
StatusMessage = String.Empty,
info = "IT&E Validation",
TransactionType = "Validation"
};
if (User.Identity.IsAuthenticated)
{
DateTime registDt = DateTime.Now;
IPTV2Entities context = new IPTV2Entities();
var promo = context.Promos.FirstOrDefault(p => p.PromoId == GlobalConfig.ITEPromoId && p.StartDate < registDt && registDt < p.EndDate && p.StatusId == GlobalConfig.Visible);
if (promo != null)
return View();
else { ReturnCode.StatusCode = (int)ErrorCodes.UnauthorizedCountry; }
}
ReturnCode.StatusMessage = MyUtility.getErrorMessage((ErrorCodes)ReturnCode.StatusCode);
if (!String.IsNullOrEmpty(ReturnCode.StatusMessage))
{
TempData["ErrorMessage"] = ReturnCode;
}
return RedirectToAction("Index", "Home");
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:26,代码来源:ITEController.cs
示例12: ExtendTFCnowLicenses
private static void ExtendTFCnowLicenses()
{
DateTime registDt = DateTime.Now;
var absnow_context = new ABSNowEntities();
var context = new IPTV2Entities();
var migrated_users = context.Users.Where(i => !String.IsNullOrEmpty(i.TfcNowUserName)).OrderBy(i => i.EMail);
Console.WriteLine(String.Format("Total migrated users: {0}", migrated_users.Count()));
int ctr = 1;
foreach (var user in migrated_users)
{
//Get Entitlements
Console.WriteLine(String.Format("{1} TFC.tv Email Address: {0}", user.EMail, ctr));
Console.WriteLine(String.Format("TFCnow Email Address: {0}", user.TfcNowUserName));
ctr++;
var entitlements = user.PackageEntitlements.Where(i => i.EndDate > registDt);
if (entitlements != null)
{
foreach (var item in entitlements)
{
Console.WriteLine(String.Format("Package Id: {0}", item.PackageId));
Console.WriteLine(String.Format("Expiration Date: {0}", item.EndDate));
int TFCnowPackageId = GetTFCnowPackageId(item.PackageId);
absnow_context.TFCnowExtendLicense(user.TfcNowUserName, TFCnowPackageId, item.EndDate);
}
}
//absnow_context.SaveChanges();
}
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:30,代码来源:Program.cs
示例13: GetDynamicNodeCollection
public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
{
List<DynamicNode> returnValue = null;
var cache = DataCache.Cache;
string cacheKey = "SMAPCELEB:O:00";
returnValue = (List<DynamicNode>)cache[cacheKey];
// Build value
if (returnValue == null)
{
try
{
returnValue = new List<DynamicNode>();
var context = new IPTV2_Model.IPTV2Entities();
// Create a node for each celebrity
var celebs = context.Celebrities.ToList();
foreach (var celeb in celebs)
{
DynamicNode node = new DynamicNode();
node.Key = "Celebrity-" + celeb.CelebrityId;
node.Title = "Celebrity - " + celeb.FullName;
//node.Controller = "Celebrity";
//node.Action = "Profile";
node.RouteValues.Add("id", celeb.CelebrityId);
returnValue.Add(node);
}
var cacheDuration = new TimeSpan(2, 0, 0);
cache.Put(cacheKey, returnValue, cacheDuration);
}
catch (Exception) { returnValue = new List<DynamicNode>(); }
}
// Return
return returnValue;
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:33,代码来源:CelebritySitemap.cs
示例14: ProcessAllGomsPendingTransactions
public static void ProcessAllGomsPendingTransactions()
{
var context = new IPTV2Entities();
var service = new GomsTfcTv();
var offering = context.Offerings.Find(2);
service.ProcessAllPendingTransactionsInGoms(context, offering);
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:7,代码来源:Transaction.cs
示例15: FillCache
public void FillCache(IPTV2Entities context, int offeringId, int serviceId, IEnumerable<int> categoryIds, RightsType rightsType, TimeSpan cacheDuration)
{
var countries = context.Countries;
var offering = context.Offerings.FirstOrDefault(o => o.OfferingId == offeringId);
var service = offering.Services.FirstOrDefault(s => s.PackageId == serviceId);
// fill cache of all categories
foreach (int categoryId in categoryIds)
{
try
{
var cat = context.CategoryClasses.FirstOrDefault(c => c.CategoryId == categoryId && c is Category);
if (cat != null)
{
var category = (Category)cat;
foreach (var c in countries)
{
try
{
// loop and fill cache for 1 hour
var shows = service.GetAllShowIds(c.Code, category, rightsType, false);
var cacheKey = service.GetCacheKey(c.Code, category, rightsType);
DataCache.Cache.Put(cacheKey, shows, cacheDuration);
}
catch (Exception) { }
}
}
}
catch (Exception) { }
}
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:31,代码来源:CategoryCacheRefresher.cs
示例16: CreditCardReload
static public void CreditCardReload()
{
var context = new IPTV2_Model.IPTV2Entities();
var gomsService = new GomsTfcTv();
var user = context.Users.FirstOrDefault(u => u.EMail == "[email protected]");
if (user != null)
{
// create transaction
var transaction = new IPTV2_Model.CreditCardReloadTransaction
{
Amount = 10,
Currency = user.Country.CurrencyCode,
Date = DateTime.Now,
};
var resp = gomsService.ReloadWalletViaCreditCard(context, user.UserId, transaction, GetCreditCard());
if (resp.IsSuccess)
{
// YEY
}
}
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:25,代码来源:CreditCard.cs
示例17: ContenderDetails
public ActionResult ContenderDetails(int? id)
{
if (id != null)
{
var context = new IPTV2Entities();
var celebrity = context.Celebrities.FirstOrDefault(c => c.CelebrityId == id);
var socialContext = new EngagementsEntities();
if (celebrity != null)
{
if (String.IsNullOrEmpty(celebrity.Description))
celebrity.Description = "No description yet.";
if (String.IsNullOrEmpty(celebrity.ImageUrl))
celebrity.ImageUrl = String.Format("{0}/{1}", GlobalConfig.AssetsBaseUrl, "content/images/celebrity/unknown.jpg");
else
celebrity.ImageUrl = String.Format("{0}{1}/{2}", GlobalConfig.CelebrityImgPath, celebrity.CelebrityId, celebrity.ImageUrl);
if (MyUtility.isUserLoggedIn() && ContextHelper.HasSocialEngagement(new System.Guid(User.Identity.Name), GlobalConfig.SOCIAL_LOVE, (int)id, EngagementContentType.Celebrity))
ViewBag.Loved = true;
var lovesCountSummary = socialContext.CelebrityReactionSummaries.FirstOrDefault(i => i.CelebrityId == celebrity.CelebrityId && i.ReactionTypeId == GlobalConfig.SOCIAL_LOVE);
int love = (int)(lovesCountSummary == null ? 0 : lovesCountSummary.Total);
celebrity.Weight = love.ToString();
if (!String.IsNullOrEmpty(celebrity.Birthday))
ViewBag.BirthDate = celebrity.Birthday;
if (!String.IsNullOrEmpty(celebrity.Birthplace))
{
ViewBag.BirthPlace = celebrity.Birthplace;
celebrity.Birthplace = "<p>" + celebrity.FirstName + " VS " + celebrity.Birthplace.Replace(",", "</p><p>" + celebrity.FirstName + " VS ") + "</p>";
celebrity.Birthplace = celebrity.Birthplace.Replace(":", "<br />");
}
return View(celebrity);
}
}
return RedirectToAction("Index", "Home");
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:35,代码来源:TFCkatController.cs
示例18: mytest
private static void mytest()
{
using (var context = new IPTV2Entities())
{
var offering = context.Offerings.Find(2);
var show = (Show)context.CategoryClasses.Find(333);
var packageProductIds = show.GetPackageProductIds(offering, "US", RightsType.Online);
var showProductIds = show.GetShowProductIds(offering, "US", RightsType.Online);
var subscriptionProducts = SubscriptionProductC.LoadAll(context, offering.OfferingId, true)
.Where(p => p.IsAllowed("US"));
var packageProducts = from products in subscriptionProducts
join id in packageProductIds
on products.ProductId equals id
select products;
var showProducts = from products in subscriptionProducts
join id in showProductIds
on products.ProductId equals id
select products;
}
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:27,代码来源:Program.cs
示例19: GetStore
public JsonResult GetStore(string id)
{
var context = new IPTV2Entities();
var result = context.StoreFronts.Where(s => (s.BusinessName.Contains(id) || s.Address1.Contains(id) || s.City.Contains(id)) && s.StatusId == GlobalConfig.Visible && s.OfferingId == GlobalConfig.offeringId);
List<StoreFront> list = new List<StoreFront>();
foreach (var item in result)
{
list.Add(new StoreFront()
{
StoreFrontId = item.StoreFrontId,
BusinessName = item.BusinessName,
ContactPerson = item.ContactPerson,
Address1 = item.Address1,
Address2 = item.Address2,
City = item.City,
State = item.State,
ZipCode = item.ZipCode,
CountryCode = item.CountryCode,
BusinessPhone = item.BusinessPhone,
EMailAddress = item.EMailAddress,
WebSiteUrl = item.WebSiteUrl,
MobilePhone = item.MobilePhone,
Latitude = item.Latitude,
Longitude = item.Longitude
});
}
return this.Json(list, JsonRequestBehavior.AllowGet);
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:28,代码来源:StoreLocatorController.cs
示例20: Index
public ActionResult Index()
{
var context = new IPTV2Entities();
var faq = (Category)context.CategoryClasses.FirstOrDefault(c => c.CategoryId == GlobalConfig.FAQ && c.StatusId == GlobalConfig.Visible);
var categories = faq.CategoryClassSubCategories.Where(c => c.SubCategory.StatusId == GlobalConfig.Visible).ToList();
//Get Top 5
string Top5 = GlobalConfig.FaqTop5;
var Top5Ids = MyUtility.StringToIntList(Top5);
var category = context.CategoryClasses.Where(c => Top5Ids.Contains(c.CategoryId) && c.StatusId == GlobalConfig.Visible).ToList();
ViewBag.Top5Q = category;
if (!Request.Cookies.AllKeys.Contains("version"))
{
try
{
if (User.Identity.IsAuthenticated)
{
var UserId = new Guid(User.Identity.Name);
var user = context.Users.FirstOrDefault(u => u.UserId == UserId);
if (user != null)
ViewBag.EmailAddress = user.EMail;
}
}
catch (Exception) { }
return View("Index2", categories);
}
return View(categories);
}
开发者ID:agentvnod,项目名称:tfctvoldcode,代码行数:30,代码来源:HelpController.cs
注:本文中的IPTV2_Model.IPTV2Entities类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论