|
|
|
|
using Mesnac.Action.Base;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjMaterial;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjPlanning.Db;
|
|
|
|
|
using Mesnac.Controls.Base;
|
|
|
|
|
using Mesnac.Controls.Default;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.LjRecipeData
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public class SelectSingleAction : ChemicalWeighingAction, IAction
|
|
|
|
|
{
|
|
|
|
|
private DbMCControl MaterialGridControl = null; //物料列表控件
|
|
|
|
|
private RuntimeParameter Runtime;
|
|
|
|
|
|
|
|
|
|
private MCCombobox LjFormulaKinds = null;
|
|
|
|
|
private MCTextBox LjFormulaName = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//public static event EventHandler OnSelectSingle;
|
|
|
|
|
|
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
|
|
|
{
|
|
|
|
|
base.RunIni(runtime); //必须调用
|
|
|
|
|
this.Runtime = runtime;
|
|
|
|
|
|
|
|
|
|
MaterialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Lj_Formula").FirstOrDefault(); //获取物料数据控件
|
|
|
|
|
|
|
|
|
|
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
|
|
|
|
|
|
|
|
|
|
LjFormulaKinds = mcControllist.FirstOrDefault(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "LjFormulaKinds").BaseControl as MCCombobox; //选择查询类型
|
|
|
|
|
string value = LjFormulaKinds.MCValue.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LjFormulaName = mcControllist.FirstOrDefault(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "LjFormulaName").BaseControl as MCTextBox; //选择查询名称
|
|
|
|
|
|
|
|
|
|
string name=LjFormulaName.MCValue.ToString();
|
|
|
|
|
|
|
|
|
|
DataTable table = LjFormulaDb.GetMainTable(value,name);
|
|
|
|
|
|
|
|
|
|
if (this.MaterialGridControl != null && this.MaterialGridControl.BaseControl != null)
|
|
|
|
|
{
|
|
|
|
|
this.MaterialGridControl.BaseControl.BindDataSource = null;
|
|
|
|
|
this.MaterialGridControl.BaseControl.BindDataSource = table;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FileControl()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if ()
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|