public ActionResult EditNewCategory(int ID) { var res = new NewDAO().FindCtgrByID(ID); ViewBag.Listall = new NewDAO().listcategory(); return(View(res)); }
public ActionResult NewsMenu() { var dao = new NewDAO(); var model = dao.ListHighLigtNew(); return(PartialView(model)); }
public ActionResult NewDetail(int ID) { var res = new NewDAO().FindNew(ID); ViewBag.Category = new NewDAO().Category(res.CategoryID); return(View(res)); }
public ActionResult DetailNewCategory(int ID) { var res = new NewDAO().FindCtgrByID(ID); ViewBag.Category = new NewDAO().Category(res.ParentID); return(View(res)); }
public ActionResult Edit(int id) { var anew = new NewDAO().FindById(id); SetViewBag(anew.categoryId); return(View(anew)); }
public ActionResult News() { var res = new NewDAO().listnew(); ViewBag.New = new NewDAO().listcategory(); return(View(res)); }
public ActionResult Notice() { int count = 2; var dao = new NewDAO(); var model = dao.GetLastestNotice(count); return(PartialView(model)); }
public ActionResult SearchNews(string searchString, int page = 1) { var dao = new NewDAO(); var model = dao.listAll(searchString, page, 10); ViewBag.SearchString = searchString; return(View(model)); }
// GET: Admin/New public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { var dao = new NewDAO(); var model = dao.listAll(searchString, page, pageSize); ViewBag.SearchString = searchString; return(View(model)); }
public ActionResult Delete(int id) { var dao = new NewDAO(); dao.Delete(id); SetAlert("Xóa tin thành công!", "success"); return(RedirectToAction("Index")); }
//Insert public int Update(NewDTO ndto) { var result = 0; try { result = new NewDAO().Update(convertData.ConvertToEF(ndto)); return(result); } catch (Exception) { return(result); } }
public ActionResult News(string metaTitle, int page = 1) { var dao = new SubMenuDAO(); int typeMenu = dao.GetTypeMenu(metaTitle); ViewBag.SubMenus = dao.ListSubMenuByType(typeMenu); ViewBag.SubMenuId = dao.GetId(metaTitle); ViewBag.SubText = dao.GetText(metaTitle); var cateDao = new CategoryNewDAO(); int cateId = cateDao.GetCategoryId(metaTitle); var newDao = new NewDAO(); var model = newDao.listAllByType(cateId, page, 10); return(View(model)); }
// GET: News public ActionResult Index(string metaTitle) { var dao = new NewDAO(); var subDAO = new SubMenuDAO(); var cateDao = new CategoryNewDAO(); var model = dao.GetNewByMetaTitle(metaTitle); ViewBag.Category = cateDao.GetCategoryNew(model.categoryId); string cateTitle = cateDao.GetCategoryMetaTitle((int)model.categoryId); int menuType = subDAO.GetTypeMenu(cateTitle); if (menuType != -1) { ViewBag.SubMenus = subDAO.ListSubMenuByType(menuType); ViewBag.SubMenuId = subDAO.GetId(cateTitle); ViewBag.SubText = subDAO.GetText(cateTitle); dao.UpdateView(metaTitle); } return(View(model)); }
public ActionResult Edit(New anew) { var dao = new NewDAO(); var session = (AdminLogin)Session[CommonConstants.USER_SESSION]; anew.modifyBy = session.AdminName; anew.metaTitle = convertToUnSign(anew.title); var rs = dao.Update(anew); if (rs) { SetAlert("Sửa tin thành công!", "success"); return(RedirectToAction("Index", "New")); } else { ModelState.AddModelError("", "Sửa tin không thành công"); } SetViewBag(anew.categoryId); return(View("Index")); }
public JsonResult EditNewCategory(NewCategory entity) { var session = (LoginAccount)Session[ConstaintUser.USER_SESSION]; var res = new NewDAO().Edit(session.username, entity); if (!res) { return(Json(new { Status = false, Message = "Sửa thông tin không thành công" })); } else { return(Json(new { Status = true, Message = "Sửa thông tin thành công", url = Url.Action("NewCategory", "New") })); } }
public JsonResult CreateNew(New entity) { var session = (LoginAccount)Session[ConstaintUser.USER_SESSION]; var res = new NewDAO().CreateNew(session.username, entity); if (!res) { return(Json(new { Status = false, Message = "Thêm không thành công" })); } else { return(Json(new { Status = true, Message = "Thêm thành công", url = Url.Action("News", "New") })); } }
public ActionResult Create(New anew) { var dao = new NewDAO(); anew.createdDate = DateTime.Now; var session = (AdminLogin)Session[CommonConstants.USER_SESSION]; anew.createdBy = session.AdminName; anew.newView = 0; anew.metaTitle = convertToUnSign(anew.title); long id = dao.Insert(anew); if (id > 0) { SetAlert("Thêm tin thành công!", "success"); return(RedirectToAction("Index", "New")); } else { ModelState.AddModelError("", "Thêm tin không thành công"); } SetViewBag(); return(View("Index")); }
public ActionResult ListSubNew(int ID) { var res = new NewDAO().listsubnew(ID); return(View("~/Areas/Admin/Views/New/NewReplace.cshtml", res)); }
// GET: Admin/New #region new category public ActionResult NewCategory() { var res = new NewDAO().listcategory(); return(View(res)); }