InsuranceclaimsController
目录
1、 InsuranceclaimsController
1.1、 判断是否存在索赔单据
1.1.1、 //结算状态名称
1.1.2、 //维修单号
1.1.3、 //保单金额
using QXQPS.Models;
using QXQPS.Vo;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace QXQPS.Areas.MechanicsManagment.Controllers
{
public class InsuranceclaimsController : Controller
{
// GET: MechanicsManagment/Insuranceclaims
Models.QXQPEntities myModels = new Models.QXQPEntities();
public ActionResult SelectInsuranceData(int InsuranceDetailID)//判断是否存在索赔单据
{
try
{
var lingItem = (from tbInsurance in myModels.PW_Insurance
join tbInsuranceDetail in myModels.SYS_InsuranceDetail on tbInsurance.InsuranceDetailID equals tbInsuranceDetail.InsuranceDetailID
join tbReception in myModels.PW_Reception on tbInsuranceDetail.ReceptionID equals tbReception.ReceptionID
join tbInsuranceCom in myModels.SYS_InsuranceCom on tbInsuranceDetail.InsuranceComID equals tbInsuranceCom.InsuranceComID
join tbRepair in myModels.SYS_Repair on tbReception.RepairID equals tbRepair.RepairID
join tbDocumentState in myModels.SYS_DocumentState on tbReception.DocumentStateID equals tbDocumentState.DocumentStateID
join tbBalanceState in myModels.SYS_BalanceState on tbReception.BalanceStateID equals tbBalanceState.BalanceStateID
join tbCustomerSou in myModels.SYS_CustomerSou on tbReception.CustomerSouID equals tbCustomerSou.CustomerSouID
where tbInsurance.InsuranceDetailID == InsuranceDetailID
select new ReceptionVo
{
CustomerNum = tbReception.CustomerNum.Trim(),//客户编号
ReceptionID = tbReception.ReceptionID,//客户接待ID
DocumentStateID = tbDocumentState.DocumentStateID,//单据状态ID
DocumentState = tbDocumentState.DocumentState.Trim(),//单据状态名称
BalanceStateID = tbBalanceState.BalanceStateID,//结算状态ID
BalanceState = tbBalanceState.BalanceState.Trim(),
CarNum = tbReception.CarNum.Trim(),//车牌
VehicleType = tbReception.VehicleType.Trim(),//车型
MaintenanceNum = tbReception.MaintenanceNum.Trim(),
Owner = tbReception.Owner.Trim(),//车主
OpenDates = tbInsurance.OpenDate.ToString(),//开单日期
balanceDates = tbInsurance.BalanceDate.ToString(),//结算日期
ToAudit = tbInsurance.ToAudit,//审核否
InsuranceID = tbInsurance.InsuranceID,//三包ID
InsuranceDetailID = tbInsuranceDetail.InsuranceDetailID,//三包明细ID
InsuranceComID = tbInsuranceCom.InsuranceComID,//索赔厂家ID
ClaimStaff = tbInsurance.ClaimsStaff.Trim(),//索赔员工
ToTicket = tbInsurance.ToTicket != true ? "false" : "true",//是否开票
InsuranceNum = tbInsurance.InsuranceNum.Trim(),//索赔单号
ReportNum = tbInsuranceDetail.ReportNum,//报案编号
PolicyNum = tbInsuranceDetail.PolicyNum,//保单号
PolicyMoney = (decimal)tbInsuranceDetail.PolicyMoney,
Amount = tbInsurance.Amount,//总金额
Describe = tbInsurance.Remark.Trim(),//备注
}).Single();
return Json(lingItem, JsonRequestBehavior.AllowGet);
}
catch (Exception)
{
return Json(false, JsonRequestBehavior.AllowGet);
}
}