126 lines
6.0 KiB
C#
126 lines
6.0 KiB
C#
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 HHWMS.Web.Models;
|
|
|
|
|
|
namespace HHWMS.Web
|
|
{
|
|
public partial class ShipmentHeader2ListVM : BasePagedListVM<ShipmentHeader2_View, ShipmentHeader2Searcher>
|
|
{
|
|
public ShipmentDetail2ListVM ShipmentDetails { get; set; } = new ShipmentDetail2ListVM();
|
|
|
|
protected override void InitVM()
|
|
{
|
|
ShipmentDetails.CopyContext(this);
|
|
}
|
|
protected override List<GridAction> InitGridAction()
|
|
{
|
|
return new List<GridAction>
|
|
{
|
|
this.MakeStandardAction("ShipmentHeader2", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ShipmentHeader2", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ShipmentHeader2", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ShipmentHeader2", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ShipmentHeader2", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ShipmentHeader2", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ShipmentHeader2", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ShipmentHeader2", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "xwms"),
|
|
this.MakeAction("ShipmentHeader2","CreateOut",Localizer["Sys.Out"],Localizer["Sys.Out"],GridActionParameterTypesEnum.NoId,"xwms")
|
|
.SetMax(),
|
|
this.MakeAction("ShipmentHeader2","CreateMove",Localizer["Sys.Move"],Localizer["Sys.Move"],GridActionParameterTypesEnum.NoId,"xwms")
|
|
.SetMax(),
|
|
};
|
|
}
|
|
|
|
|
|
protected override IEnumerable<IGridColumn<ShipmentHeader2_View>> InitGridHeader()
|
|
{
|
|
InitVM();
|
|
return new List<GridColumn<ShipmentHeader2_View>>{
|
|
this.MakeGridHeader(x => x.Code)
|
|
.SetFormat((a,b) =>
|
|
{
|
|
string rv = UIService.MakeScriptButton(ButtonTypesEnum.Link,a.Code,$"details('{a.ID}')");
|
|
return rv;
|
|
}).SetWidth(150),
|
|
this.MakeGridHeader(x => x.SourceCode),
|
|
this.MakeGridHeader(x => x.Type),
|
|
this.MakeGridHeader(x => x.ShipTo),
|
|
this.MakeGridHeader(x => x.TotalQty),
|
|
this.MakeGridHeader(x => x.TotalLines),
|
|
this.MakeGridHeader(x => x.Remark),
|
|
this.MakeGridHeader(x => x.Uploadremark).SetHide(),
|
|
this.MakeGridHeader(x => x.UploadTime).SetHide(),
|
|
this.MakeGridHeader(x => x.FirstStatus).SetHide(),
|
|
this.MakeGridHeader(x => x.LastStatus).SetHide(),
|
|
this.MakeGridHeader(x => x.UploadStatus).SetHide(),
|
|
this.MakeGridHeader(x => x.UserDef1).SetHide(),
|
|
this.MakeGridHeader(x => x.UserDef2).SetHide(),
|
|
this.MakeGridHeader(x => x.UserDef3).SetHide(),
|
|
this.MakeGridHeader(x => x.UserDef4).SetHide(),
|
|
this.MakeGridHeaderAction(width: 200)
|
|
};
|
|
}
|
|
|
|
public override IOrderedQueryable<ShipmentHeader2_View> GetSearchQuery()
|
|
{
|
|
var query = DC.Set<ShipmentHeader2>()
|
|
.CheckEqual(Searcher.WarehouseId, x => x.WarehouseId)
|
|
.CheckContain(Searcher.Code, x=>x.Code)
|
|
.CheckContain(Searcher.SourceCode, x=>x.SourceCode)
|
|
.CheckContain(Searcher.Type, x=>x.Type)
|
|
.CheckContain(Searcher.ShipTo, x=>x.ShipTo)
|
|
.CheckEqual(Searcher.FirstStatus, x=>x.FirstStatus)
|
|
.CheckEqual(Searcher.LastStatus, x=>x.LastStatus)
|
|
.CheckEqual(Searcher.UploadStatus, x=>x.UploadStatus)
|
|
.CheckContain(Searcher.UserDef1, x=>x.UserDef1)
|
|
.CheckContain(Searcher.UserDef2, x=>x.UserDef2)
|
|
.CheckContain(Searcher.UserDef3, x=>x.UserDef3)
|
|
.CheckContain(Searcher.UserDef4, x=>x.UserDef4)
|
|
.Select(x => new ShipmentHeader2_View
|
|
{
|
|
ID = x.ID,
|
|
WarehouseId = x.WarehouseId,
|
|
WarehouseCode = x.WarehouseCode,
|
|
Code = x.Code,
|
|
CompanyId = x.CompanyId,
|
|
CompanyCode = x.CompanyCode,
|
|
SourceCode = x.SourceCode,
|
|
SourcePlatform = x.SourcePlatform,
|
|
Type = x.Type,
|
|
ShipTo = x.ShipTo,
|
|
Priority = x.Priority,
|
|
Station = x.Station,
|
|
TotalQty = x.TotalQty,
|
|
TotalLines = x.TotalLines,
|
|
Remark = x.Remark,
|
|
Uploadremark = x.Uploadremark,
|
|
UploadTime = x.UploadTime,
|
|
AppointmentTime = x.AppointmentTime,
|
|
FirstStatus = x.FirstStatus,
|
|
LastStatus = x.LastStatus,
|
|
UploadStatus = x.UploadStatus,
|
|
Enable = x.Enable,
|
|
Deleted = x.Deleted,
|
|
UserDef1 = x.UserDef1,
|
|
UserDef2 = x.UserDef2,
|
|
UserDef3 = x.UserDef3,
|
|
UserDef4 = x.UserDef4,
|
|
})
|
|
.OrderBy(x => x.ID);
|
|
return query;
|
|
}
|
|
|
|
}
|
|
|
|
public class ShipmentHeader2_View : ShipmentHeader2{
|
|
|
|
}
|
|
}
|