Example #1
0
        public PartialViewResult _ChiPhi_ChiTiet(int ID)
        {
            ChiPhiDAO data;

            try
            {
                List <ChiPhiDAO> chiPhi = (List <ChiPhiDAO>)TempData["chiPhi"];
                TempData.Keep();
                data = chiPhi.Where(x => x.MaChiPhi.Equals(ID)).FirstOrDefault();
                if (data == null)
                {
                    data = new ChiPhiDAO();
                }
            }
            catch (Exception e)
            {
                throw e;
            }

            return(PartialView(data));
        }
Example #2
0
        public JsonResult addOrUpdateExpense(ChiPhiDAO obj, bool isUpdate)
        {
            AjaxResultModel Result = new AjaxResultModel();

            bool check = true;

            try
            {
                if (isUpdate)
                {
                    check = ChiPhi_Service.Update(obj);
                }
                else
                {
                    obj.NgayTao = DateTime.Now;
                    check       = ChiPhi_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
            }));
        }
Example #3
0
 public static int MaxChiTiet()
 {
     return(ChiPhiDAO.MaxChiTiet());
 }
Example #4
0
 public static void TinhTien(int machiphi)
 {
     ChiPhiDAO.CapNhatChiPhi(machiphi);
 }
Example #5
0
 public static bool ThemVaoChiPhi(string maphong)
 {
     return(ChiPhiDAO.InsertChiPhi(maphong));
 }
Example #6
0
 public static int kiemtrachiphi(string maphong)
 {
     return(ChiPhiDAO.kiemtrachiphi(maphong));
 }