using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core.Extensions; using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations; using cy_scdz.Model.Oder; namespace cy_scdz.ViewModel.Order.OrderProductionVMs { public partial class OrderProductionListVM : BasePagedListVM { protected override List InitGridAction() { return new List { this.MakeStandardAction("OrderProduction", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"Order", dialogWidth: 800), this.MakeStandardAction("OrderProduction", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "Order", dialogWidth: 800), this.MakeStandardAction("OrderProduction", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "Order", dialogWidth: 800), this.MakeStandardAction("OrderProduction", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "Order", dialogWidth: 800), this.MakeStandardAction("OrderProduction", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "Order", dialogWidth: 800), this.MakeStandardAction("OrderProduction", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "Order", dialogWidth: 800), this.MakeStandardAction("OrderProduction", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "Order", dialogWidth: 800), this.MakeStandardAction("OrderProduction", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "Order"), }; } protected override IEnumerable> InitGridHeader() { return new List>{ this.MakeGridHeader(x => x.Title_view), this.MakeGridHeader(x => x.Workbook16KCount), this.MakeGridHeader(x => x.Workbook16KPrice), this.MakeGridHeader(x => x.Workbook16KManufacturerId), this.MakeGridHeader(x => x.Workbook32KCount), this.MakeGridHeader(x => x.Workbook32KPrice), this.MakeGridHeader(x => x.Workbook32KManufacturerId), this.MakeGridHeader(x => x.PictureBook16KCount), this.MakeGridHeader(x => x.PictureBook16KPrice), this.MakeGridHeader(x => x.PictureBook16KManufacturerId), this.MakeGridHeader(x => x.PictureBook32KCount), this.MakeGridHeader(x => x.PictureBook32KPrice), this.MakeGridHeader(x => x.PictureBook32KManufacturerId), this.MakeGridHeader(x => x.PictureBookA4Count), this.MakeGridHeader(x => x.PictureBookA4KPrice), this.MakeGridHeader(x => x.PictureBookA4KManufacturerId), this.MakeGridHeader(x => x.LargeCharacterBookCount), this.MakeGridHeader(x => x.LargeCharacterPrice), this.MakeGridHeader(x => x.LargeCharacterManufacturerIds), this.MakeGridHeader(x => x.Mark), this.MakeGridHeader(x => x.DeliveryTime), this.MakeGridHeader(x => x.Chunqiuji), this.MakeGridHeader(x => x.IsOver), this.MakeGridHeaderAction(width: 200) }; } public override IOrderedQueryable GetSearchQuery() { var query = DC.Set() .Select(x => new OrderProduction_View { ID = x.ID, Title_view = x.Oder.Title, Workbook16KCount = x.Workbook16KCount, Workbook16KPrice = x.Workbook16KPrice, Workbook16KManufacturerId = x.Workbook16KManufacturerId, Workbook32KCount = x.Workbook32KCount, Workbook32KPrice = x.Workbook32KPrice, Workbook32KManufacturerId = x.Workbook32KManufacturerId, PictureBook16KCount = x.PictureBook16KCount, PictureBook16KPrice = x.PictureBook16KPrice, PictureBook16KManufacturerId = x.PictureBook16KManufacturerId, PictureBook32KCount = x.PictureBook32KCount, PictureBook32KPrice = x.PictureBook32KPrice, PictureBook32KManufacturerId = x.PictureBook32KManufacturerId, PictureBookA4Count = x.PictureBookA4Count, PictureBookA4KPrice = x.PictureBookA4KPrice, PictureBookA4KManufacturerId = x.PictureBookA4KManufacturerId, LargeCharacterBookCount = x.LargeCharacterBookCount, LargeCharacterPrice = x.LargeCharacterPrice, LargeCharacterManufacturerIds = x.LargeCharacterManufacturerIds, Mark = x.Mark, DeliveryTime = x.DeliveryTime, Chunqiuji = x.Chunqiuji, IsOver = x.IsOver, }) .OrderBy(x => x.ID); return query; } } public class OrderProduction_View : OrderProduction{ [Display(Name = "项目名称")] public String Title_view { get; set; } } }