public ActionResult Create(Footer entity) { if (ModelState.IsValid) { long id; try { entity.CreatedOn = DateTime.Now; entity.Status = true; id = new FooterDao().Insert(entity); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Footer", "Index"))); } if (id > 0) { ModelState.AddModelError("", "Thêm mới thành công"); return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Thêm mới không thành công"); return(RedirectToAction("Index")); } } else { ModelState.AddModelError("", "Vui lòng nhập đầy đủ thông tin"); return(View()); } }
public ActionResult Edit(Footer collection) { try { if (ModelState.IsValid) { // TODO: Add insert logic here FooterDao bdDao = new FooterDao(); UserLogin us = (UserLogin)Session[SystemConsts.USER_SESSION]; if (bdDao.Update(collection)) { SetAlert("Thêm thành công", "success"); return(RedirectToAction("Index")); } else { SetAlert("Không thêm được", "danger"); } } return(View()); } catch { SetAlert("Không thêm được", "danger"); return(View()); } }
public ActionResult Edit(string id) { var dao = new FooterDao(); var product = dao.GetById(id); return(View(product)); }
public ActionResult Footer() { var model = new FooterDao().GetFooter(); return(PartialView(model)); }
public ActionResult Edit(long id) { var dao = new FooterDao(); var footer = dao.GetByID(id); return(View()); }
public ActionResult Index() { var dao = new FooterDao(); var model = dao.ListFooter(); return(View(model)); }
public ActionResult Footer2() { var dao = new FooterDao(); var model = dao.GetFooter("2"); return(PartialView(model)); }
public ActionResult Footer() { var lang = HttpContext.Session["CurrentCulture"].ToString(); var model = new FooterDao().GetFooter(lang); return(PartialView(model)); }
public ActionResult Footer() { var footerDao = new FooterDao(); var footer = footerDao.GetFooter(); return(PartialView(footer)); }
public JsonResult ChangeStatus(int id) { var res = new FooterDao().ChangeStatus(id); return Json(new { status = res }); }
public ActionResult Edit(Footer footer) { if (ModelState.IsValid) { long id = new FooterDao().update(footer); } return(RedirectToAction("Index")); }
// GET: Admin/Footer public ActionResult Index(string searchString, int page = 1, int pageSize = 5) { var dao = new FooterDao(); var model = dao.ListAllPaging(searchString, page, pageSize); ViewBag.SearchString = searchString; return(View(model)); }
public PartialViewResult FooterPartial() { FooterDao dbCat = new FooterDao(); AboutDao abDao = new AboutDao(); ViewBag.About = abDao.ToActive(); return(PartialView(dbCat.ToActive())); }
public JsonResult ChangeStatus(long id) { var result = new FooterDao().ChangeStatus(id); return(Json(new { status = result })); }
public JsonResult ChangeStatus(string id) { if (String.IsNullOrEmpty(id)) { return(Json(new { status = false, mess = "False" })); } var result = new FooterDao().ChangeStatus(id); return(Json(new { status = result, mess = "Thay đổi thành công" })); }
public ActionResult Footer() { try { var model = new FooterDao().GetFooter(); return(PartialView(model)); } catch (Exception ex) { throw; } }
public ActionResult Edit(Footer footer) { var res = new FooterDao().Update(footer); if (res) { ViewBag.Info = "Cập nhật thành công!"; } else { ViewBag.Info = "Cập nhật không thành công!"; } return View(); }
public ActionResult Create(Footer footer) { var res = new FooterDao().Insert(footer); if (res) { ViewBag.Info = "Thêm mới thành công"; } else { ViewBag.Info = "Thêm mới không thành công"; } return View(footer); }
public JsonResult Delete(string id) { if (String.IsNullOrEmpty(id)) { return(Json(new { status = false, mess = "False" })); } var data = new FooterDao().ViewByID(id); if (data.Status.Value) { return(Json(new { status = false, mess = "Không xóa được" })); } new FooterDao().Delete(id); return(Json(new { status = true, mess = "Xóa thành công" })); }
public ActionResult Delete(int id) { bool result = new FooterDao().Delete(id); if (result) { ModelState.AddModelError("", "Xóa thành công"); return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Xóa không thành công"); return(RedirectToAction("Index")); } }
public ActionResult Create(Footer footer) { if (ModelState.IsValid) { var dao = new FooterDao(); string id = dao.Insert(footer); return(RedirectToAction("Index", "Footer")); } else { ModelState.AddModelError("", "Không thêm được"); } return(View("Index")); }
public ActionResult Create(Footer footer) // Tạo tài khoản { if (ModelState.IsValid) { var dao = new FooterDao(); long id = dao.Insert(footer); if (id > 0) { return(RedirectToAction("Index", "Footer")); } else { ModelState.AddModelError("", "Thêm không thành công"); } } return(View("Index")); }
public ActionResult Edit(Footer footer) { if (ModelState.IsValid) { var dao = new FooterDao(); var result = dao.Update(footer); if (result) { return(RedirectToAction("Index", "Footer")); } else { ModelState.AddModelError("", "Không thêm được"); } } return(View("Index")); }
public ActionResult Delete(string id) { try { // TODO: Add delete logic here FooterDao bdDao = new FooterDao(); MenuDao mnDao = new MenuDao(); bdDao.Delete(id); // SetAlert("Xóa thành công", "success"); return(RedirectToAction("Index")); } catch { // SetAlert("Không xóa được", "danger"); return(View()); } }
public ActionResult Edit(Footer model) { if (ModelState.IsValid) { var dao = new FooterDao(); var result = dao.Update(model); if (result) { SetAlert("Update content thành công", "success"); return(RedirectToAction("Index", "Footer")); } else { ModelState.AddModelError("", "Cập nhật content không thành công"); } } return(View()); }
public JsonResult Delete(int id) { var res = new FooterDao().Delete(id); if (res) { return Json(new { status = true }, JsonRequestBehavior.AllowGet); } else { return Json(new { status = false }, JsonRequestBehavior.AllowGet); } }
public ActionResult Create(Footer model) { if (ModelState.IsValid) { var dao = new FooterDao(); string id = dao.Insert(model); if (id != null) { SetAlert("Thêm thông tin thành công", "success"); return(RedirectToAction("Index", "Footer")); } else { SetAlert("Thêm user không thành công", "error"); ModelState.AddModelError("", "Thêm thông tin không thành công"); } } return(View()); }
public ActionResult Update(Footer entity) { bool result; try { result = new FooterDao().Update(entity); } catch (Exception ex) { return(View("Eror", new HandleErrorInfo(ex, "Category", "Index"))); } if (result) { ModelState.AddModelError("", "Cập nhật thành công"); return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Cập nhật không thành công"); return(RedirectToAction("Index")); } }
public ActionResult Create([Bind(Include = "ID,Name,Link,DisplayOrder,ParentID,Status")] Footer footer) { try { if (ModelState.IsValid) { var dao = new FooterDao(); footer.Name = footer.Name; footer.Link = footer.Link; footer.DisplayOrder = footer.DisplayOrder; footer.ParentID = footer.ParentID; footer.Status = Convert.ToBoolean(true); var id = dao.Insert(footer); if (id > 0) { SetAlert("Thêm mới thành thành công", "success"); ViewBag.Success = "Thêm thành công"; footer = new Footer(); return(RedirectToAction("Index", "Footer")); } else { ModelState.AddModelError("", "Thêm mới ko thành công"); } } } catch (DbEntityValidationException e) { throw e; } catch (Exception ex) { throw ex; } return(View(footer)); }
public ActionResult Edit([Bind(Include = "ID,Name,Link,DisplayOrder,Status")] Footer footer) { if (ModelState.IsValid) { var dao = new FooterDao(); footer.Name = footer.Name; footer.Link = footer.Link; footer.DisplayOrder = footer.DisplayOrder; footer.Status = Convert.ToBoolean(true); var result = dao.Update(footer); if (result) { SetAlert("Cập nhật thành công", "success"); ViewBag.Success = "Thêm thành công"; footer = new Footer(); return(RedirectToAction("Index", "Footer")); } else { ModelState.AddModelError("", "Cập nhật ko thành công"); } } return(View(footer)); }
public ActionResult Footer() { var model = new FooterDao().GetFooter(); return PartialView(model); }