public PartialViewResult _LoaiSanPham(int pageNumber = 1, int pageSize = 10, string keyText = "") { List <LoaiSanPhamDAO> list = new List <LoaiSanPhamDAO>(); try { int totalEntries; list = LoaiSanPham_Service.GetAllBy(pageNumber, pageSize, keyText, out totalEntries); ViewBag.maxNumber = Math.Ceiling(totalEntries / (double)pageSize); ViewBag.pageNumber = pageNumber; ViewBag.pageSize = pageSize; TempData["productType"] = list; TempData.Keep(); } catch (Exception e) { throw e; } return(PartialView(list)); }
public JsonResult addOrUpdateProductType(LoaiSanPhamDAO obj, bool isUpdate) { AjaxResultModel Result = new AjaxResultModel(); bool check = true; try { if (isUpdate) { check = LoaiSanPham_Service.Update(obj); } else { check = LoaiSanPham_Service.Insert(obj); } if (check) { Result.Code = 0; Result.Message = "Thành công"; } else { Result.Code = 1; Result.Message = "Đã có lỗi xảy ra. Vui lòng thử lại."; } } catch (Exception e) { Result.Code = 1; Result.Message = e.Message; //throw; } return(Json(new JsonResult() { Data = Result })); }
public ActionResult MenuPartial() { List <LoaiSanPhamDAO> lstLSP = LoaiSanPham_Service.GetAll(); return(PartialView(lstLSP)); }
// GET: MenuProduct public ActionResult LoaiSanPham() { List <LoaiSanPhamDAO> lstLSP = LoaiSanPham_Service.GetAll(); return(View(lstLSP)); }