public ActionResult _Category2() { ProducerDao db = new ProducerDao(); var model = db.GetAll(""); return(PartialView(model)); }
// // GET: /Admin/Producer/ public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { var dao = new ProducerDao(); var model = dao.ListAllpaging(searchString, page, pageSize); ViewBag.searchString = searchString; return(View(model)); }
public ActionResult Producer(long Pro_id) { var pro = new ProducerDao().ViewDetail(Pro_id); ViewBag.Producer = pro; var model = new BookDao().ListByProducer(Pro_id); return(View(model)); }
public ActionResult _Category() { ProducerDao db = new ProducerDao(); var model = db.GetAll(""); // theo tên hả? uwf theo ten cua cate. category? return(PartialView(model)); }
private void setViewbag(long?matg = null, long?madm = null, long?manxb = null) { var dao = new AuthorDao(); BookCategoryDao danhmuc = new BookCategoryDao(); ProducerDao nxb = new ProducerDao(); ViewBag.AuthorID = new SelectList(dao.ListByID(), "ID", "Name", matg); ViewBag.CategoryID = new SelectList(danhmuc.ListAll(), "ID", "Name", madm); ViewBag.ProcderID = new SelectList(nxb.ListAll(), "ID", "Name", manxb); }
public ActionResult Edit(Producer producer) { if (ModelState.IsValid) { var dao = new ProducerDao(); var result = dao.Update(producer); if (result) { setAlert("Cập nhật NXB thành công", "success"); return(RedirectToAction("Index", "Producer")); } else { ModelState.AddModelError("", "Không sửa được"); } } return(View("Index")); }
public ActionResult Create(Producer producer) { if (ModelState.IsValid) { var dao = new ProducerDao(); long id = dao.Insert(producer); if (id > 0) { setAlert("Thêm mới NXB thành công", "success"); return(RedirectToAction("Index", "Producer")); } else { ModelState.AddModelError("", "Không thêm được"); } } return(View("Index")); }
public ActionResult ListProducer() { var model = new ProducerDao().ListByID(); return(PartialView(model)); }
public ActionResult Edit(long id) { var producer = new ProducerDao().ViewDetail(id); return(View(producer)); }
public void setProducer(long?selectedID = null) { var dao = new ProducerDao(); ViewBag.ProducerID = new SelectList(dao.GetAllProductProducers(), "ID", "Name", selectedID); }