public ActionResult Edit(About collection) { AboutDao bdDao = new AboutDao(); try { UserLogin us = (UserLogin)Session[SystemConsts.USER_SESSION]; collection.ModifiedBy = us.UserName; collection.ModifiedDate = Hepper.GetDateServer(); if (bdDao.Update(collection)) { SetAlert(@Resources.ResourceAdmin.AdminEditRecordSucess, "success"); return(RedirectToAction("Index")); } else { SetAlert(@Resources.ResourceAdmin.AdminEditRecordFailed, "danger"); } return(RedirectToAction("Index")); } catch { SetAlert(@Resources.ResourceAdmin.AdminEditRecordFailed, "danger"); return(View()); } }
public ActionResult Index(About entity) { var dao = new AboutDao(); entity.CreateBy = ((UserLoginSession)Session[ConstantSession.USER_SESSION]).UserName; entity.ModifiedBy = ((UserLoginSession)Session[ConstantSession.USER_SESSION]).UserName; dao.Update(entity); return(View(entity)); }
public ActionResult Edit(About about) { if (ModelState.IsValid) { var dao = new AboutDao(); var result = dao.Update(about); if (result) { return(RedirectToAction("Index", "About")); } else { ModelState.AddModelError("", "Không thêm được"); } } return(View("Index")); }
public ActionResult Edit(About about) { var dao = new AboutDao(); var result = dao.Update(about); if (result) { SetAlert("Add user successfully", "success"); return(RedirectToAction("Index", "About")); } else { SetAlert("Update user failure", "danger"); ModelState.AddModelError("", "Update user failure"); } return(View("Index")); }
public ActionResult Edit(About model) { if (ModelState.IsValid) { var session = (UserLogin)Session[CommonConstants.USER_SESSION]; model.ModifiedBy = session.UserName; var dao = new AboutDao(); var result = dao.Update(model); if (result) { SetAlert("Update content thành công", "success"); return(RedirectToAction("Index", "About")); } else { ModelState.AddModelError("", "Cập nhật content không thành công"); } } return(View()); }
public ActionResult Edit(About model) { if (ModelState.IsValid) { var dao = new AboutDao(); if (!string.IsNullOrEmpty(model.Name)) { var result = dao.Update(model); if (result) { return(RedirectToAction("Index", "About")); } else { ModelState.AddModelError("", "Cap nhap thanh cong"); } } } return(View()); }