Example #1
0
        public JsonResult UpdateInvoiceStatus(int ID, string value)
        {
            AjaxResultModel Result = new AjaxResultModel();

            bool check = true;

            try
            {
                check = DonHang_Service.UpdateByID(ID, value);
                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
            }));
        }
Example #2
0
        public PartialViewResult _DanhSach(int pageNumber = 1, int pageSize = 10, string keyText = "")
        {
            List <DonHangDAO> list = new List <DonHangDAO>();

            try
            {
                int totalEntries;
                list = DonHang_Service.GetAllBy(pageNumber, pageSize, keyText, out totalEntries);
                ViewBag.maxNumber  = Math.Ceiling(totalEntries / (double)pageSize);
                ViewBag.pageNumber = pageNumber;
                ViewBag.pageSize   = pageSize;
            }
            catch (Exception e)
            {
                throw e;
            }
            return(PartialView(list));
        }