public List <VehicleLevelModel> SelectSprayPaintVehicle() { var result = CFAlwaysOnReadDbScopeManager.Execute(conn => DalSprayPaintVehicle.SelectVehicleLevel(conn)); var serviceInfo = GetPaintServiceInfo(); foreach (var item in result) { var paintService = CFAlwaysOnReadDbScopeManager.Execute(conn => DalSprayPaintVehicle.SelectPaintServiceInfo(conn, item.VehicleLevel)); foreach (var service in paintService) { PaintService info = new PaintService { VehicleLevel = item.VehicleLevel, ServiceId = service.ServiceId, DisplayIndex = service.DisplayIndex, ServiceName = serviceInfo.FirstOrDefault(p => p.ServiceId.Equals(service.ServiceId))?.ServersName }; item.PaintService.Add(info); } } return(result); }
/// <summary> /// 获取指定首字母开头的车型档次,未指定则获取全部 /// </summary> /// <param name="initalWord"></param> /// <returns></returns> private List <VehicleLevelViewModel> GetVehicleLevels(string initalWord = "") => CFAlwaysOnReadDbScopeManager.Execute(conn => DalSprayPaintVehicle.SelectVehicleLevel(conn, initalWord));