public ActionResult Edit(string id) { var form = _context.Get <ApplicationUser>(d => d.Id == id).Project().To <UserViewModel>().SingleOrDefault(); if (form == null) { return(RedirectToAction <HomeController>(c => c.Index()).WithError("Unable to find the alumni.")); } return(View(form)); }
public ActionResult Menu() { var college = CacheHelper.GetCache <College>(CacheType.College).Where(d => d.LanguageId == 1).FirstOrDefault(); var menu = _context.Get <WebMenu>(d => d.WebLanguage.Name == "English").ToList(); //CacheHelper.GetCache<WebMenu>(CacheType.WebMenu).Where(d => d.LanguageId == 1).ToList(); var temp = new MainPageMenuViewModel(); temp.College = college; temp.WebMenus = menu; return(View(temp)); }
public ActionResult Index(long?languageId = 1) { ViewBag.selected = languageId; var modal = _context.Get <WebStaff>(d => d.LanguageId == languageId).OrderByDescending(d => d.Id).Include(d => d.WebDepartment).ToList(); return(View(modal)); }
public ActionResult Index(string id = "Undefined") { var condition = new ConditionViewModel <UserFile>() { ChangeOrderDirection = false, OrderDirection = "desc" }; if (string.IsNullOrEmpty(id)) { condition.Func = d => d.Deleted != true && d.Category == "Undefined"; } else { condition.Func = d => d.Deleted != true && d.Category == id; } condition.PerPageSize = 300; condition.CurrentPage = 1; var viewModel = new UploadFileViewModel(); viewModel.CategoryList = _db.Get <UserFile>(d => d.Deleted != true).GroupBy(d => d.Category).Select(g => new SelectListItem { Text = g.Key, Value = g.Key, Selected = g.Key == id }).ToArray(); viewModel.Data = _db.GetSearchResult(condition, d => d.OperationDate, null); return(View(viewModel)); }
public JsonResult _OperatorEdit(OperatorViewModel input) { _context.Get <ApplicationUser>(d => d.Id == input.Id).FirstOrDefault().UpdateDatetime = _context.GetNzTime(); var opteratorRoles = _context.Get <IdentityUserRole>(d => d.UserId == input.Id).ToList(); foreach (var item in opteratorRoles) { if (input.RolePosted != null) { if (!input.RolePosted.ids.Any(d => d == item.RoleId)) { var entity = _context.Get <IdentityUserRole>(d => d.RoleId == item.RoleId && d.UserId == input.Id).FirstOrDefault(); _context.GetTranscaiton().Entry(entity).State = EntityState.Deleted; } } else { var entity = _context.Get <IdentityUserRole>(d => d.RoleId == item.RoleId && d.UserId == input.Id).FirstOrDefault(); _context.GetTranscaiton().Entry(entity).State = EntityState.Deleted; } } _context.SaveChange(); if (input.RolePosted != null) { foreach (var item in input.RolePosted.ids) { if (!opteratorRoles.Any(d => d.RoleId == item)) { _context.AddOneEntity <IdentityUserRole>(new IdentityUserRole { UserId = input.Id, RoleId = item }); } } } return(Json("1", JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { return(View(_context.Get <WebLanguage>(d => true))); }
public ActionResult Index(long languageId = 1) { ViewBag.selected = languageId; return(View(_context.Get <WebEvent>(d => d.LanguageId == languageId).OrderByDescending(d => d.Id))); }
public ActionResult Index(Int64 languageId = 1) { ViewBag.selected = languageId; return(View(_context.Get <WebCarousel>(d => d.LanguageId == languageId))); }
public ActionResult Index(Int64 languageId = 1) { ViewBag.selected = languageId; return(View(_context.Get <College>(d => d.LanguageId == languageId).FirstOrDefault())); }
public ActionResult Index(long languageId = 1) { ViewBag.selected = languageId; return(View(_context.Get <WebMenu>(d => d.LanguageId == languageId).Include("WebLanguage"))); }
public ActionResult Index() { return(View(_context.Get <WebCarouselBackground>(d => true))); }