122 lines
5.5 KiB
C#
122 lines
5.5 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.xwms.ViewModels.ReceiptHeader2VMs
|
|
{
|
|
public partial class ReceiptHeader2ListVM : BasePagedListVM<ReceiptHeader2_View, ReceiptHeader2Searcher>
|
|
{
|
|
public ReceiptDetail2ListVM ReceiptDetails { get; set; } = new ReceiptDetail2ListVM();
|
|
|
|
protected override void InitVM()
|
|
{
|
|
ReceiptDetails.CopyContext(this);
|
|
}
|
|
|
|
protected override List<GridAction> InitGridAction()
|
|
{
|
|
return new List<GridAction>
|
|
{
|
|
this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"xwms", dialogWidth: 800,600),
|
|
this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "xwms", dialogWidth: 800),
|
|
this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "xwms"),
|
|
};
|
|
}
|
|
|
|
|
|
protected override IEnumerable<IGridColumn<ReceiptHeader2_View>> InitGridHeader()
|
|
{
|
|
InitVM();
|
|
return new List<GridColumn<ReceiptHeader2_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.Type),
|
|
this.MakeGridHeader(x => x.SourceCode).SetWidth(150),
|
|
this.MakeGridHeader(x => x.SupplierCode).SetHide(),
|
|
this.MakeGridHeader(x => x.SupplierName).SetWidth(150),
|
|
this.MakeGridHeader(x => x.TotalQty)
|
|
.SetFormat((a,b) =>
|
|
{
|
|
return a.TotalQty.ToString().TrimEnd('0').TrimEnd('.');
|
|
}),
|
|
this.MakeGridHeader(x => x.TotalLines),
|
|
this.MakeGridHeader(x => x.Remark).SetHide(),
|
|
this.MakeGridHeader(x => x.UploadStatus),
|
|
this.MakeGridHeader(x => x.Uploadremark),
|
|
this.MakeGridHeader(x => x.UploadTime).SetHide(),
|
|
this.MakeGridHeader(x => x.AppointmentTime).SetHide(),
|
|
this.MakeGridHeader(x => x.FirstStatus),
|
|
this.MakeGridHeader(x => x.LastStatus),
|
|
this.MakeGridHeader(x => x.UserDef1).SetHide(),
|
|
this.MakeGridHeader(x => x.UserDef2).SetHide(),
|
|
this.MakeGridHeader(x => x.UserDef3).SetHide(),
|
|
this.MakeGridHeader(x => x.Station),
|
|
this.MakeGridHeaderAction(width: 200)
|
|
};
|
|
}
|
|
|
|
public override IOrderedQueryable<ReceiptHeader2_View> GetSearchQuery()
|
|
{
|
|
var query = DC.Set<ReceiptHeader2>()
|
|
.CheckEqual(Searcher.WarehouseId, x => x.WarehouseId)
|
|
.CheckContain(Searcher.Code, x => x.Code)
|
|
.CheckContain(Searcher.Type, x => x.Type)
|
|
.CheckContain(Searcher.SourceCode, x => x.SourceCode)
|
|
.CheckContain(Searcher.SupplierName, x => x.SupplierName)
|
|
.Select(x => new ReceiptHeader2_View
|
|
{
|
|
ID = x.ID,
|
|
Code = x.Code,
|
|
CompanyId = x.CompanyId,
|
|
CompanyCode = x.CompanyCode,
|
|
Type = x.Type,
|
|
SourceCode = x.SourceCode,
|
|
SourcePlatform = x.SourcePlatform,
|
|
SupplierId = x.SupplierId,
|
|
SupplierCode = x.SupplierCode,
|
|
SupplierName = x.SupplierName,
|
|
TotalQty = x.TotalQty,
|
|
TotalLines = x.TotalLines,
|
|
FreeScan = x.FreeScan,
|
|
Remark = x.Remark,
|
|
UploadStatus = x.UploadStatus,
|
|
Uploadremark = x.Uploadremark,
|
|
UploadTime = x.UploadTime,
|
|
AppointmentTime = x.AppointmentTime,
|
|
FirstStatus = x.FirstStatus,
|
|
LastStatus = x.LastStatus,
|
|
Enable = x.Enable,
|
|
Deleted = x.Deleted,
|
|
Scanid = x.Scanid,
|
|
UserDef1 = x.UserDef1,
|
|
UserDef2 = x.UserDef2,
|
|
UserDef3 = x.UserDef3,
|
|
Station = x.Station,
|
|
})
|
|
.OrderBy(x => x.ID);
|
|
return query;
|
|
}
|
|
|
|
}
|
|
|
|
public class ReceiptHeader2_View : ReceiptHeader2{
|
|
|
|
}
|
|
}
|