yibo 7 years ago
parent
commit
2754136a3f
2 changed files with 18 additions and 15 deletions
  1. +5
    -4
      B3ClientService.Web/Pages/B3ClientService/Reports/CarcassLossAnalyse_/CarcassLossAnalyse.cs
  2. +13
    -11
      B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs

+ 5
- 4
B3ClientService.Web/Pages/B3ClientService/Reports/CarcassLossAnalyse_/CarcassLossAnalyse.cs View File

@ -64,22 +64,23 @@ namespace BWP.Web.Pages.B3ClientService.Reports.CarcassLossAnalyse_
hp.EAdd(new SimpleLabel("生产批次"));
batchSelect = hp.EAdd(new ChoiceBox(B3ClientServiceConsts.DataSources.) { EnableInputArgument = true, EnableTopItem = true, AutoPostBack = true, Width = Unit.Pixel(180) });
var batch = GetYesterdayBatch();
if (!string.IsNullOrEmpty(batch))
batchSelect.Fill(batch, batch);
if (batch != null)
batchSelect.Fill(batch.Item1.ToString(), batch.Item2);
batchSelect.SelectedValueChanged += delegate
{
StartQuery();
};
}
string GetYesterdayBatch()
Tuple<long, string> GetYesterdayBatch()
{
var dom = new DQueryDom(new JoinAlias(typeof(ProductBatch)));
dom.Columns.Add(DQSelectColumn.Field("ID"));
dom.Columns.Add(DQSelectColumn.Field("Name"));
dom.OrderBy.Expressions.Add(DQOrderByExpression.Create("Date", true));
dom.Where.Conditions.Add(DQCondition.LessThan("Date", DateTime.Today));
dom.Range = SelectRange.Top(1);
return dom.EExecuteScalar<string>();
return dom.EExecuteScalar<long, string>();
}
private TitlePanel CreateResultTab()


+ 13
- 11
B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs View File

@ -52,27 +52,25 @@ namespace BWP.Web.Pages.B3ClientService.Reports.CarcassStateAnalyse_
ChoiceBox batchSelect;
DFCheckBox noCodeBox;
DateInput butcherDate;
DFTextBox minInput, maxInput;
private void AddQueryControl(Panel queryPanel)
{
var hp = queryPanel.EAdd(new Panel());
hp.Style.Add("float", "right");
hp.EAdd(new SimpleLabel("屠宰日期"));
butcherDate = hp.EAdd(new DateInput());
noCodeBox = hp.EAdd(new DFCheckBox() { Text = "查看无码", AutoPostBack = true });
noCodeBox.InputAttributes.Add("style", "width:15px;height:15px;");
hp.EAdd(new SimpleLabel("生产批次"));
batchSelect = hp.EAdd(new ChoiceBox(B3ClientServiceConsts.DataSources.) { EnableInputArgument = true, EnableTopItem = true, AutoPostBack = true, Width = Unit.Pixel(160) });
batchSelect = hp.EAdd(new ChoiceBox(B3ClientServiceConsts.DataSources.) { EnableInputArgument = true, EnableTopItem = true, Width = Unit.Pixel(160) });
var batch = GetYesterdayBatch();
if (batch != null)
batchSelect.Fill(batch.Item1.ToString(), batch.Item2);
noCodeBox.CheckedChanged += delegate
{
StartQuery();
};
batchSelect.SelectedValueChanged += delegate
{
StartQuery();
};
hp.EAdd(new SimpleLabel("入库重量"));
minInput = hp.EAdd(new DFTextBox() { Width = Unit.Pixel(50) });
hp.EAdd(new LiteralControl("-"));
maxInput = hp.EAdd(new DFTextBox() { Width = Unit.Pixel(50) });
noCodeBox = hp.EAdd(new DFCheckBox() { Text = "查看无码" });
noCodeBox.InputAttributes.Add("style", "width:15px;height:15px;");
hp.EAdd(new TSButton("开始查询", delegate { StartQuery(); }));
}
Tuple<long, string> GetYesterdayBatch()
@ -148,6 +146,10 @@ namespace BWP.Web.Pages.B3ClientService.Reports.CarcassStateAnalyse_
}
if (noCodeBox.Checked)
query.Where.Conditions.Add(DQCondition.Or(DQCondition.IsNull(DQExpression.Field("BarCode")), DQCondition.EQ("BarCode", "")));
if (!minInput.IsEmpty)
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("InStoreWeight", decimal.Parse(minInput.Text)));
if (!maxInput.IsEmpty)
query.Where.Conditions.Add(DQCondition.LessThanOrEqual("InStoreWeight", decimal.Parse(maxInput.Text)));
var args = new LoadArguments(query);
foreach (var idx in sumColumns)
args.SumColumns.Add(idx);


Loading…
Cancel
Save