Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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
            }));
        }
Ejemplo n.º 3
0
        public ActionResult MenuPartial()
        {
            List <LoaiSanPhamDAO> lstLSP = LoaiSanPham_Service.GetAll();

            return(PartialView(lstLSP));
        }
Ejemplo n.º 4
0
        // GET: MenuProduct
        public ActionResult LoaiSanPham()
        {
            List <LoaiSanPhamDAO> lstLSP = LoaiSanPham_Service.GetAll();

            return(View(lstLSP));
        }