public ServiceResponseData AuditBill()
        {
            string       busiType     = requestData.GetData <string>(0);
            int          billID       = requestData.GetData <int>(1);
            int          auditEmpID   = requestData.GetData <int>(2);
            string       auditEmpName = requestData.GetData <string>(3);
            IMwBill      iProcess     = NewObject <MwBillFactory>().GetBillProcess(busiType);
            MWBillResult rtn          = new MWBillResult();

            try
            {
                oleDb.BeginTransaction();
                rtn = iProcess.AuditBill(billID, auditEmpID, auditEmpName);
                if (rtn.Result == 0)
                {
                    oleDb.CommitTransaction();
                }
                else
                {
                    oleDb.RollbackTransaction();
                }

                responseData.AddData(rtn);
            }
            catch (Exception error)
            {
                oleDb.RollbackTransaction();
                rtn.ErrMsg = error.Message;
                rtn.Result = 2;
                responseData.AddData(rtn);
            }

            return(responseData);
        }
        public ServiceResponseData SaveBill()
        {
            string  belongSys = requestData.GetData <string>(0);
            string  busiType  = requestData.GetData <string>(1);
            IMwBill iProcess  = NewObject <MwBillFactory>().GetBillProcess(busiType);

            MWBillResult result = new MWBillResult();

            MW_InStoreHead          head    = requestData.GetData <MW_InStoreHead>(2);
            List <MW_InStoreDetail> details = requestData.GetData <List <MW_InStoreDetail> >(3);
            List <int> deleteDetails        = requestData.GetData <List <int> >(4);

            oleDb.BeginTransaction();
            try
            {
                foreach (int detailID in deleteDetails)
                {
                    NewObject <MW_InStoreDetail>().delete(detailID);
                }

                iProcess.SaveBill(head, details);
                Basic_SystemConfig config = NewObject <IMWDao>().GetDeptParameters(head.DeptID, "AutoAuditInstore");
                if (config != null)
                {
                    if (config.Value == "1")
                    {
                        result = iProcess.AuditBill(head.InHeadID, LoginUserInfo.EmpId, LoginUserInfo.EmpName);
                    }
                }

                if (result.Result == 0)
                {
                    oleDb.CommitTransaction();
                }
                else
                {
                    oleDb.RollbackTransaction();
                }

                responseData.AddData(result);
            }
            catch (Exception error)
            {
                oleDb.RollbackTransaction();
                result.Result = 1;
                result.ErrMsg = error.Message;
            }

            responseData.AddData(result);
            return(responseData);
        }
Exemplo n.º 3
0
        public ServiceResponseData AuditBill()
        {
            string       busiType     = requestData.GetData <string>(0);
            int          deptId       = requestData.GetData <int>(1);
            int          auditEmpID   = requestData.GetData <int>(2);
            string       auditEmpName = requestData.GetData <string>(3);
            IMwBill      iProcess     = NewObject <MwBillFactory>().GetBillProcess(busiType);
            MWBillResult rtn          = new MWBillResult();

            try
            {
                rtn = iProcess.AuditBill(deptId, auditEmpID, auditEmpName);
                responseData.AddData(rtn);
            }
            catch (Exception error)
            {
                rtn.ErrMsg = error.Message;
                rtn.Result = 2;
                responseData.AddData(rtn);
                throw error;
            }

            return(responseData);
        }