private List <IntroducerAuditViewModel> GetIntroducer(string id) { var bad = new BaseAuditDAL(); var introducer = new IntroducerAuditDAL(); var baseaduit = bad.Get(id); if (baseaduit == null) { return(null); } var introducerAudit = introducer.FindByAuditID(baseaduit.ID); var introducerAuditList = new List <IntroducerAuditViewModel>(); foreach (var model in introducerAudit) { var collateral = new IntroducerAuditViewModel() { ID = model.ID, Account = model.Account, AccountBank = model.AccountBank, AuditID = baseaduit.ID, Contract = model.Contract, Name = model.Name, RebateAmmount = model.RebateAmmount, RebateRate = model.RebateRate, Sequence = model.Sequence }; introducerAuditList.Add(collateral); } return(introducerAuditList.OrderBy(p => p.Sequence).ToList()); }
public void SaveIntroducers <T>(ICollection <Introducer> collaterals, string auditId) where T : class, new() { Type type = typeof(T); if (type.Equals(typeof(IntroducerAudit))) { IntroducerAuditDAL IntroducerDAL = new IntroducerAuditDAL(); foreach (var model in collaterals) { #region 介绍人信息 IntroducerAudit IntroducerModel = new IntroducerAudit() { ID = Guid.NewGuid().ToString(), AuditID = auditId, Name = model.Name, Contract = model.Contract, RebateAmmount = model.RebateAmmount, RebateRate = model.RebateRate, Account = model.Account, AccountBank = model.AccountBank, Sequence = model.Sequence }; #endregion 介绍人信息 IntroducerDAL.Add(IntroducerModel); //保存介绍人信息 } } else if (type.Equals(typeof(Introducer))) { IntroducerDAL IntroducerDAL = new IntroducerDAL(); foreach (var model in collaterals) { #region 介绍人信息 Introducer IntroducerModel = new Introducer() { ID = Guid.NewGuid().ToString(), Name = model.Name, Contract = model.Contract, RebateAmmount = model.RebateAmmount, RebateRate = model.RebateRate, Account = model.Account, AccountBank = model.AccountBank, CaseID = auditId, Sequence = model.Sequence }; #endregion 介绍人信息 IntroducerDAL.Add(IntroducerModel); //保存介绍人信息 } } }
private IEnumerable <IntroducerAuditViewModel> GetIntroducer(BaseAudit baseAudit) { var introducer = new IntroducerAuditDAL(); var introducerAudit = introducer.FindByAuditID(baseAudit.ID); var introducerAuditList = introducerAudit.Select(model => new IntroducerAuditViewModel { ID = model.ID, Account = model.Account, AccountBank = model.AccountBank, AuditID = baseAudit.ID, Contract = model.Contract, Name = model.Name, RebateAmmount = model.RebateAmmount, RebateRate = model.RebateRate, Sequence = model.Sequence }).ToList(); return(introducerAuditList.OrderBy(p => p.Sequence).ToList()); }
/// <summary> /// 保存介绍人信息 /// </summary> /// <param name="Collaterals"></param> /// <param name="auditId"></param> public void SaveIntroducers(ICollection <Introducer> collaterals, string auditId) { IntroducerAuditDAL IntroducerDAL = new IntroducerAuditDAL(); foreach (var model in collaterals) { #region 介绍人信息 IntroducerAudit IntroducerModel = new IntroducerAudit(); IntroducerModel.ID = Guid.NewGuid().ToString(); IntroducerModel.AuditID = auditId; IntroducerModel.Name = model.Name; IntroducerModel.Contract = model.Contract; IntroducerModel.RebateAmmount = model.RebateAmmount; IntroducerModel.RebateRate = model.RebateRate; IntroducerModel.Account = model.Account; IntroducerModel.AccountBank = model.AccountBank; IntroducerModel.Sequence = model.Sequence; #endregion 介绍人信息 IntroducerDAL.Add(IntroducerModel); //保存介绍人信息 } }
public MortgageBll() { _baseAuditDal = new BaseAuditDAL(); _mortgageDal = new MortgageDAL(); _introducerAuditDal = new IntroducerAuditDAL(); }