Files
WMS/HHWMS.Web/Areas/Shipment/ViewModels/ShipmentHeaderVMs/ShipmentHeaderListVM.cs
T
2023-07-25 19:20:18 +08:00

73 lines
3.5 KiB
C#

using System.Collections.Generic;
using System.Linq;
using HHWMS.Web.Models;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
namespace HHWMS.Web
{
public partial class ShipmentHeaderListVM : BasePagedListVM<ShipmentHeader_View, ShipmentHeaderSearcher>
{
protected override List<GridAction> InitGridAction()
{
return new List<GridAction>
{
this.MakeStandardAction("ShipmentHeader", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"shipment", dialogWidth: 800),
this.MakeStandardAction("ShipmentHeader", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "shipment", dialogWidth: 800),
this.MakeStandardAction("ShipmentHeader", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "shipment", dialogWidth: 800),
this.MakeStandardAction("ShipmentHeader", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "shipment", dialogWidth: 800),
this.MakeStandardAction("ShipmentHeader", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "shipment", dialogWidth: 800),
this.MakeStandardAction("ShipmentHeader", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "shipment", dialogWidth: 800),
this.MakeStandardAction("ShipmentHeader", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "shipment", dialogWidth: 800),
this.MakeStandardAction("ShipmentHeader", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "shipment"),
};
}
protected override IEnumerable<IGridColumn<ShipmentHeader_View>> InitGridHeader()
{
return new List<GridColumn<ShipmentHeader_View>>{
this.MakeGridHeader(x => x.SourceCode),
this.MakeGridHeader(x => x.Code),
this.MakeGridHeader(x => x.BillType),
this.MakeGridHeader(x => x.CompanyCode),
this.MakeGridHeader(x => x.SupplierCode),
this.MakeGridHeader(x => x.TotalQty),
this.MakeGridHeader(x => x.TotalLines),
this.MakeGridHeader(x => x.FirstStatus),
this.MakeGridHeader(x => x.LastStatus),
this.MakeGridHeader(x => x.Remark),
this.MakeGridHeaderAction(width: 200)
};
}
public override IOrderedQueryable<ShipmentHeader_View> GetSearchQuery()
{
var query = DC.Set<ShipmentHeader>()
.CheckContain(Searcher.SourceCode, x => x.SourceCode)
.CheckContain(Searcher.Code, x => x.Code)
.CheckContain(Searcher.BillType, x => x.BillType)
.CheckEqual(Searcher.FirstStatus, x => x.FirstStatus)
.Select(x => new ShipmentHeader_View
{
ID = x.ID,
SourceCode = x.SourceCode,
Code = x.Code,
BillType = x.BillType,
CompanyCode = x.CompanyCode,
SupplierCode = x.SupplierCode,
TotalQty = x.TotalQty,
TotalLines = x.TotalLines,
FirstStatus = x.FirstStatus,
LastStatus = x.LastStatus,
Remark = x.Remark,
})
.OrderBy(x => x.ID);
return query;
}
}
public class ShipmentHeader_View : ShipmentHeader
{
}
}