public int addIncomePayment(SqlTransaction trans, string id) { IncometPaymentModel model = new IncometPayment().GetModel(id); fund_AccountOperateModle modle = new fund_AccountOperateModle { AccountNum = Guid.NewGuid().ToString(), Acredence = Guid.NewGuid().ToString(), AccounType = 1, AccountMony = model.CllectionPrice, RealMony = model.CllectionPrice }; PtYhmcBll bll = new PtYhmcBll(); modle.DepID = bll.GetModelById(base.UserCode).i_bmdm.ToString(); modle.SumitMan = base.UserCode; modle.SumiTime = model.CllectionTime; modle.IsAccount = 0; modle.contracnum = model.ContractID; modle.projnum = ""; cn.justwin.stockBLL.AccountManage.accBaise.accBaise baise = new cn.justwin.stockBLL.AccountManage.accBaise.accBaise(); if (baise.GetModel(1).accAllot == 0) { PayoutContractModel model3 = new PayoutContract().GetModel(model.ContractID); modle.projnum = model3.PrjGuid; modle.contracnum = ""; } modle.AccountMan = string.Empty; return(this.dal.AddList(trans, modle)); }
public bool GreaterBalanceMoney(IncomentPaymentApplyModel model) { List <IncometPaymentModel> listArray = new IncometPayment().GetListArray(string.Format(" WHERE Con_Incomet_Payment.ContractID = '{0}'", model.ContractId)); decimal?nullable = 0M; foreach (IncometPaymentModel model2 in listArray) { nullable += model2.CllectionPrice; } string strWhere = string.Format(" Con_Income_PaymentApply.FlowState != '-2' AND Con_Income_PaymentApply.ContractID = '{0}' ", model.ContractId); List <IncomentPaymentApplyModel> list = this.paymentApply.GetList(strWhere); decimal?nullable2 = 0M; foreach (IncomentPaymentApplyModel model3 in list) { decimal?nullable6 = nullable2; decimal paymentAmount = model3.PaymentAmount; nullable2 = nullable6.HasValue ? new decimal?(nullable6.GetValueOrDefault() + paymentAmount) : null; } decimal?nullable8 = nullable2; decimal?nullable9 = nullable; return((nullable8.GetValueOrDefault() > nullable9.GetValueOrDefault()) && (nullable8.HasValue & nullable9.HasValue)); }