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.
48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using Mesnac.Action.Base;
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.LjMaterial
|
|
{
|
|
public class InsertAction:ChemicalWeighingAction,IAction
|
|
{
|
|
|
|
/// <summary>
|
|
/// 新增物料事件定义
|
|
/// </summary>
|
|
public static event EventHandler OnInsertMaterial;
|
|
|
|
private RuntimeParameter _runtime;
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
{
|
|
base.RunIni(runtime); //必须调用
|
|
this._runtime = runtime;
|
|
DoWork();
|
|
}
|
|
|
|
private void DoWork()
|
|
{
|
|
this._runtime.BaseControl.MCEnabled = false;
|
|
|
|
FrmMaterial frmInsertMaterial = new FrmMaterial(0);
|
|
frmInsertMaterial.ShowDialog(this._runtime.BaseControl.MCRoot as Control);
|
|
if (frmInsertMaterial.DialogResult == DialogResult.OK)
|
|
{
|
|
if (OnInsertMaterial != null)
|
|
{
|
|
OnInsertMaterial(this._runtime.BaseControl.MCRoot, System.EventArgs.Empty);
|
|
}
|
|
|
|
frmInsertMaterial.Dispose();
|
|
|
|
}
|
|
|
|
this._runtime.BaseControl.MCEnabled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
} |