CustomerbasicController
目录
1、 CustomerbasicController
1.1、 /// 查询
1.1.1、 //保险种类
1.1.2、 //所属部门
1.1.3、 //客户类别
1.1.4、 //所在区域
using QXQPS.Models;
using QXQPS.Vo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace QXQPS.Areas.BasicdataManagment.Controllers
{
public class CustomerbasicController : Controller
{
// GET: BasicdataManagment/Customerbasic ///BasicdataManagment/Customerbasic/Num 0 ()
-
- /// 查询
/// </summary>
/// <param name="bsgridPage"></param>
/// <returns></returns>
public ActionResult SelectMaintenance(BsgridPage bsgridPage, int RegionID)
{
var listMaintenance = (from tbMaintenance in myModels.SYS_MaintenanceCus
//join tbVehicleType in myModels.SYS_VehicleType on tbMaintenance.VehicleTypeID equals tbVehicleType.VehicleTypeID//车型
join tbInsuranceSpe in myModels.SYS_InsuranceSpe on tbMaintenance.InsuranceSpeID equals tbInsuranceSpe.InsuranceSpeID
join tbDepartment in myModels.SYS_Department on tbMaintenance.DepartmentID equals tbDepartment.DepartmentID
join tbCarder in myModels.SYS_Carder on tbMaintenance.CarderID equals tbCarder.CarderID//所属员工
join tbCustomerType in myModels.SYS_CustomerType on tbMaintenance.CustomerLevelID equals tbCustomerType.CustomerTypeID
join tbCustomerLevel in myModels.SYS_CustomerLevel on tbMaintenance.CustomerLevelID equals tbCustomerLevel.CustomerLevelID//客户等级
join tbRegion in myModels.SYS_Region on tbMaintenance.RegionID equals tbRegion.RegionID
join tbCustomerSou in myModels.SYS_CustomerSou on tbMaintenance.CustomerSouID equals tbCustomerSou.CustomerSouID//客户来源
select new MaintenanceVo
{
RegionID = tbRegion.RegionID,//区域ID
MaintenanceCusID = tbMaintenance.MaintenanceCusID,//维修客户ID
CustomerNum = tbMaintenance.CustomerNum,//客户编号
Owner = tbMaintenance.Owner,//车主
LicenseCode = tbMaintenance.LicenseCode,//车牌号码
VehicleType = tbMaintenance.VehicleType,//车型
EngineNum = tbMaintenance.EngineNum,//发动机号
FrameNum = tbMaintenance.FrameNum,//车架号
RepairMan = tbMaintenance.RepairMan,//送修人
RepairTele = tbMaintenance.RepairTele,//送修人电话
MobilePhone = tbMaintenance.MobilePhone,//车主手机
InsuranceSpeName = tbInsuranceSpe.InsuranceSpeName,//保险种类
InitialStartDates = tbMaintenance.InitialStartDate.ToString(),//保险起始日
InitialEndDates = tbMaintenance.InitialEndDate.ToString(),//保险终止日
Address = tbMaintenance.Address,//车主地址
DriveDates = tbMaintenance.DriveDate.ToString(),//行驶证年审日期
DepartmentName = tbDepartment.DepartmentName,//所属部门
Carder = tbCarder.CarderName,//所属员工
CustomerLevel = tbCustomerLevel.CustomerLevel,//客户等级
CustomerSou = tbCustomerSou.CustomerSou,//客户来源
CustomerType = tbCustomerType.CustomerType,//客户类别
Region = tbRegion.RegionName,//所在区域
InputPerson = tbMaintenance.InputPerson,//录入人
}).ToList();
if (RegionID > 0)
{
listMaintenance = listMaintenance.Where(m => m.RegionID == RegionID).ToList();
}
int count = listMaintenance.Count();
List<MaintenanceVo> listFittingsInfo = listMaintenance.OrderByDescending(m => RegionID).Skip(bsgridPage.GetStartIndex()).Take(bsgridPage.pageSize).ToList();
Bsgrid<MaintenanceVo> bsgrid = new Bsgrid<MaintenanceVo>()
{
success = true,
totalRows = count,
curPage = bsgridPage.curPage,
data = listFittingsInfo,
};
return Json(bsgrid, JsonRequestBehavior.AllowGet);
}
/// <summary>