public ActionResult AddClaimDetail(ClaimDetailViewModel ss) { CompanyexpenseDAORequest request = new CompanyexpenseDAORequest(); List <ClaimDetailViewModel> checkLIst = l.CheckPolicyExist((int)ss.customerpolicyid); if (checkLIst.Count > 0) { TempData["message"] = "This customer policy has claimed, please check in claim management"; return(RedirectToAction("CLaimDetailManager", new { page = 1, pageSize = 10 })); } else { CompanyexpenseViewModel model = new CompanyexpenseViewModel() { date = DateTime.Today, expensetypeid = 1, amount = ss.claimableamount, customerpolicyid = ss.customerpolicyid, description = "Chi trả bảo hiểm cho hợp đồng số: " + ss.customerpolicyid }; request.Add(model); l.Add(ss); List <ClaimDetailViewModel> h = l.GetAll(); Session["ClaimDetailViewAll"] = h; return(RedirectToAction("ClaimDetailBill", ss)); } }
public static List <ClaimDetailViewModel> ConvertToNewList(this List <bx_claim_detail> details) { var list = new List <ClaimDetailViewModel>(); if (!details.Any()) { return(list); } ClaimDetailViewModel detail; foreach (var i in details) { detail = new ClaimDetailViewModel { Buid = i.b_uid, CreateTime = i.create_time, StrCreateTime = i.create_time.HasValue ? i.create_time.Value.ToString("yyyy-MM-dd") : "", EndCaseTime = i.endcase_time, StrEndCaseTime = i.endcase_time.HasValue ? i.endcase_time.Value.ToString("yyyy-MM-dd") : "", Id = i.id, Liid = i.li_id, LossTime = i.loss_time, StrLossTime = i.loss_time.HasValue ? i.loss_time.Value.ToString("yyyy-MM-dd") : "", PayAmount = i.pay_amount, PayCompanyName = i.pay_company_name, PayCompanyNo = i.pay_company_no }; list.Add(detail); } return(list); }
public ActionResult EditClaimDetail(int id) { ClaimDetailViewModel k = l.GetEdit(id); ViewData["ClaimDetailViewAll"] = k; List <CustomerpolicyViewModel> z = sxx.GetAll(); Session["CusAllView"] = z; return(View()); }
public ActionResult NewClaimDetail(ClaimDetailViewModel f) { l.Update(f); List <ClaimDetailViewModel> s = l.GetAll(); Session["ClaimDetailViewAll"] = s; if (Session["ClaimDetailSearchs"] == null) { return(RedirectToAction("ClaimDetailViewAll")); } return(RedirectToAction("ClaimDetailSearch")); }
public ActionResult ClaimDetailBill(ClaimDetailViewModel ss) { var context = new InsuranceDbContext(); var claimDetail = context.Claim_Detail.Where(c => c.claim_number.Equals(ss.claimnumber)) .Select(c => new ClaimBillViewModel { AccidentDate = c.date_accident, AccidentPlace = c.place_accident, Claim = c.claimable_amount, ClaimName = c.claim_number, CustomerName = c.Customer_Policy.Customer_Info.name, CustomerPolicyId = c.Customer_Policy.id, EndDate = c.Customer_Policy.policy_end_date, Insured = c.insured_amount, PolicyName = c.Customer_Policy.Policy.policy_number, StartDate = c.Customer_Policy.policy_start_date, VehicleName = c.Customer_Policy.Vehicle_Info.Brand.name + " " + c.Customer_Policy.Vehicle_Info.Model.name }).FirstOrDefault(); return(View(claimDetail)); }
public BaojiaItemViewModel ConvertToViewModel(GetBjdItemResponse bjdItemResponse) { bj_baodanxinxi xinxi = bjdItemResponse.Baodanxinxi; bj_baodanxianzhong xianzhong = bjdItemResponse.Baodanxianzhong; List <bx_claim_detail> claimDetail = bjdItemResponse.ClaimDetail; bx_savequote savequote = bjdItemResponse.Savequote; AgentViewModelByBJ AgentDetail = bjdItemResponse.AgentDetail; List <bx_preferential_activity> Activitys = bjdItemResponse.Activitys; var item = new BaojiaItemViewModel(); #region BaoJiaInfo item.BaoJiaInfo = new BaojiaInfoViewModel { CarOwner = xinxi.CarOwner, BizStartDate = xinxi.BizStartDate.ToString(), ForceStartDate = xinxi.ForceStartDate.ToString(), CarBrandModel = xinxi.CarBrandModel, CarLicense = xinxi.CarLicense, CompanyId = xinxi.CompanyId.HasValue ? SourceGroupAlgorithm.GetNewSource(xinxi.CompanyId.Value) : 0, // CompanyName = xinxi., ChannelId = xinxi.ChannelId.HasValue ? xinxi.ChannelId.Value : 0, InsureIdType = xinxi.InsureIdType, InsureIdNum = xinxi.InsureIdNum, //新增的4个费率 NonClaimRate = xinxi.NonClaimRate.HasValue ? xinxi.NonClaimRate.Value : 0, MultiDiscountRate = xinxi.MultiDiscountRate.HasValue ? xinxi.MultiDiscountRate.Value : 0, AvgMileRate = xinxi.AvgMileRate.HasValue ? xinxi.AvgMileRate.Value : 0, RiskRate = xinxi.RiskRate.HasValue ? xinxi.RiskRate.Value : 0, BizNum = xinxi.BizNum, ForceNum = xinxi.ForceNum, //座位数 CarSeat = xinxi.CarSeated, VehicleInfo = xinxi.VehicleInfo, JqVehicleClaimType = xinxi.JqVehicleClaimType, SyVehicleClaimType = xinxi.SyVehicleClaimType, LastBizEndDate = xinxi.BizEndDate.HasValue ? xinxi.BizEndDate.Value.Date == DateTime.MinValue.Date ? "" : xinxi.BizEndDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", LastForceEndDate = xinxi.ForceEndDate.HasValue ? xinxi.ForceEndDate.Value.Date == DateTime.MinValue.Date ? "" : xinxi.ForceEndDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", ActivityContent = string.IsNullOrEmpty(xinxi.activity_content) ? "" : xinxi.activity_content }; if (!string.IsNullOrEmpty(xinxi.TotalRate)) { item.BaoJiaInfo.TotalRate = xinxi.TotalRate; } else { item.BaoJiaInfo.TotalRate = (item.BaoJiaInfo.NonClaimRate * item.BaoJiaInfo.MultiDiscountRate * item.BaoJiaInfo.AvgMileRate * item.BaoJiaInfo.RiskRate).ToString("f4"); } #endregion #region XianZhongInfo item.XianZhongInfo = new BaoxianXianZhongViewModel { //BizRate = xinxi.BizRate.HasValue ? xinxi.BizRate.Value : 0, //ForceRate = xinxi.ForceRate.HasValue?xinxi.ForceRate.Value:0, BizRate = xinxi.ManualBizRate.HasValue ? xinxi.ManualBizRate.Value : 0, ForceRate = xinxi.ManualForceRate.HasValue ? xinxi.ManualForceRate.Value : 0, //20170221新增增值税 AddValueTaxRate = xinxi.AddValueTaxRate.HasValue ? xinxi.AddValueTaxRate.Value : 0, BizTotal = xianzhong.BizTotal.HasValue ? xianzhong.BizTotal.Value : 0, BoLi = new XianZhongUnit { BaoE = xianzhong.BoLiBaoE.HasValue ? xianzhong.BoLiBaoE.Value : 0, BaoFei = xianzhong.BoLiBaoFei.HasValue ? xianzhong.BoLiBaoFei.Value : 0 }, BuJiMianCheSun = new XianZhongUnit { BaoE = (xianzhong.BuJiMianCheSun.HasValue ? xianzhong.BuJiMianCheSun.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianCheSun.HasValue ? xianzhong.BuJiMianCheSun.Value : 0 }, //BuJiMianCheSun = xianzhong.BuJiMianCheSun.HasValue ? xianzhong.BuJiMianCheSun.Value : 0, BuJiMianDaoQiang = new XianZhongUnit { BaoE = (xianzhong.BuJiMianDaoQiang.HasValue ? xianzhong.BuJiMianDaoQiang.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianDaoQiang.HasValue ? xianzhong.BuJiMianDaoQiang.Value : 0 }, //BuJiMianDaoQiang = xianzhong.BuJiMianDaoQiang.HasValue ? xianzhong.BuJiMianDaoQiang.Value : 0, BuJiMianFuJia = new XianZhongUnit { BaoE = (xianzhong.BuJiMianFuJian.HasValue ? xianzhong.BuJiMianFuJian.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianFuJian.HasValue ? xianzhong.BuJiMianFuJian.Value : 0 }, //BuJiMianFuJia = xianzhong.BuJiMianFuJian.HasValue ? xianzhong.BuJiMianFuJian.Value : 0, BuJiMianRenYuan = new XianZhongUnit { BaoE = (xianzhong.BuJiMianRenYuan.HasValue ? xianzhong.BuJiMianRenYuan.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianRenYuan.HasValue ? xianzhong.BuJiMianRenYuan.Value : 0 }, //BuJiMianRenYuan = xianzhong.BuJiMianRenYuan.HasValue ? xianzhong.BuJiMianRenYuan.Value : 0, BuJiMianSanZhe = new XianZhongUnit { BaoE = (xianzhong.BuJiMianSanZhe.HasValue ? xianzhong.BuJiMianSanZhe.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianSanZhe.HasValue ? xianzhong.BuJiMianSanZhe.Value : 0 }, //BuJiMianSanZhe = xianzhong.BuJiMianSanZhe.HasValue ? xianzhong.BuJiMianSanZhe.Value : 0, CheDeng = new XianZhongUnit { BaoE = xianzhong.CheDengBaoE.HasValue ? xianzhong.CheDengBaoE.Value : 0, BaoFei = xianzhong.CheDengBaoFei.HasValue ? xianzhong.CheDengBaoFei.Value : 0 }, ChengKe = new XianZhongUnit { BaoE = xianzhong.ChengKeBaoE.HasValue ? xianzhong.ChengKeBaoE.Value : 0, BaoFei = xianzhong.ChengKeBaoFei.HasValue ? xianzhong.ChengKeBaoFei.Value : 0 }, ChengKeBaoENum = xianzhong.ChengKeBaoENum.HasValue ? xianzhong.ChengKeBaoENum.Value : 0, CheSun = new XianZhongUnit { BaoE = xianzhong.CheSunBaoE.HasValue ? xianzhong.CheSunBaoE.Value : 0, BaoFei = xianzhong.CheSunBaoFei.HasValue ? xianzhong.CheSunBaoFei.Value : 0 }, DaoQiang = new XianZhongUnit { BaoE = xianzhong.DaoQiangBaoE.HasValue ? xianzhong.DaoQiangBaoE.Value : 0, BaoFei = xianzhong.DaoQiangBaoFei.HasValue ? xianzhong.DaoQiangBaoFei.Value : 0 }, ForceTotal = xianzhong.ForceTotal.HasValue ? xianzhong.ForceTotal.Value : 0, HuaHen = new XianZhongUnit { BaoE = xianzhong.HuaHenBaoE.HasValue ? xianzhong.HuaHenBaoE.Value : 0, BaoFei = xianzhong.HuaHenBaoFei.HasValue ? xianzhong.HuaHenBaoFei.Value : 0 }, SanZhe = new XianZhongUnit { BaoE = xianzhong.SanZheBaoE.HasValue ? xianzhong.SanZheBaoE.Value : 0, BaoFei = xianzhong.SanZheBaoFei.HasValue ? xianzhong.SanZheBaoFei.Value : 0 }, SheShui = new XianZhongUnit { BaoE = xianzhong.SheShuiBaoE.HasValue ? xianzhong.SheShuiBaoE.Value : 0, BaoFei = xianzhong.SheShuiBaoFei.HasValue ? xianzhong.SheShuiBaoFei.Value : 0 }, SiJi = new XianZhongUnit { BaoE = xianzhong.SiJiBaoE.HasValue ? xianzhong.SiJiBaoE.Value : 0, BaoFei = xianzhong.SiJiBaoFei.HasValue ? xianzhong.SiJiBaoFei.Value : 0, }, TaxTotal = xianzhong.TaxTotal.HasValue ? xianzhong.TaxTotal.Value : 0, TeYue = new XianZhongUnit { BaoE = xianzhong.TeYueBaoE.HasValue ? xianzhong.TeYueBaoE.Value : 0, BaoFei = xianzhong.TeYueBaoFei.HasValue ? xianzhong.TeYueBaoFei.Value : 0 }, ZiRan = new XianZhongUnit { BaoE = xianzhong.ZiRanBaoE.HasValue ? xianzhong.ZiRanBaoE.Value : 0, BaoFei = xianzhong.ZiRanBaoFei.HasValue ? xianzhong.ZiRanBaoFei.Value : 0 }, //2.1.5版本修改 新增6个字段 BuJiMianChengKe = new XianZhongUnit { BaoE = (xianzhong.BuJiMianChengKe.HasValue ? xianzhong.BuJiMianChengKe.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianChengKe.HasValue ? xianzhong.BuJiMianChengKe.Value : 0 }, BuJiMianSiJi = new XianZhongUnit { BaoE = (xianzhong.BuJiMianSiJi.HasValue ? xianzhong.BuJiMianSiJi.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianSiJi.HasValue ? xianzhong.BuJiMianSiJi.Value : 0 }, BuJiMianHuaHen = new XianZhongUnit { BaoE = (xianzhong.BuJiMianHuaHen.HasValue ? xianzhong.BuJiMianHuaHen.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianHuaHen.HasValue ? xianzhong.BuJiMianHuaHen.Value : 0 }, BuJiMianSheShui = new XianZhongUnit { BaoE = (xianzhong.BuJiMianSheShui.HasValue ? xianzhong.BuJiMianSheShui.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianSheShui.HasValue ? xianzhong.BuJiMianSheShui.Value : 0 }, BuJiMianZiRan = new XianZhongUnit { BaoE = (xianzhong.BuJiMianZiRan.HasValue ? xianzhong.BuJiMianZiRan.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianZiRan.HasValue ? xianzhong.BuJiMianZiRan.Value : 0 }, BuJiMianJingShenSunShi = new XianZhongUnit { BaoE = (xianzhong.BuJiMianJingShenSunShi.HasValue ? xianzhong.BuJiMianJingShenSunShi.Value : 0) > 0 ? 1 : 0, BaoFei = xianzhong.BuJiMianJingShenSunShi.HasValue ? xianzhong.BuJiMianJingShenSunShi.Value : 0 }, SanFangTeYue = new XianZhongUnit { BaoE = xianzhong.SanFangTeYueBaoE.HasValue ? xianzhong.SanFangTeYueBaoE.Value : 0, BaoFei = xianzhong.SanFangTeYueBaoFei.HasValue ? xianzhong.SanFangTeYueBaoFei.Value : 0 }, JingShenSunShi = new XianZhongUnit { BaoE = xianzhong.JingShenSunShiBaoE.HasValue ? xianzhong.JingShenSunShiBaoE.Value : 0, BaoFei = xianzhong.JingShenSunShiBaoFei.HasValue ? xianzhong.JingShenSunShiBaoFei.Value : 0 }, HuoWuZeRen = new XianZhongUnit { BaoE = xianzhong.HuoWuZeRenBaoE.HasValue ? xianzhong.HuoWuZeRenBaoE.Value : 0, BaoFei = xianzhong.HuoWuZeRenBaoFei.HasValue ? xianzhong.HuoWuZeRenBaoFei.Value : 0 }, SheBeiSunShi = new XianZhongUnit { BaoE = xianzhong.SheBeiSunShiBaoE.HasValue ? xianzhong.SheBeiSunShiBaoE.Value : 0, BaoFei = xianzhong.SheBeiSunShiBaoFei.HasValue ? xianzhong.SheBeiSunShiBaoFei.Value : 0 }, BuJiMianSheBeiSunShi = new XianZhongUnit { BaoE = xianzhong.BuJiMianSheBeiSunShiBaoE.HasValue ? xianzhong.BuJiMianSheBeiSunShiBaoE.Value : 0, BaoFei = xianzhong.BuJiMianSheBeiSunShiBaoFei.HasValue ? xianzhong.BuJiMianSheBeiSunShiBaoFei.Value : 0 }, XiuLiChang = new XianZhongUnit { BaoE = xianzhong.XiuLiChangBaoE.HasValue ? xianzhong.XiuLiChangBaoE.Value : 0, BaoFei = xianzhong.XiuLiChangBaoFei.HasValue ? xianzhong.XiuLiChangBaoFei.Value : 0 }, FeiYongBuChang = new XianZhongUnit { BaoE = xianzhong.FeiYongBuChangBaoE.HasValue ? xianzhong.FeiYongBuChangBaoE.Value : 0, BaoFei = xianzhong.FeiYongBuChangBaoFei.HasValue ? xianzhong.FeiYongBuChangBaoFei.Value : 0 }, SanZheJieJiaRi = new XianZhongUnit { BaoE = xianzhong.SanZheJieJiaRiBaoE.HasValue ? xianzhong.SanZheJieJiaRiBaoE.Value : 0, BaoFei = xianzhong.SanZheJieJiaRiBaoFei.HasValue ? xianzhong.SanZheJieJiaRiBaoFei.Value : 0 }, FybcDays = xianzhong.FybcDays.HasValue ? xianzhong.FybcDays.Value : 0, //2.1.5修改 结束 JiaYiTotal = xianzhong.JiaYiTotal ?? 0 }; #endregion #region 业务员信息 2017-09-06 item.AgentDetail = new AgentViewModelByBJ { AgentId = xinxi.AgentId ?? 0 }; #endregion #region 优惠活动信息 2017-09-06 if (Activitys != null) { item.ActivityCount = Activitys.Count; #region ActivityDetail List <PreActivity> list = new List <PreActivity>(); PreActivity Activitydetail; foreach (var i in Activitys) { Activitydetail = new PreActivity(); Activitydetail.ActivityName = i.activity_name; Activitydetail.ActivityContent = i.activity_content; list.Add(Activitydetail); } item.Activitys = list; #endregion } #endregion #region 出险信息 item.ClaimInfo = new ClaimInfo { LossBizCount = xinxi.loss_biz_count, LossBizAmount = String.Format("{0:F}", xinxi.loss_biz_amount), LossForceCount = xinxi.loss_force_count, LossForceAmount = String.Format("{0:F}", xinxi.loss_force_amount) }; #endregion if (savequote != null) { item.XianZhongInfo.XiuLiChangType = savequote.HcXiuLiChangType ?? -1; } if (claimDetail != null) { item.ClaimCount = claimDetail.Count; #region ClaimDetail List <ClaimDetailViewModel> list = new List <ClaimDetailViewModel>(); ClaimDetailViewModel detail; foreach (var i in claimDetail) { detail = new ClaimDetailViewModel(); detail.Buid = i.b_uid; detail.CreateTime = i.create_time; detail.StrCreateTime = i.create_time.HasValue ? i.create_time.Value.ToString("yyyy-MM-dd") : ""; detail.EndCaseTime = i.endcase_time; detail.StrEndCaseTime = i.endcase_time.HasValue ? i.endcase_time.Value.ToString("yyyy-MM-dd") : ""; detail.Id = i.id; detail.Liid = i.li_id; detail.LossTime = i.loss_time; detail.StrLossTime = i.loss_time.HasValue ? i.loss_time.Value.ToString("yyyy-MM-dd") : ""; detail.PayAmount = i.pay_amount; detail.PayCompanyName = i.pay_company_name; detail.PayCompanyNo = i.pay_company_no; list.Add(detail); } item.ClaimDetail = list; #endregion } return(item); }