Esempio n. 1
0
        public AjaxResult Post([FromBody] RefSaveData refSaveData)
        {
            var result = new AjaxResult();

            try
            {
                var refBL = new RefBL();
                refBL.InsertRef(refSaveData);
                result.Success = true;
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Data    = ex;
            }
            return(result);
        }
Esempio n. 2
0
        public AjaxResult GetRefNo()
        {
            var result = new AjaxResult();

            try
            {
                var refBL = new RefBL();
                result.Success = true;
                result.Data    = refBL.GetRefNo();
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Data    = ex;
            }
            return(result);
        }
        public Result Deletes([FromBody] List <Guid> id)
        {
            var result = new Result();

            try
            {
                RefBL refBL = new RefBL();
                result.Data    = refBL.DeleteEntitys(id);
                result.Success = true;
            }
            catch (Exception)
            {
                result.Success = false;
                throw;
            }
            return(result);
        }
        public Result Get()
        {
            var result = new Result();

            try
            {
                RefBL refBL = new RefBL();
                result.Data    = refBL.GetDataRef();
                result.Success = true;
            }
            catch (Exception)
            {
                result.Success = false;
                throw;
            }
            return(result);
        }
Esempio n. 5
0
        public AjaxResult Get(Guid id)
        {
            var result = new AjaxResult();

            try
            {
                var refBL = new RefBL();
                result.Data    = refBL.GetRefById(id);
                result.Success = true;
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Data    = ex;
                throw;
            }
            return(result);
        }
Esempio n. 6
0
        public AjaxResult Put([FromBody] Ref @ref)
        {
            var result = new AjaxResult();

            try
            {
                var refBL = new RefBL();
                result.Data    = refBL.UpdateRef(@ref);
                result.Success = true;
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Data    = ex;
                throw;
            }
            return(result);
        }
        public Result GetRefByDate([FromBody] List <DateTime> id)
        {
            var result = new Result();

            try
            {
                RefBL refBL = new RefBL();
                var   Ref   = new Ref();
                result.Data    = refBL.GetRefByDate(id.ToArray());
                result.Success = true;
            }
            catch (Exception)
            {
                result.Success = false;
                throw;
            }
            return(result);
        }
        public Result Get(string id)
        {
            var result = new Result();

            try
            {
                RefBL         refBL = new RefBL();
                var           Ref   = new Ref();
                List <string> ids   = new List <string>();
                ids.Add(id);
                //return refBL.GetRefByID(ids.ToArray());
                result.Data    = refBL.GetRefByID(ids.ToArray());
                result.Success = true;
            }
            catch (Exception)
            {
                result.Success = false;
                throw;
            }
            return(result);
        }
        public Result Update([FromBody] Ref r)
        {
            var result = new Result();

            try
            {
                RefBL       refBL    = new RefBL();
                RefDetailBL detailBL = new RefDetailBL();
                var         check    = refBL.UpdateRef(r.JournalMemo, r.EmployeeID, r.ContactName, r.RefNo);
                if (check == true)
                {
                    detailBL.CheckRefDetail(r);
                }
                result.Success = true;
            }
            catch (Exception)
            {
                result.Success = false;
                throw;
            }
            return(result);
        }
        public bool Post([FromBody] Ref r)
        {
            try
            {
                RefBL refBL = new RefBL();
                var   re    = new Ref();

                var res = new RefDetail();
                if (refBL.CheckRefNo(r.RefNo) == true)
                {
                    refBL.CreateInvoice(r);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }