Esempio n. 1
0
        public ResultModel Audit(UserModel user, int corpId, bool isPass)
        {
            ResultModel result = new ResultModel();

            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
                {
                    result = this.corporationdetailDAL.GetByCorpId(user, corpId);
                    if (result.ResultStatus != 0)
                        return result;

                    Model.CorporationDetail corpDetail = result.ReturnValue as Model.CorporationDetail;
                    if (corpDetail == null || corpDetail.DetailId <= 0)
                    {
                        result.ResultStatus = -1;
                        result.Message = "客户不存在";
                        return result;
                    }

                    result = this.corporationdetailDAL.Audit(user, corpDetail, isPass);
                    if (result.ResultStatus != 0)
                        return result;

                    DAL.CorporationDAL corporationDAL = new CorporationDAL();
                    result = corporationDAL.Get(user, corpId);
                    if (result.ResultStatus != 0)
                        return result;

                    Model.Corporation corp = result.ReturnValue as Model.Corporation;
                    if (corp == null || corp.CorpId <= 0)
                    {
                        result.ResultStatus = -1;
                        result.Message = "公司不存在";
                        return result;
                    }

                    result = corporationDAL.Audit(user, corp, isPass);
                    if (result.ResultStatus != 0)
                        return result;

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }
            return result;
        }
Esempio n. 2
0
        public ResultModel UnFreeze(UserModel user, int corpId)
        {
            ResultModel result = new ResultModel();

            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
                {
                    result = corporationdetailDAL.GetByCorpId(user, corpId);
                    if (result.ResultStatus != 0)
                        return result;

                    Model.CorporationDetail corporationDetail = result.ReturnValue as Model.CorporationDetail;
                    if (corporationDetail == null)
                    {
                        result.ResultStatus = -1;
                        result.Message = "获取失败";
                        return result;
                    }

                    result = corporationdetailDAL.UnFreeze(user, corporationDetail);
                    if (result.ResultStatus != 0)
                        return result;

                    DAL.CorporationDAL corporationDAL = new CorporationDAL();
                    result = corporationDAL.Get(user, corpId);
                    if (result.ResultStatus != 0)
                        return result;

                    Model.Corporation corp = result.ReturnValue as Model.Corporation;
                    if (corp == null)
                    {
                        result.ResultStatus = -1;
                        result.Message = "获取失败";
                        return result;
                    }

                    result = corporationDAL.UnFreeze(user, corp);
                    if (result.ResultStatus != 0)
                        return result;

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }
            finally
            {
                if (result.ResultStatus != 0)
                    this.Log.ErrorFormat("{0} {1},序号:{2}", user.EmpName, result.Message, result.ReturnValue);
                else if (this.Log.IsInfoEnabled)
                    this.Log.InfoFormat("{0} {1},序号:{2}", user.EmpName, result.Message, result.ReturnValue);
            }

            return result;
        }
Esempio n. 3
0
        public ResultModel Update(UserModel user, Model.Corporation corporation, Model.CorporationDetail corpDetail)
        {
            ResultModel result = new ResultModel();

            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
                {
                    DAL.CorporationDAL corporationDAL = new CorporationDAL();
                    result = corporationDAL.Get(user, corporation.CorpId);
                    if (result.ResultStatus != 0)
                        return result;

                    Model.Corporation corp = result.ReturnValue as Model.Corporation;
                    if (corp == null)
                    {
                        result.ResultStatus = -1;
                        result.Message = "获取失败";
                        return result;
                    }

                    corp.CorpName = corporation.CorpName;
                    corp.TaxPayerId = corporation.TaxPayerId;
                    corp.CorpAddress = corporation.CorpAddress;
                    corp.CorpTel = corporation.CorpTel;
                    corp.CorpEAddress = corporation.CorpEAddress;
                    corp.CorpEName = corporation.CorpEName;
                    corp.CorpFax = corporation.CorpFax;

                    result = corporationDAL.Update(user, corp);
                    if (result.ResultStatus != 0)
                        return result;

                    result = corporationdetailDAL.Get(user, corpDetail.DetailId);
                    if (result.ResultStatus != 0)
                        return result;

                    Model.CorporationDetail corporationDetail = result.ReturnValue as Model.CorporationDetail;
                    if (corporationDetail == null)
                    {
                        result.ResultStatus = -1;
                        result.Message = "获取失败";
                        return result;
                    }
                    corporationDetail.BusinessLicenseCode = corpDetail.BusinessLicenseCode;
                    corporationDetail.RegisteredCapital = corpDetail.RegisteredCapital;
                    corporationDetail.CurrencyId = corpDetail.CurrencyId;
                    corporationDetail.RegisteredDate = corpDetail.RegisteredDate;
                    corporationDetail.CorpProperty = corpDetail.CorpProperty;
                    corporationDetail.BusinessScope = corpDetail.BusinessScope;
                    corporationDetail.TaxRegisteredCode = corpDetail.TaxRegisteredCode;
                    corporationDetail.OrganizationCode = corpDetail.OrganizationCode;
                    corporationDetail.IsChildCorp = corpDetail.IsChildCorp;
                    corporationDetail.CorpType = corpDetail.CorpType;
                    corporationDetail.Memo = corpDetail.Memo;

                    result = corporationdetailDAL.Update(user, corporationDetail);
                    if (result.ResultStatus != 0)
                        return result;

                    if (result.ResultStatus == 0)
                        result.ReturnValue = corpDetail.DetailId;

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }
            finally
            {
                if (result.ResultStatus != 0)
                    this.Log.ErrorFormat("{0} {1},序号:{2}", user.EmpName, result.Message, result.ReturnValue);
                else if (this.Log.IsInfoEnabled)
                    this.Log.InfoFormat("{0} {1},序号:{2}", user.EmpName, result.Message, result.ReturnValue);
            }

            return result;
        }
Esempio n. 4
0
        public ResultModel GoBack(UserModel user, int corpId)
        {
            ResultModel result = new ResultModel();

            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
                {
                    result = corporationdetailDAL.GetByCorpId(user, corpId);
                    if (result.ResultStatus != 0)
                        return result;

                    Model.CorporationDetail corporationDetail = result.ReturnValue as Model.CorporationDetail;
                    if (corporationDetail == null)
                    {
                        result.ResultStatus = -1;
                        result.Message = "获取失败";
                        return result;
                    }

                    result = corporationdetailDAL.Goback(user,corporationDetail);
                    if (result.ResultStatus != 0)
                        return result;

                    DAL.CorporationDAL corporationDAL = new CorporationDAL();
                    result = corporationDAL.Get(user, corpId);
                    if (result.ResultStatus != 0)
                        return result;

                    Model.Corporation corp = result.ReturnValue as Model.Corporation;
                    if (corp == null)
                    {
                        result.ResultStatus = -1;
                        result.Message = "获取失败";
                        return result;
                    }

                    result = corporationDAL.Goback(user, corp);
                    if (result.ResultStatus != 0)
                        return result;

                    ////工作流任务关闭
                    //WorkFlow.DAL.DataSourceDAL sourceDAL = new WorkFlow.DAL.DataSourceDAL();
                    //result = sourceDAL.SynchronousStatus(user, invoice);
                    //if (result.ResultStatus != 0)
                    //    return result;

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }
            finally
            {
                if (result.ResultStatus != 0)
                    this.Log.ErrorFormat("{0} {1},序号:{2}", user.EmpName, result.Message, result.ReturnValue);
                else if (this.Log.IsInfoEnabled)
                    this.Log.InfoFormat("{0} {1},序号:{2}", user.EmpName, result.Message, result.ReturnValue);
            }

            return result;
        }