public JsonResult ChangeStatus(int ID) { var res = new PublishingCompanyModel().ChangeStatusAtID(ID); return(Json(new { status = res })); }
public JsonResult Delete(int ID) { var res = new PublishingCompanyModel().DeleteAtID(ID); SetAlert("delete success", "success"); return(Json(new { message = TempData["message"], type = TempData["typeAlert"] })); }
public void SetViewBag(int?selectPublishingCommpany = -1, int?selectAuthor = -1, int?selectRootCategory = null, string IDCategorys = null) { var list = new CategoryModel().GetAll(); ViewBag.IDRootCategory = new SelectList(list.Where(x => x.IDParent == null), "ID", "Name", selectRootCategory); var listPublishingCommpany = new PublishingCompanyModel().GetPublishingCompanys(); var defual = new PublishingCompany(); defual.ID = null; defual.Name = "n/a"; listPublishingCommpany.Insert(0, defual); ViewBag.IDPublishingCompany = new SelectList(listPublishingCommpany, "ID", "Name", selectPublishingCommpany); var listAuthor = new AuthorModel().GetAuthors(); var defual2 = new Author(); defual2.ID = null; defual2.Name = "n/a"; listAuthor.Insert(0, defual2); ViewBag.IDAuthor = new SelectList(listAuthor, "ID", "Name", selectAuthor); }
// GET: Admin/PublishingCompany/Edit/5 public ActionResult Edit(int id) { var collection = new PublishingCompanyModel().GetItemAtID(id); return(View(collection)); }
// GET: Admin/PublishingCompany public ActionResult Index(int page = 1, int pageSize = 10) { var list = new PublishingCompanyModel().GetPublishingCompanys(page, pageSize); return(View(list)); }