예제 #1
0
        public IHttpActionResult DeleteVoucher(VoucherIdViewModel voucher)
        {
            string[] vids = voucher.VId.Split(',');
            try
            {
                foreach (string vid in vids)
                {
                    long delVid;
                    if (long.TryParse(vid, out delVid))
                    {
                        _voucher.Delete(delVid);
                    }
                    else
                    {
                        ResMessage.Fail(string.Format("无效凭证编号:{0}", vid));
                    }
                }
            }
            catch (Exception e)
            {
                ResMessage.Fail(e.Message);
            }

            return(Ok(ResMessage.Success()));
        }
예제 #2
0
        public IHttpActionResult DeleteCustomer(BizCustomerDelViewModel cusDel)
        {
            if (cusDel.CusId <= 0)
            {
                ResMessage.Fail("无效客户编号");
            }

            _customer.DeleteCustomer(cusDel.CusId);

            return(Ok(ResMessage.Success()));
        }
        public IHttpActionResult DeleteWorkOrder(WorkOrderDelViewModel workOrder)
        {
            if (workOrder.WoId <= 0)
            {
                ResMessage.Fail("要删除的工单编号无效");
            }

            _progress.DeleteWorkOrder(workOrder);

            return(Ok(ResMessage.Success()));
        }
        public IHttpActionResult DeleteAccount(AccountDeleteViewModel vmAccount)
        {
            if (vmAccount == null)
            {
                ResMessage.Fail("参数为空");
            }

            _account.DeleteAccount(vmAccount.AccId);

            return(Ok(ResMessage.Success()));
        }
        public IHttpActionResult DeleteCertWord(CertWordDeleteViewModel certWord)
        {
            if (certWord == null)
            {
                ResMessage.Fail("传入模型为空");
            }

            _certWord.Delete(certWord.CwId);

            return(Ok(ResMessage.Success()));
        }
예제 #6
0
 public IHttpActionResult SaveBizItem(BizItemViewModel item)
 {
     try
     {
         _setting.SaveBizItem(item);
     }
     catch (Exception err)
     {
         ResMessage.Fail(err.Message);
     }
     return(Ok(ResMessage.Success()));
 }
예제 #7
0
 public IHttpActionResult SaveBizCategory(BizCategoryViewModel category)
 {
     try
     {
         _setting.SaveCategory(category);
     }
     catch (Exception err)
     {
         ResMessage.Fail(err.Message);
     }
     return(Ok(ResMessage.Success()));
 }
        public IHttpActionResult SaveWorkOrder(WorkOrderViewModel progress)
        {
            string err;

            if (!_modelValid.ValidBizProgress(progress, out err))
            {
                ResMessage.Fail(err);
            }

            _progress.SaveWorkOrder(progress);

            return(Ok(ResMessage.Success()));
        }
예제 #9
0
        public IHttpActionResult SaveBizStep(BizStepsViewModel step)
        {
            try
            {
                _setting.SaveBizStep(step);
            }
            catch (Exception err)
            {
                ResMessage.Fail(err.Message);
            }

            return(Ok(ResMessage.Success()));
        }
예제 #10
0
        public IHttpActionResult SetInvoicePath(VoucherInvoicePathModel invoice)
        {
            try
            {
                _voucher.SetInvoicePath(invoice.VId, invoice.InvoicePath);
            }
            catch (Exception e)
            {
                ResMessage.Fail(e.Message);
            }

            return(Ok(ResMessage.Success()));
        }
예제 #11
0
        public IHttpActionResult DeleteBizStep(BizConfigDeleteViewModel step)
        {
            try
            {
                _setting.DeleteBizStep(step.id);
            }
            catch (Exception err)
            {
                ResMessage.Fail(err.Message);
            }

            return(Ok(ResMessage.Success()));
        }
예제 #12
0
        public IHttpActionResult DeleteBizCategory(BizConfigDeleteViewModel category)
        {
            try
            {
                _setting.DeleteCategory(category.id);
            }
            catch (Exception err)
            {
                ResMessage.Fail(err.Message);
            }

            return(Ok(ResMessage.Success()));
        }
        public IHttpActionResult SaveAccountBook(AcctBookViewModels acctBook)
        {
            string err;

            if (!_modelValid.ValidAccountBookCreate(acctBook, out err))
            {
                ResMessage.Fail(err);
            }

            _acctBook.Save(acctBook);

            return(Ok(ResMessage.Success()));
        }
        public IHttpActionResult GetMultiColumn(SearchMultiColumnViewModel condition)
        {
            if (string.IsNullOrEmpty(condition.StartPeriod) || string.IsNullOrEmpty(condition.EndPeriod))
            {
                ResMessage.Fail("会计期间不能为空");
            }

            List <MultiColumnViewModels> sheet = _sheet.GetMultiColumn(condition);
            DatagridViewModel <MultiColumnViewModels> dgSheet = new DatagridViewModel <MultiColumnViewModels>();

            dgSheet.rows = sheet;

            return(Ok(dgSheet));
        }
        public IHttpActionResult DeleteWorkProgress(WorkProgressDelViewModel delWorkProg)
        {
            if (delWorkProg.ProgId <= 0)
            {
                ResMessage.Fail("待删除的进度编号无效");
            }

            try
            {
                _progress.DeleteWorkProgress(delWorkProg.ProgId);
            }
            catch (Exception err)
            {
                ResMessage.Fail(err.Message);
            }

            return(Ok(ResMessage.Success()));
        }
예제 #16
0
        public IHttpActionResult SaveVoucher(VoucherViewModel voucher)
        {
            string err;

            //校验借贷是否平衡、凭证字号是否最新、科目是否有效等
            if (!_modelValid.ValidVoucher(voucher, out err))
            {
                ResMessage.Fail(err);
            }

            Voucher v = _voucher.Save(voucher);

            ResMessageContent rmContent = ResMessage.Success();

            rmContent.State = Mapper.Map <VoucherViewModel>(v);

            return(Ok(rmContent));
        }
예제 #17
0
        public IHttpActionResult Unaudit(VoucherIdViewModel voucher)
        {
            string[] vids = voucher.VId.Split(',');
            try
            {
                foreach (string vid in vids)
                {
                    long audVid;
                    if (long.TryParse(vid, out audVid))
                    {
                        _voucher.Unaudit(audVid);
                    }
                }
            }
            catch (Exception e)
            {
                ResMessage.Fail(e.Message);
            }

            return(Ok(ResMessage.Success()));
        }