public ActionResult Create(TitelBannerViewModel item) { if (ModelState.IsValid) { TitleRightBanner model = new TitleRightBanner(); model.Title = item.Titel; if (_iServiceRighBanner.SaveAdd(model)) { SessionUserHelper.CreateSessionSuccess(ConstantStrings.AddSuccess); } else { SessionUserHelper.CreateSessionError(ConstantStrings.AddNonSuccess); } return RedirectToAction("Index"); } return View(item); }
public bool SaveEdit(TitleRightBanner item) { return _titleBanner.Update(item); }
public TitleRightBanner GetTitelBannerModel(TitelBannerViewModel model) { var item = new TitleRightBanner(); item.ID = model.Id; item.Title = model.Titel; return item; }
public bool Update(TitleRightBanner item) { try { using (_context = new GreenhouseBannerContext()) { TitleRightBanner title = this._context.TitleRightBanners.FirstOrDefault(c => c.ID == item.ID); if (title != null) { var account = System.Web.HttpContext.Current.Session["Account"] as Account; title.UserModifyId = account.UserId; title.Title = item.Title; title.ModifyDate = DateTime.Now; _context.SaveChanges(); return true; } else { return false; } } } catch (Exception ex) { return false; } }