public DealtViewModel(int id) { var bizProcessesAudit = BizFactory.BizProcessesAudit.ChangeStatusByAuditFlowV1(id, Enumeration.AuditFlowV1Status.InDealt, this.Operater, null, "已取单,正在处理"); if (bizProcessesAudit != null) { _bizProcessesAudit = bizProcessesAudit; if (_bizProcessesAudit.Auditor.Value != this.Operater) { this.IsHasOperater = true; this.OperaterName = SysFactory.SysUser.GetFullName(_bizProcessesAudit.Auditor.Value); } var orderToLllegalDealt = CurrentDb.OrderToLllegalDealt.Where(m => m.Id == bizProcessesAudit.AduitReferenceId).FirstOrDefault(); if (OrderToLllegalDealt != null) { _orderToLllegalDealt = orderToLllegalDealt; var merchant = CurrentDb.Merchant.Where(m => m.Id == orderToLllegalDealt.MerchantId).FirstOrDefault(); if (merchant != null) { _merchant = merchant; } var orderToLllegalDealtDetails = CurrentDb.OrderToLllegalDealtDetails.Where(m => m.OrderId == orderToLllegalDealt.Id).ToList(); if (orderToLllegalDealtDetails != null) { _orderToLllegalDealtDetails = orderToLllegalDealtDetails; } } } }
public VerifyViewModel(int id) { var bizProcessesAudit = BizFactory.BizProcessesAudit.ChangeStatusByAuditFlowV1(id, Enumeration.AuditFlowV1Status.InVerify, this.Operater, null, "已取单,正在核实"); if (bizProcessesAudit != null) { _bizProcessesAudit = bizProcessesAudit; if (_bizProcessesAudit.Auditor.Value != this.Operater) { this.IsHasOperater = true; this.OperaterName = SysFactory.SysUser.GetFullName(_bizProcessesAudit.Auditor.Value); } var orderToApplyLossAssess = CurrentDb.OrderToApplyLossAssess.Where(m => m.Id == bizProcessesAudit.AduitReferenceId).FirstOrDefault(); if (orderToApplyLossAssess != null) { _orderToApplyLossAssess = orderToApplyLossAssess; var merchant = CurrentDb.Merchant.Where(m => m.Id == orderToApplyLossAssess.MerchantId).FirstOrDefault(); if (merchant != null) { _merchant = merchant; } } } }
public VerifyOrderViewModel(int id) { var bizProcessesAudit = BizFactory.BizProcessesAudit.ChangeCarClaimDealtStatus(this.Operater, id, Enumeration.CarClaimDealtStatus.InVerifyOrder); if (bizProcessesAudit != null) { _bizProcessesAudit = bizProcessesAudit; if (_bizProcessesAudit.Auditor.Value != this.Operater) { this.IsHasOperater = true; this.OperaterName = SysFactory.SysUser.GetFullName(_bizProcessesAudit.Auditor.Value); } var orderToCarClaim = CurrentDb.OrderToCarClaim.Where(m => m.Id == bizProcessesAudit.AduitReferenceId).FirstOrDefault(); if (orderToCarClaim != null) { _orderToCarClaim = orderToCarClaim; var merchant = CurrentDb.Merchant.Where(m => m.Id == orderToCarClaim.MerchantId).FirstOrDefault(); if (merchant != null) { _merchant = merchant; } } } }
public PrimaryAuditViewModel(int id) { var bizProcessesAudit = BizFactory.BizProcessesAudit.ChangeExtendedAppAuditStatus(this.Operater, id, Enumeration.ExtendedAppAuditStatus.InAudit); if (bizProcessesAudit != null) { _bizProcessesAudit = bizProcessesAudit; var extendedApp = CurrentDb.ExtendedApp.Where(m => m.Id == bizProcessesAudit.AduitReferenceId).FirstOrDefault(); if (extendedApp != null) { _extendedApp = extendedApp; } } var bizProcessesAuditDetails = CurrentDb.BizProcessesAuditDetails.Where(m => m.BizProcessesAuditId == id).ToList(); if (bizProcessesAuditDetails != null) { var primaryAuditComments = bizProcessesAuditDetails.Where(m => m.BizProcessesAuditId == id && m.AuditStep == (int)Enumeration.ExtendedAppAuditStep.PrimaryAudit).OrderByDescending(m => m.CreateTime).Take(1).FirstOrDefault(); if (primaryAuditComments != null) { _bizProcessesAuditDetails = primaryAuditComments; var auditComments = bizProcessesAuditDetails.Where(m => m.BizProcessesAuditId == bizProcessesAudit.Id && m.AuditStep == (int)Enumeration.ExtendedAppAuditStep.PrimaryAudit && m.AuditComments != null).OrderByDescending(m => m.CreateTime).Take(1).FirstOrDefault(); if (auditComments != null) { _bizProcessesAuditDetails.AuditComments = auditComments.AuditComments; } } } }
public SeniorAuditViewModel(int id) { var bizProcessesAudit = BizFactory.BizProcessesAudit.ChangeExtendedAppAuditStatus(this.Operater, id, Enumeration.ExtendedAppAuditStatus.InReview); if (bizProcessesAudit != null) { _bizProcessesAudit = bizProcessesAudit; var extendedApp = CurrentDb.ExtendedApp.Where(m => m.Id == bizProcessesAudit.AduitReferenceId).FirstOrDefault(); if (extendedApp != null) { _extendedApp = extendedApp; } } var auditCommentsHistory = CurrentDb.BizProcessesAuditDetails.Where(m => m.BizProcessesAuditId == id).ToList(); if (auditCommentsHistory != null) { _auditCommentsHistory = auditCommentsHistory.Where(m => m.AuditTime != null && m.Auditor != null).ToList(); var auditCommentsCurrent = auditCommentsHistory.Where(m => m.BizProcessesAuditId == id && m.AuditStep == (int)Enumeration.ExtendedAppAuditStep.SeniorAudit).OrderByDescending(m => m.CreateTime).Take(1).FirstOrDefault(); if (auditCommentsCurrent != null) { _auditCommentsCurrent = auditCommentsCurrent; } } }
public PrimaryAuditViewModel(int id) { var bizProcessesAudit = BizFactory.BizProcessesAudit.ChangeMerchantAuditStatus(this.Operater, id, Enumeration.MerchantAuditStatus.InPrimaryAudit); if (bizProcessesAudit != null) { _bizProcessesAudit = bizProcessesAudit; var merchant = CurrentDb.Merchant.Where(m => m.Id == bizProcessesAudit.AduitReferenceId).FirstOrDefault(); if (merchant != null) { _merchant = merchant; if (_merchant.SalesmanId != null) { var salesman = CurrentDb.SysSalesmanUser.Where(m => m.Id == _merchant.SalesmanId).FirstOrDefault(); if (salesman != null) { _salesman = salesman; } } var merchantPosMachine = CurrentDb.MerchantPosMachine.Where(m => m.MerchantId == merchant.Id).ToList(); if (merchantPosMachine != null) { _merchantPosMachine = merchantPosMachine; foreach (var m in _merchantPosMachine) { var posMachine = CurrentDb.PosMachine.Where(q => q.Id == m.PosMachineId).FirstOrDefault(); m.PosMachine = posMachine; } } var bankCard = CurrentDb.BankCard.Where(m => m.MerchantId == merchant.Id).ToList(); if (bankCard != null) { _bankCard = bankCard; } var carInsuranceCompany = CurrentDb.CarInsuranceCompany.ToList(); if (carInsuranceCompany != null) { _carInsuranceCompany = carInsuranceCompany; } var merchantEstimateCompany = CurrentDb.MerchantEstimateCompany.Where(m => m.MerchantId == merchant.Id).ToList(); if (merchantEstimateCompany != null) { _merchantEstimateCompany = merchantEstimateCompany; } } } }
public SeniorAuditViewModel(int id) { var bizProcessesAudit = BizFactory.BizProcessesAudit.ChangeCommissionRateAuditStatus(this.Operater, id, Enumeration.CommissionRateAuditStatus.InSeniorAudit, "正在复审中"); if (bizProcessesAudit != null) { _bizProcessesAudit = bizProcessesAudit; var commissionRate = CurrentDb.CarInsureCommissionRate.Where(m => m.Id == bizProcessesAudit.AduitReferenceId).FirstOrDefault(); if (commissionRate != null) { _commissionRate = commissionRate; } _commissionRateAdjustModel = Newtonsoft.Json.JsonConvert.DeserializeObject <CommissionRateAdjustModel>(bizProcessesAudit.JsonData); } }
public DealtViewModel(int id) { var bizProcessesAudit = BizFactory.BizProcessesAudit.ChangeCarInsureOfferDealtStatus(this.Operater, id, Enumeration.CarInsureOfferDealtStatus.InOffer, "报价中"); if (bizProcessesAudit != null) { _bizProcessesAudit = bizProcessesAudit; if (_bizProcessesAudit.Auditor.Value != this.Operater) { this.IsHasOperater = true; this.OperaterName = SysFactory.SysUser.GetFullName(_bizProcessesAudit.Auditor.Value); } var orderToCarInsure = CurrentDb.OrderToCarInsure.Where(m => m.Id == bizProcessesAudit.AduitReferenceId).FirstOrDefault(); if (orderToCarInsure != null) { _orderToCarInsure = orderToCarInsure; var merchant = CurrentDb.Merchant.Where(m => m.Id == orderToCarInsure.MerchantId).FirstOrDefault(); if (merchant != null) { _merchant = merchant; } var orderToCarInsureOfferCompany = CurrentDb.OrderToCarInsureOfferCompany.Where(m => m.OrderId == orderToCarInsure.Id).ToList(); var insureOfferCompanys = CurrentDb.Company.ToList(); if (orderToCarInsureOfferCompany != null) { _orderToCarInsureOfferCompany = orderToCarInsureOfferCompany; foreach (var m in _orderToCarInsureOfferCompany) { var insureOfferCompany = insureOfferCompanys.Where(q => q.Id == m.InsuranceCompanyId).FirstOrDefault(); if (insureOfferCompany != null) { m.InsuranceCompanyName = insureOfferCompany.Name; m.InsuranceCompanyImgUrl = insureOfferCompany.ImgUrl; } } } var orderToCarInsureOfferKind = CurrentDb.OrderToCarInsureOfferKind.Where(m => m.OrderId == orderToCarInsure.Id).ToList(); var carKinds = CurrentDb.CarKind.ToList(); if (orderToCarInsureOfferKind != null) { _orderToCarInsureOfferKind = orderToCarInsureOfferKind; var isHasCompulsoryPrice = _orderToCarInsureOfferKind.Where(m => m.KindId == 1).FirstOrDefault(); if (isHasCompulsoryPrice != null) { _isHasCompulsoryPrice = true; } var isHasTravelTaxPrice = _orderToCarInsureOfferKind.Where(m => m.KindId == 2).FirstOrDefault(); if (isHasTravelTaxPrice != null) { _isHasTravelTaxPrice = true; } var isHasCommercialPrice = _orderToCarInsureOfferKind.Where(m => m.KindId >= 3).FirstOrDefault(); if (isHasCommercialPrice != null) { _isHasCommercialPrice = true; } foreach (var m in _orderToCarInsureOfferKind) { var carKind = carKinds.Where(q => q.Id == m.KindId).FirstOrDefault(); if (carKind != null) { m.KindName = carKind.Name; m.KindUnit = carKind.InputUnit; } } } } } }