public ServerResponse GetReceiptDetail(string ReceiptID)
        {
            var res = new ServerResponse();

            using (ReceiptBL ReceiptBL = new ReceiptBL())
            {
                try
                {
                    res.Data = ReceiptBL.GetReceiptDetails(ReceiptID);
                }
                catch (Exception ex)
                {
                    res.Success = false;
                }
            }
            return(res);
        }
        public ServerResponse Post([FromBody] QueryCondition queryCondition)
        {
            var res = new ServerResponse();

            using (ReceiptBL receiptBL = new ReceiptBL())
            {
                try
                {
                    res.Data = receiptBL.GetDataByQueryCondition(queryCondition);
                }
                catch (Exception ex)
                {
                    res.Success = false;
                }
            }
            return(res);
        }
        // POST: api/Unit
        public ServerResponse Post([FromBody] ReceiptObject ReceiptObj)
        {
            var res = new ServerResponse();

            using (ReceiptBL ReceiptBL = new ReceiptBL())
            {
                try
                {
                    res.Data = ReceiptBL.SaveReceipt(ReceiptObj);
                }
                catch (Exception ex)
                {
                    res.Success = false;
                }
            }
            return(res);
        }
        // DELETE: api/Unit/5
        public ServerResponse Delete(string id)
        {
            var res = new ServerResponse();

            using (ReceiptBL ReceiptBL = new ReceiptBL())
            {
                try
                {
                    res.Data = ReceiptBL.DeleteReceipt(id);
                }

                catch (Exception ex)
                {
                    res.Success = false;
                }
            }
            return(res);
        }
        public AjaxResult Get()
        {
            var ajaxResult = new AjaxResult();

            try
            {
                using (ReceiptBL receiptBL = new ReceiptBL())
                {
                    ajaxResult.Data    = receiptBL.GetAll();
                    ajaxResult.Success = true;
                    ajaxResult.Message = Resources.Success;
                }
            }
            catch (Exception ex)
            {
                ajaxResult.Success = false;
                ajaxResult.Data    = ex;
                ajaxResult.Message = Resources.Error;
            }
            return(ajaxResult);
        }