public JsonResult Insert([FromBody] MaterialPaymentTicket obj)
        {
            var msg = new JMessage()
            {
                Error = false, Title = ""
            };

            try
            {
                var query = _context.MaterialPaymentTickets.Where(x => x.PayCode.Equals(obj.PayCode)).FirstOrDefault();
                if (query == null)
                {
                    obj.CreatedTime = DateTime.Now;
                    obj.CreatedBy   = ESEIM.AppContext.UserName;
                    _context.MaterialPaymentTickets.Add(obj);
                    _context.SaveChanges();
                    msg.Title = "Thêm phiếu thu - chi thành công";
                    return(Json(msg));
                }
                else
                {
                    msg.Error = true;
                    msg.Title = "Mã phiếu thu - chi đã tồn tại";
                }
                return(Json(msg));
            }
            catch (Exception ex)
            {
                msg.Error = true;
                msg.Title = "Thêm phiếu thu - chi lỗi!";
            }
            return(Json(msg));
        }
        public JsonResult Update([FromBody] MaterialPaymentTicket obj)
        {
            var msg = new JMessage()
            {
                Error = false, Title = ""
            };

            try
            {
                obj.UpdatedTime = DateTime.Now.Date;
                _context.MaterialPaymentTickets.Update(obj);
                _context.SaveChanges();
                msg.Title = "Sửa phiếu thu - chi thành công";

                return(Json(msg));
            }
            catch (Exception ex)
            {
                msg.Error = true;
                msg.Title = "Sửa phiếu thu - chi lỗi!";
            }
            return(Json(msg));
        }