版权
控制器这边:
public ActionResult BangDingSelect(int CustomerVehicleID)
{
int CheliangID;
try
{
SelectCarVo listCarCode = (from tbCarCode in myModel.B_CustomerVehicleTable
join tbCarType in myModel.S_ModelTable on tbCarCode.VehicleTypeID equals tbCarType.VehicleTypeID
join tbCustomer in myModel.B_CustomerTable on tbCarCode.CustomerID equals tbCustomer.CustomerID
join tbMember in myModel.R_Member on tbCustomer.CustomerID equals tbMember.CustomerID
where tbCarCode.CustomerVehicleID == CustomerVehicleID
select new SelectCarVo
{
CustomerVehicleID = tbCarCode.CustomerVehicleID,
CustomerID = tbCustomer.CustomerID,
VehicleTypeID = tbCarType.VehicleTypeID,
LicensePlateNumber = tbCarCode.LicensePlateNumber,
Models = tbCarType.Models,
DiscountBusy = tbCarCode.DiscountBusy,
CustomerReferred = tbCustomer.CustomerReferred,
PresentIntergral = tbMember.PresentIntergral,
ChassisNumber = tbCarCode.ChassisNumber
}).Single();
CheliangID = listCarCode.CustomerVehicleID;
Session["CustomerVehicleID"] = CheliangID;
return Json(listCarCode, JsonRequestBehavior.AllowGet);
}
catch (Exception e)
{
Console.WriteLine(e);
}
return Json(false, JsonRequestBehavior.AllowGet);
}
js代码:
//绑定数据
function ChaXun() {
$.post("/Servicing/BusinessAccept/BangDingSelect",
{
CustomerVehicleId: CustomerVehicleId,
},
function (data) {
//绑定form表单的数据
loadDatatoForm("InsertRepairBill", data);
$("#CarCodenum").modal("hide");
});
}