public PartialViewResult HeaderPartial() { AboutDao dbCat = new AboutDao(); return(PartialView(dbCat.ToActive())); }
// GET: Admin/About/Edit/5 public ActionResult Edit(int id) { var dao = new AboutDao(); var about = dao.GetByID(id); return(View(about)); }
public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { var dao = new AboutDao(); var model = dao.ListAllPaging(searchString, page, pageSize); return(View(model)); }
//[HasCredential(RoleID = "ABOUT_VIEW")] public ActionResult Index() { ViewBag.MenuActive = "mIndexAbout"; var dao = new AboutDao().GetAbout(); return(View(dao)); }
public ActionResult Detail(long id) { var model = new AboutDao().GetByID(id); ViewBag.Tags = new AboutDao().ListTag(id); return(View(model)); }
public ActionResult Create(About collection) { try { AboutDao bdDao = new AboutDao(); UserLogin us = (UserLogin)Session[SystemConsts.USER_SESSION]; collection.CreateBy = us.UserName; collection.CreateDate = Hepper.GetDateServer(); collection.ModifiedBy = us.UserName; collection.ModifiedDate = Hepper.GetDateServer(); collection.LanguageID = "vi"; //collection.CreateBy = us.UserName; //collection.ModifiedBy = us.UserName; if (bdDao.Insert(collection)) { SetAlert(@Resources.ResourceAdmin.AdminCreateRecordSuccess, "success"); return(RedirectToAction("Index")); } else { SetAlert(@Resources.ResourceAdmin.AdminCreateRecordFailed, "danger"); } return(RedirectToAction("Index")); } catch { SetAlert(@Resources.ResourceAdmin.AdminCreateRecordFailed, "danger"); return(View()); } }
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 Create(About entity) { if (ModelState.IsValid) { long id; try { entity.CreatedOn = DateTime.Now; entity.Status = true; id = new AboutDao().Insert(entity); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "About", "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(View()); } } else { ModelState.AddModelError("", "Vui lòng nhập đầy đủ thông tin"); return(View()); } }
public ActionResult Index(int page = 1, int pageSize = 10) { var dao = new AboutDao(); var model = dao.ListPg(page, pageSize); return(View(model)); }
// GET: Admin/About public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { var dao = new AboutDao(); var model = dao.ListAllPage(searchString, page, pageSize); ViewBag.SearchString = searchString;//de giu lai gia tri search, ViewBag gui gia tri tu controllor xuong view 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 AboutDao().ChangeStatus(id); return(Json(new { status = result })); }
public ActionResult Edit(long id) { if (id <= 0) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); } var data = new AboutDao().GetByID(id); return(View(data)); }
public JsonResult ChangeStatus(int id) { if (id <= 0) { return(Json(new { status = false, mess = "False" })); } var result = new AboutDao().ChangeStatus(id); return(Json(new { status = result, mess = "Thay đổi thành công" })); }
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)); }
// GET: Contact public ActionResult Index() { var about = new AboutDao().GetDetail(1); ViewBag.About = about; if (Session[Constants.USER_INFO] != null) { new LogDao().SetLog("Contact", null, ((User)Session[Constants.USER_INFO]).ID); } return(View()); }
// GET: About public ActionResult Index() { try { var model = new AboutDao().GetAbout(); return(View(model)); } catch (Exception ex) { throw; } }
public ActionResult Detail(long id) { if (((User)Session[Constants.USER_INFO]).GroupID == Constants.GROUP_ADMIM) { SetActiveSlideBar(Constants.SLIDEBAR_AD_SYSTEM); var AboutModel = new AboutDao().GetDetail(id); new LogDao().SetLog("Admin_About_Detail", null, ((User)Session[Constants.USER_INFO]).ID); return(View(AboutModel)); } SetAlert("Tài khoản của bạn không có quyền", Constants.ALERTTYPE_ERROR); new LogDao().SetLog("Admin_About_Detail", "Tài khoản của bạn không có quyền", ((User)Session[Constants.USER_INFO]).ID); return(RedirectToAction("Index", "Home")); }
public ActionResult Delete(int id, FormCollection collection) { var result = new AboutDao().DeleteByID(id); if (result) { return(RedirectToAction("Index")); } else { return(View("Index")); } }
public ActionResult Delete(long id) { bool result = new AboutDao().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 JsonResult Delete(int id) { if (id <= 0) { return(Json(new { status = false, mess = "False" })); } var data = new AboutDao().GetByID((long)id); if (data.Status.Value) { return(Json(new { status = false, mess = "Không xóa được" })); } new AboutDao().Delete(id); return(Json(new { status = true, mess = "Xóa thành công" })); }
public ActionResult Index() { CategoryDao cateDB = new CategoryDao(); ViewBag.HocTieuBieu = cateDB.TToListActivePositionByParentID(3, 26).SingleOrDefault(); AboutDao dbCat = new AboutDao(); ViewBag.About = dbCat.ToActive(); StatsInfoDao stiDB = new StatsInfoDao(); ViewBag.StatsInfo = stiDB.ToListActive(); return(View()); }
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 Create(About model) { if (ModelState.IsValid) { var dao = new AboutDao(); long id = dao.Insert(model); if (id > 0) { return(RedirectToAction("Index", "About")); } else { ModelState.AddModelError("", "Them about thanh cong"); } } return(View("Index")); }
public ActionResult Delete(long id) { try { // TODO: Add delete logic here AboutDao bdDao = new AboutDao(); 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 Create(About about) { if (ModelState.IsValid) { var dao = new AboutDao(); long id = dao.Insert(about); if (id > 0) { setAlert("Thêm thông tin thành công", "success"); return(RedirectToAction("Index", "About")); } else { setAlert("Cập nhật thông tin thành công", "success"); ModelState.AddModelError("", "Không thêm được"); } } return(View("Index")); }
public ActionResult Edit(About abouts) { if (ModelState.IsValid) { var dao = new AboutDao(); var result = dao.Update2(abouts); if (result) { //SetAlert("Cập nhật thành công", "success"); return(RedirectToAction("Index", "About")); } else { ModelState.AddModelError("", "Cập nhật không thành công"); } } return(View("Index")); }
// GET: Content public ActionResult Index(String searchString, int page = 1, int pageSize = 10) { var model = new AboutDao().ListAllpaging(searchString, page, pageSize); int totalRecord = 0; ViewBag.Total = totalRecord; ViewBag.Page = page; int maxPage = 5; int totalPage = 0; totalPage = (int)Math.Ceiling((double)(totalRecord / pageSize)); ViewBag.TotalPage = totalPage; ViewBag.MaxPage = maxPage; ViewBag.First = 1; ViewBag.Last = totalPage; ViewBag.Next = page + 1; ViewBag.Prev = page - 1; return(View(model)); }
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()); }