65 lines
2.7 KiB
C#
65 lines
2.7 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.configs.ViewModels.CustomerVMs
|
|
{
|
|
public partial class CustomerListVM : BasePagedListVM<Customer_View, CustomerSearcher>
|
|
{
|
|
protected override List<GridAction> InitGridAction()
|
|
{
|
|
return new List<GridAction>
|
|
{
|
|
this.MakeStandardAction("Customer", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"configs", dialogWidth: 800),
|
|
this.MakeStandardAction("Customer", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800),
|
|
this.MakeStandardAction("Customer", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "configs", dialogWidth: 800),
|
|
this.MakeStandardAction("Customer", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "configs", dialogWidth: 800),
|
|
this.MakeStandardAction("Customer", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "configs", dialogWidth: 800),
|
|
this.MakeStandardAction("Customer", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "configs", dialogWidth: 800),
|
|
this.MakeStandardAction("Customer", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
|
|
this.MakeStandardAction("Customer", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
|
|
};
|
|
}
|
|
|
|
|
|
protected override IEnumerable<IGridColumn<Customer_View>> InitGridHeader()
|
|
{
|
|
return new List<GridColumn<Customer_View>>{
|
|
this.MakeGridHeader(x => x.Code),
|
|
this.MakeGridHeader(x => x.Type),
|
|
this.MakeGridHeader(x => x.Name),
|
|
this.MakeGridHeaderAction(width: 200)
|
|
};
|
|
}
|
|
|
|
public override IOrderedQueryable<Customer_View> GetSearchQuery()
|
|
{
|
|
var query = DC.Set<Customer>()
|
|
.CheckContain(Searcher.Code, x=>x.Code)
|
|
.CheckContain(Searcher.Type, x=>x.Type)
|
|
.CheckContain(Searcher.Name, x=>x.Name)
|
|
.Select(x => new Customer_View
|
|
{
|
|
ID = x.ID,
|
|
Code = x.Code,
|
|
Type = x.Type,
|
|
Name = x.Name,
|
|
})
|
|
.OrderBy(x => x.ID);
|
|
return query;
|
|
}
|
|
|
|
}
|
|
|
|
public class Customer_View : Customer{
|
|
|
|
}
|
|
}
|