屠宰场管理服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB

using BWP.B3ClientService;
using BWP.B3ClientService.BO;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
using TSingSoft.WebPluginFramework;
namespace BWP.Web.Utils
{
public static class B3ClientServiceChoiceBoxDataProvider
{
public static void Register()
{
ChoiceBoxSettings.Register(B3ClientServiceConsts.DataSources., argu =>
{
var dom = new DQueryDom(new JoinAlias(typeof(ProductBatch)));
dom.Columns.Add(DQSelectColumn.Field("Name"));
dom.Columns.Add(DQSelectColumn.Field("ID"));
if (!string.IsNullOrWhiteSpace(argu.InputArgument))
{
dom.Where.Conditions.Add(DQCondition.Like("Name", argu.InputArgument));
}
dom.OrderBy.Expressions.Add(DQOrderByExpression.Create("Date", true));
return dom.EExecuteList<string, long>().Select(x => new TSingSoft.WebControls2.WordPair(x.Item1, x.Item2.ToString()));
});
}
}
}