|
|
using BWP.B3Frameworks.Utils;
|
|
|
using BWP.B3SheepButcherManage;
|
|
|
using BWP.B3SheepButcherManage.BO;
|
|
|
using BWP.B3UnitedInfos.BO;
|
|
|
using Forks.EnterpriseServices.DomainObjects2;
|
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery;
|
|
|
using Forks.EnterpriseServices.SqlDoms;
|
|
|
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 B3SheepButcherManageChoiceBoxProvider
|
|
|
{
|
|
|
public static void Register()
|
|
|
{
|
|
|
ChoiceBoxSettings.Register(B3SheepButcherManageConsts.DataSources.可屠宰存货属性, (argu) =>
|
|
|
new ChoiceBoxQueryHelper<GoodsProperty>(argu, true)
|
|
|
{
|
|
|
BeforeQuery = query =>
|
|
|
{
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("IsButchery", true));
|
|
|
DomainUtil.AddDomainPermissionLimit(query);
|
|
|
}
|
|
|
}.GetData());
|
|
|
|
|
|
ChoiceBoxSettings.Register(B3SheepButcherManageConsts.DataSources.活体级别, argu =>
|
|
|
{
|
|
|
var goods = new JoinAlias(typeof(Livestock));
|
|
|
var goodsProperty = new JoinAlias(typeof(GoodsProperty));
|
|
|
var dom = new DQueryDom(goods);
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsProperty), DQCondition.EQ(goods, "GoodsProperty_ID", goodsProperty, "ID"));
|
|
|
dom.Columns.Add(DQSelectColumn.Field("Name", goods));
|
|
|
dom.Columns.Add(DQSelectColumn.Field("ID", goods));
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ(goodsProperty, "IsButchery", true));
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ("Stopped", false));
|
|
|
DomainUtil.AddDomainPermissionLimit(dom, typeof(GoodsProperty), goodsProperty);
|
|
|
if (!string.IsNullOrEmpty(argu.InputArgument))
|
|
|
{
|
|
|
dom.Where.Conditions.Add(DQCondition.Or(DQCondition.Like("Name", argu.InputArgument), DQCondition.Like("Spell", argu.InputArgument), DQCondition.Like("Code", argu.InputArgument)));
|
|
|
}
|
|
|
return dom.EExecuteList<string, long>().Select(x => new WordPair(x.Item1.ToString(), x.Item2.ToString()));
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}
|