You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.9 KiB
C#
79 lines
2.9 KiB
C#
using Mesnac.Action.Base;
|
|
using Mesnac.Action.ChemicalWeighing.Entity;
|
|
using Mesnac.Action.ChemicalWeighing.Product.PptPlan;
|
|
using Mesnac.Action.ChemicalWeighing.Technical.XlRecipe;
|
|
using Mesnac.Controls.Base;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.Report.SolventReport
|
|
{
|
|
/// <summary>
|
|
/// 生产报表初始化窗体
|
|
/// </summary>
|
|
class InitFormAction : ChemicalWeighingAction, IAction
|
|
{
|
|
private RuntimeParameter _runtime;
|
|
public void Run(RuntimeParameter runtime)
|
|
{
|
|
base.RunIni(runtime); //必须要调用的
|
|
this._runtime = runtime;
|
|
ICSharpCode.Core.LoggingService<InitFormAction>.Debug("生产报表-窗体初始化...");
|
|
|
|
//SelectRowAction.OnRefresh -= Process_Event;
|
|
//SelectRowAction.OnRefresh += Process_Event;
|
|
|
|
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
|
|
IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
|
|
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
|
|
starttime.MCValue = DateTime.Parse("00:00:00");
|
|
endtime.MCValue = DateTime.Parse("23:59:59");
|
|
|
|
//var comShiftime = base.GetControlById("comShiftime") as System.Windows.Forms.ComboBox;//班组名称
|
|
//if (comShiftime != null)
|
|
//{
|
|
// List<Pmt_Shiftime> list = TechnicalHelper.GetPmt_ShiftimeList();
|
|
// comShiftime.DataSource = list;
|
|
//}
|
|
var comRecipe = base.GetControlById("comRecipe") as System.Windows.Forms.ComboBox;//配方名称
|
|
if (comRecipe != null)
|
|
{
|
|
//List<SimplePmtRecipe> list = PlanHelper.GetRecipeMaterialListPY();
|
|
IFreeSql _freeSql = DBHelper.FreeHelper.Instance;
|
|
string sql = "select distinct Batch from RT_plan where Batch is not null";
|
|
var list = _freeSql.Select<BatchObj>().WithSql(sql).ToList();
|
|
|
|
comRecipe.DataSource = list;
|
|
comRecipe.DisplayMember = "Batch";
|
|
comRecipe.ValueMember = "Batch";
|
|
}
|
|
|
|
|
|
|
|
}
|
|
#region 事件处理方法
|
|
|
|
private void Process_Event(object sender, EventArgs e)
|
|
{
|
|
if (sender is RuntimeParameter)
|
|
{
|
|
this.Run(sender as RuntimeParameter);
|
|
}
|
|
else
|
|
{
|
|
this.Run(this._runtime);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
public class BatchObj
|
|
{
|
|
public string Batch { get; set; }
|
|
}
|
|
}
|