0907 晚上临时提交

master
nodyang 1 year ago
parent 62bbcfaf91
commit 9f13b74e6d

@ -4771,5 +4771,40 @@ namespace Mesnac.Action.ChemicalWeighing
#endregion #endregion
public DataKeyValue Plan0_RecipeCode { get; set; }
public DataKeyValue Plan0_PlanCode { get; set; }
public DataKeyValue Plan0_Batch { get; set; }
public DataKeyValue Plan0_Start { get; set; }
public DataKeyValue Plan0_Pause { get; set; }
public DataKeyValue Plan0_Stop { get; set; }
public DataKeyValue Plan1_RecipeCode { get; set; }
public DataKeyValue Plan1_PlanCode { get; set; }
public DataKeyValue Plan1_Batch { get; set; }
public DataKeyValue Plan1_Start { get; set; }
public DataKeyValue Plan1_Pause { get; set; }
public DataKeyValue Plan1_Stop { get; set; }
public DataKeyValue Plan2_RecipeCode { get; set; }
public DataKeyValue Plan2_PlanCode { get; set; }
public DataKeyValue Plan2_Batch { get; set; }
public DataKeyValue Plan2_Start { get; set; }
public DataKeyValue Plan2_Pause { get; set; }
public DataKeyValue Plan2_Stop { get; set; }
public DataKeyValue Plan3_RecipeCode { get; set; }
public DataKeyValue Plan3_PlanCode { get; set; }
public DataKeyValue Plan3_Batch { get; set; }
public DataKeyValue Plan3_Start { get; set; }
public DataKeyValue Plan3_Pause { get; set; }
public DataKeyValue Plan3_Stop { get; set; }
public DataKeyValue Status0 { get; set; }
public DataKeyValue Status1 { get; set; }
public DataKeyValue Status2 { get; set; }
public DataKeyValue Status3 { get; set; }
public DataKeyValue End0 { get; set; }
public DataKeyValue End1 { get; set; }
public DataKeyValue End2 { get; set; }
public DataKeyValue End3 { get; set; }
} }
} }

@ -92,21 +92,21 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
// 第一台干混机 // 第一台干混机
switch (_id) // switch (_id)
{ // {
case 1 : // case 1 :
LjMixManagerPlc.DownD1Recipe(recipePlcViews, recipeSteps); // LjMixManagerPlc.DownD1Recipe(recipePlcViews, recipeSteps);
break; // break;
case 2 : // case 2 :
LjMixManagerPlc.DownD2Recipe(recipePlcViews, recipeSteps); // LjMixManagerPlc.DownD2Recipe(recipePlcViews, recipeSteps);
break; // break;
case 3 : // case 3 :
LjMixManagerPlc.DownD3Recipe(recipePlcViews, recipeSteps); // LjMixManagerPlc.DownD3Recipe(recipePlcViews, recipeSteps);
break; // break;
case 4 : // case 4 :
LjMixManagerPlc.DownD4Recipe(recipePlcViews, recipeSteps); // LjMixManagerPlc.DownD4Recipe(recipePlcViews, recipeSteps);
break; // break;
} // }
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;

@ -113,34 +113,34 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
// 第一台干混机 // 第一台干混机
switch (_id) // switch (_id)
{ // {
case 1 : // case 1 :
LjMixManagerPlc.DownG1Recipe(rG1,rG2, recipeSteps); // LjMixManagerPlc.DownG1Recipe(rG1,rG2, recipeSteps);
break; // break;
case 2 : // case 2 :
LjMixManagerPlc.DownG2Recipe(rG1,rG2, recipeSteps); // LjMixManagerPlc.DownG2Recipe(rG1,rG2, recipeSteps);
break; // break;
case 3 : // case 3 :
LjMixManagerPlc.DownG3Recipe(rG1,rG2, recipeSteps); // LjMixManagerPlc.DownG3Recipe(rG1,rG2, recipeSteps);
break; // break;
case 4 : // case 4 :
LjMixManagerPlc.DownG4Recipe(rG1,rG2, recipeSteps); // LjMixManagerPlc.DownG4Recipe(rG1,rG2, recipeSteps);
break; // break;
//
case 5 : // case 5 :
LjMixManagerPlc.DownG5Recipe(rG1,rG2, recipeSteps); // LjMixManagerPlc.DownG5Recipe(rG1,rG2, recipeSteps);
break; // break;
case 6 : // case 6 :
LjMixManagerPlc.DownG6Recipe(rG1,rG2, recipeSteps); // LjMixManagerPlc.DownG6Recipe(rG1,rG2, recipeSteps);
break; // break;
case 7 : // case 7 :
LjMixManagerPlc.DownG7Recipe(rG1,rG2, recipeSteps); // LjMixManagerPlc.DownG7Recipe(rG1,rG2, recipeSteps);
break; // break;
case 8 : // case 8 :
LjMixManagerPlc.DownG8Recipe(rG1,rG2, recipeSteps); // LjMixManagerPlc.DownG8Recipe(rG1,rG2, recipeSteps);
break; // break;
} // }
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;

@ -72,34 +72,34 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
// 第一台干混机 // 第一台干混机
switch (_id) // switch (_id)
{ // {
case 1 : // case 1 :
LjMixManagerPlc.DownM1Recipe(recipeSteps); // LjMixManagerPlc.DownM1Recipe(recipeSteps);
break; // break;
case 2 : // case 2 :
LjMixManagerPlc.DownM2Recipe(recipeSteps); // LjMixManagerPlc.DownM2Recipe(recipeSteps);
break; // break;
case 3 : // case 3 :
LjMixManagerPlc.DownM3Recipe(recipeSteps); // LjMixManagerPlc.DownM3Recipe(recipeSteps);
break; // break;
case 4 : // case 4 :
LjMixManagerPlc.DownM4Recipe(recipeSteps); // LjMixManagerPlc.DownM4Recipe(recipeSteps);
break; // break;
//
case 5 : // case 5 :
LjMixManagerPlc.DownM5Recipe(recipeSteps); // LjMixManagerPlc.DownM5Recipe(recipeSteps);
break; // break;
case 6 : // case 6 :
LjMixManagerPlc.DownM6Recipe(recipeSteps); // LjMixManagerPlc.DownM6Recipe(recipeSteps);
break; // break;
case 7 : // case 7 :
LjMixManagerPlc.DownM7Recipe(recipeSteps); // LjMixManagerPlc.DownM7Recipe(recipeSteps);
break; // break;
case 8 : // case 8 :
LjMixManagerPlc.DownM8Recipe(recipeSteps); // LjMixManagerPlc.DownM8Recipe(recipeSteps);
break; // break;
} // }
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;

@ -1,4 +1,5 @@
using DevExpress.Utils.DPI; using DevExpress.Office.Utils;
using DevExpress.Utils.DPI;
using DevExpress.XtraRichEdit.Fields; using DevExpress.XtraRichEdit.Fields;
using Mesnac.Action.ChemicalWeighing.LjMaterial; using Mesnac.Action.ChemicalWeighing.LjMaterial;
@ -45,6 +46,22 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning.Db
} }
public static List<MyNameValue> GetDrp()
{
string sql = "select Id, FormulaNo, FormulaName from Lj_Formula";
var dataTable = GetTable(sql);
List < MyNameValue> myNames=new List<MyNameValue>();
foreach (DataRow item in dataTable.Rows) {
myNames.Add(new MyNameValue()
{
Id = Convert.ToInt32(item["Id"]),
Name = item["FormulaName"].ToString()
});
}
return myNames;
}
public static DataTable GetMainTable() public static DataTable GetMainTable()
{ {

@ -4,8 +4,12 @@ using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using Mesnac.Action.Base; using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.LjMixManager; using Mesnac.Action.ChemicalWeighing.LjMixManager;
using Mesnac.Action.ChemicalWeighing.LjPlanning.Db;
using Mesnac.Action.ChemicalWeighing.LjProdcutLine; using Mesnac.Action.ChemicalWeighing.LjProdcutLine;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ListView;
namespace Mesnac.Action.ChemicalWeighing.LjPlanning namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{ {
public class DownloadAction:ChemicalWeighingAction, IAction public class DownloadAction:ChemicalWeighingAction, IAction
@ -50,103 +54,130 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
if (ljPlanningView != null) if (ljPlanningView != null)
{ {
var productLineView = ProductLineDb.GetById(ljPlanningView.ProductLineId);
var strings = productLineView.DryId.Split(',').ToArray();
List<RecipePlcView> recipePlcViews = new List<RecipePlcView>(); List<RecipePlcView> recipePlcViews = new List<RecipePlcView>();
List<RecipePlcView> recipePlcViews2 = new List<RecipePlcView>(); List<RecipePlcView> recipePlcViews2 = new List<RecipePlcView>();
List<Step> recipeSteps = new List<Step>(); List<Step> recipeSteps = new List<Step>();
List<MixStep> mixSteps = new List<MixStep>(); List<MixStep> mixSteps = new List<MixStep>();
var id1 = ljPlanningView.Id; //配方名称
var formulaId= ljPlanningView.FormulaId;
foreach (var s in strings) var unit = ljPlanningView.Unit;
var formulDetail=LjFormulaDb.GetDetail(formulaId);
//单元
switch (unit)
{ {
int i = Convert.ToInt32(s); case 1:
if (i < 5)
{ //获取干混机1
recipePlcViews = LjMixManagerDb.GetRecip(ljPlanningView.MetageAId); var dataDry1C = formulDetail.Where(x => x.MachineType == "Dry" && x.FormulaType == 1 && x.Machine == "A").ToList();
recipeSteps=LjMixManagerDb.GetStep(ljPlanningView.MetageAId); var dataDry1CPlcView = dataDry1C.Select(x => new RecipePlcView()
}
else
{
if (id < 13)
{
recipePlcViews = LjMixManagerDb.GetRecip(ljPlanningView.MetageB1Id);
recipePlcViews2 = LjMixManagerDb.GetRecip(ljPlanningView.MetageB2Id);
recipeSteps=LjMixManagerDb.GetStep( ljPlanningView.MixBId);
}
else
{ {
mixSteps = LjMixManagerDb.GetMixStep(ljPlanningView.MixBId); Bin = x.BinNo,
} Set = x.SetValue,
} TolErance = x.Tolerance
switch (i) }).ToList();
{
case 1 : break;
LjMixManagerPlc.DownD1Recipe(recipePlcViews, recipeSteps); case 2:
break; break;
case 2 : case 3:
LjMixManagerPlc.DownD2Recipe(recipePlcViews, recipeSteps); break;
break; case 4:
case 3 : break;
LjMixManagerPlc.DownD3Recipe(recipePlcViews, recipeSteps);
break;
case 4 :
LjMixManagerPlc.DownD4Recipe(recipePlcViews, recipeSteps);
break;
case 5 :
LjMixManagerPlc.DownG1Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
break;
case 6 :
LjMixManagerPlc.DownG2Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
break;
case 7 :
LjMixManagerPlc.DownG3Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
break;
case 8 :
LjMixManagerPlc.DownG4Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
break;
case 9 :
LjMixManagerPlc.DownG5Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
break;
case 10 :
LjMixManagerPlc.DownG6Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
break;
case 11 :
LjMixManagerPlc.DownG7Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
break;
case 12 :
LjMixManagerPlc.DownG8Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
break;
case 13 :
LjMixManagerPlc.DownM1Recipe(mixSteps);
break;
case 14 :
LjMixManagerPlc.DownM2Recipe(mixSteps);
break;
case 15 :
LjMixManagerPlc.DownM3Recipe(mixSteps);
break;
case 16 :
LjMixManagerPlc.DownM4Recipe(mixSteps);
break;
case 17 :
LjMixManagerPlc.DownM5Recipe(mixSteps);
break;
case 18 :
LjMixManagerPlc.DownM6Recipe(mixSteps);
break;
case 19 :
LjMixManagerPlc.DownM7Recipe(mixSteps);
break;
case 20:
LjMixManagerPlc.DownM8Recipe(mixSteps);
break;
}
} }
//foreach (var s in strings)
//{
// int i = Convert.ToInt32(s);
// if (i < 5)
// {
// recipePlcViews = LjMixManagerDb.GetRecip(ljPlanningView.MetageAId);
// recipeSteps=LjMixManagerDb.GetStep(ljPlanningView.MetageAId);
// }
// else
// {
// if (id < 13)
// {
// recipePlcViews = LjMixManagerDb.GetRecip(ljPlanningView.MetageB1Id);
// recipePlcViews2 = LjMixManagerDb.GetRecip(ljPlanningView.MetageB2Id);
// recipeSteps=LjMixManagerDb.GetStep( ljPlanningView.MixBId);
// }
// else
// {
// mixSteps = LjMixManagerDb.GetMixStep(ljPlanningView.MixBId);
// }
// }
// switch (i)
// {
// case 1 :
// LjPlanningPlcHelp.DownD1Recipe(recipePlcViews, recipeSteps);
// break;
// case 2 :
// LjPlanningPlcHelp.DownD2Recipe(recipePlcViews, recipeSteps);
// break;
// case 3 :
// LjPlanningPlcHelp.DownD3Recipe(recipePlcViews, recipeSteps);
// break;
// case 4 :
// LjPlanningPlcHelp.DownD4Recipe(recipePlcViews, recipeSteps);
// break;
// case 5 :
// LjPlanningPlcHelp.DownG1Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
// break;
// case 6 :
// LjPlanningPlcHelp.DownG2Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
// break;
// case 7 :
// LjPlanningPlcHelp.DownG3Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
// break;
// case 8 :
// LjPlanningPlcHelp.DownG4Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
// break;
// case 9 :
// LjPlanningPlcHelp.DownG5Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
// break;
// case 10 :
// LjPlanningPlcHelp.DownG6Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
// break;
// case 11 :
// LjPlanningPlcHelp.DownG7Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
// break;
// case 12 :
// LjPlanningPlcHelp.DownG8Recipe(recipePlcViews,recipePlcViews2, recipeSteps);
// break;
// case 13 :
// LjPlanningPlcHelp.DownM1Recipe(mixSteps);
// break;
// case 14 :
// LjPlanningPlcHelp.DownM2Recipe(mixSteps);
// break;
// case 15 :
// LjPlanningPlcHelp.DownM3Recipe(mixSteps);
// break;
// case 16 :
// LjPlanningPlcHelp.DownM4Recipe(mixSteps);
// break;
// case 17 :
// LjPlanningPlcHelp.DownM5Recipe(mixSteps);
// break;
// case 18 :
// LjPlanningPlcHelp.DownM6Recipe(mixSteps);
// break;
// case 19 :
// LjPlanningPlcHelp.DownM7Recipe(mixSteps);
// break;
// case 20:
// LjPlanningPlcHelp.DownM8Recipe(mixSteps);
// break;
// }
//}
} }
else else
{ {

@ -33,7 +33,7 @@
public float? Speed { get; set; } public float? Speed { get; set; }
public float? SetValue { get; set; } public float SetValue { get; set; }
public float? SetTolerance { get; set; } public float? SetTolerance { get; set; }

@ -34,307 +34,176 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
private void InitializeComponent() private void InitializeComponent()
{ {
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.DrpProductLine = new System.Windows.Forms.ComboBox(); this.DrpFormula = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.txtCarNumber = new System.Windows.Forms.TextBox(); this.txtCarNumber = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.DrpMixA = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.DrpMetageA = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.DrpMixB = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
this.DrpMetageB2 = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
this.DrpMetageB1 = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.DrpMixC = new System.Windows.Forms.ComboBox();
this.label9 = new System.Windows.Forms.Label();
this.btnCancel = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button(); this.btnOK = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.txtName = new System.Windows.Forms.TextBox();
this.groupBox2.SuspendLayout(); this.label1 = new System.Windows.Forms.Label();
this.groupBox3.SuspendLayout(); this.label4 = new System.Windows.Forms.Label();
this.cbClass = new System.Windows.Forms.ComboBox();
this.cbUnit = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.SuspendLayout(); this.SuspendLayout();
// //
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(11, 15); this.label3.Location = new System.Drawing.Point(77, 104);
this.label3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label3.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(47, 12); this.label3.Size = new System.Drawing.Size(53, 18);
this.label3.TabIndex = 49; this.label3.TabIndex = 49;
this.label3.Text = "生产线:"; this.label3.Text = "配方:";
//
// DrpProductLine
// //
this.DrpProductLine.FormattingEnabled = true; // DrpFormula
this.DrpProductLine.Location = new System.Drawing.Point(68, 12);
this.DrpProductLine.Name = "DrpProductLine";
this.DrpProductLine.Size = new System.Drawing.Size(129, 20);
this.DrpProductLine.TabIndex = 52;
this.DrpProductLine.SelectedIndexChanged += new System.EventHandler(this.DrpProductLine_SelectedIndexChanged);
//
// label1
// //
this.label1.AutoSize = true; this.DrpFormula.FormattingEnabled = true;
this.label1.Location = new System.Drawing.Point(222, 15); this.DrpFormula.Location = new System.Drawing.Point(160, 96);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.DrpFormula.Margin = new System.Windows.Forms.Padding(4);
this.label1.Name = "label1"; this.DrpFormula.Name = "DrpFormula";
this.label1.Size = new System.Drawing.Size(41, 12); this.DrpFormula.Size = new System.Drawing.Size(192, 26);
this.label1.TabIndex = 53; this.DrpFormula.TabIndex = 52;
this.label1.Text = "label1"; this.DrpFormula.SelectedIndexChanged += new System.EventHandler(this.DrpProductLine_SelectedIndexChanged);
// //
// txtCarNumber // txtCarNumber
// //
this.txtCarNumber.Location = new System.Drawing.Point(68, 40); this.txtCarNumber.Location = new System.Drawing.Point(160, 162);
this.txtCarNumber.Margin = new System.Windows.Forms.Padding(5); this.txtCarNumber.Margin = new System.Windows.Forms.Padding(8);
this.txtCarNumber.MaxLength = 100; this.txtCarNumber.MaxLength = 100;
this.txtCarNumber.Name = "txtCarNumber"; this.txtCarNumber.Name = "txtCarNumber";
this.txtCarNumber.Size = new System.Drawing.Size(129, 21); this.txtCarNumber.Size = new System.Drawing.Size(192, 28);
this.txtCarNumber.TabIndex = 55; this.txtCarNumber.TabIndex = 55;
// //
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(23, 43); this.label2.Location = new System.Drawing.Point(77, 172);
this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label2.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 12); this.label2.Size = new System.Drawing.Size(53, 18);
this.label2.TabIndex = 54; this.label2.TabIndex = 54;
this.label2.Text = "车次:"; this.label2.Text = "车次:";
// //
// groupBox1 // btnCancel
// //
this.groupBox1.Controls.Add(this.DrpMixA); this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.groupBox1.Controls.Add(this.label5); this.btnCancel.Location = new System.Drawing.Point(243, 413);
this.groupBox1.Controls.Add(this.DrpMetageA); this.btnCancel.Margin = new System.Windows.Forms.Padding(8);
this.groupBox1.Controls.Add(this.label4); this.btnCancel.Name = "btnCancel";
this.groupBox1.Location = new System.Drawing.Point(11, 68); this.btnCancel.Size = new System.Drawing.Size(147, 68);
this.groupBox1.Margin = new System.Windows.Forms.Padding(2); this.btnCancel.TabIndex = 60;
this.groupBox1.Name = "groupBox1"; this.btnCancel.Text = "取消";
this.groupBox1.Padding = new System.Windows.Forms.Padding(2); this.btnCancel.UseVisualStyleBackColor = true;
this.groupBox1.Size = new System.Drawing.Size(240, 80); this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
this.groupBox1.TabIndex = 56;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "干混机";
// //
// DrpMixA // btnOK
// //
this.DrpMixA.FormattingEnabled = true; this.btnOK.Location = new System.Drawing.Point(64, 413);
this.DrpMixA.Location = new System.Drawing.Point(74, 45); this.btnOK.Margin = new System.Windows.Forms.Padding(8);
this.DrpMixA.Name = "DrpMixA"; this.btnOK.Name = "btnOK";
this.DrpMixA.Size = new System.Drawing.Size(153, 20); this.btnOK.Size = new System.Drawing.Size(147, 68);
this.DrpMixA.TabIndex = 52; this.btnOK.TabIndex = 59;
this.btnOK.Text = "保存";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
// //
// label5 // txtName
// //
this.label5.AutoSize = true; this.txtName.Location = new System.Drawing.Point(160, 46);
this.label5.Location = new System.Drawing.Point(7, 48); this.txtName.Margin = new System.Windows.Forms.Padding(8);
this.label5.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.txtName.MaxLength = 100;
this.label5.Name = "label5"; this.txtName.Name = "txtName";
this.label5.Size = new System.Drawing.Size(59, 12); this.txtName.Size = new System.Drawing.Size(192, 28);
this.label5.TabIndex = 49; this.txtName.TabIndex = 62;
this.label5.Text = "混合步骤:";
// //
// DrpMetageA // label1
// //
this.DrpMetageA.FormattingEnabled = true; this.label1.AutoSize = true;
this.DrpMetageA.Location = new System.Drawing.Point(74, 19); this.label1.Location = new System.Drawing.Point(61, 50);
this.DrpMetageA.Name = "DrpMetageA"; this.label1.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0);
this.DrpMetageA.Size = new System.Drawing.Size(153, 20); this.label1.Name = "label1";
this.DrpMetageA.TabIndex = 52; this.label1.Size = new System.Drawing.Size(89, 18);
this.label1.TabIndex = 61;
this.label1.Text = "计划名称:";
// //
// label4 // label4
// //
this.label4.AutoSize = true; this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(7, 22); this.label4.Location = new System.Drawing.Point(77, 231);
this.label4.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label4.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 12); this.label4.Size = new System.Drawing.Size(53, 18);
this.label4.TabIndex = 49; this.label4.TabIndex = 49;
this.label4.Text = "粉料称量:"; this.label4.Text = "班次:";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.DrpMixB);
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Controls.Add(this.DrpMetageB2);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.DrpMetageB1);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Location = new System.Drawing.Point(11, 152);
this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
this.groupBox2.Size = new System.Drawing.Size(240, 106);
this.groupBox2.TabIndex = 57;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "糊化机";
//
// DrpMixB
//
this.DrpMixB.FormattingEnabled = true;
this.DrpMixB.Location = new System.Drawing.Point(74, 71);
this.DrpMixB.Name = "DrpMixB";
this.DrpMixB.Size = new System.Drawing.Size(153, 20);
this.DrpMixB.TabIndex = 52;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(7, 74);
this.label8.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(59, 12);
this.label8.TabIndex = 49;
this.label8.Text = "混合步骤:";
// //
// DrpMetageB2 // cbClass
// //
this.DrpMetageB2.FormattingEnabled = true; this.cbClass.FormattingEnabled = true;
this.DrpMetageB2.Location = new System.Drawing.Point(74, 45); this.cbClass.Location = new System.Drawing.Point(160, 223);
this.DrpMetageB2.Name = "DrpMetageB2"; this.cbClass.Margin = new System.Windows.Forms.Padding(4);
this.DrpMetageB2.Size = new System.Drawing.Size(153, 20); this.cbClass.Name = "cbClass";
this.DrpMetageB2.TabIndex = 52; this.cbClass.Size = new System.Drawing.Size(192, 26);
this.cbClass.TabIndex = 52;
this.cbClass.SelectedIndexChanged += new System.EventHandler(this.DrpProductLine_SelectedIndexChanged);
// //
// label6 // cbUnit
// //
this.label6.AutoSize = true; this.cbUnit.FormattingEnabled = true;
this.label6.Location = new System.Drawing.Point(19, 48); this.cbUnit.Location = new System.Drawing.Point(160, 300);
this.label6.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.cbUnit.Margin = new System.Windows.Forms.Padding(4);
this.label6.Name = "label6"; this.cbUnit.Name = "cbUnit";
this.label6.Size = new System.Drawing.Size(47, 12); this.cbUnit.Size = new System.Drawing.Size(192, 26);
this.label6.TabIndex = 49; this.cbUnit.TabIndex = 64;
this.label6.Text = "水称量:";
// //
// DrpMetageB1 // label5
//
this.DrpMetageB1.FormattingEnabled = true;
this.DrpMetageB1.Location = new System.Drawing.Point(74, 19);
this.DrpMetageB1.Name = "DrpMetageB1";
this.DrpMetageB1.Size = new System.Drawing.Size(153, 20);
this.DrpMetageB1.TabIndex = 52;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(7, 22);
this.label7.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(59, 12);
this.label7.TabIndex = 49;
this.label7.Text = "粉料称量:";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.DrpMixC);
this.groupBox3.Controls.Add(this.label9);
this.groupBox3.Location = new System.Drawing.Point(11, 262);
this.groupBox3.Margin = new System.Windows.Forms.Padding(2);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new System.Windows.Forms.Padding(2);
this.groupBox3.Size = new System.Drawing.Size(240, 53);
this.groupBox3.TabIndex = 58;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "湿混机";
//
// DrpMixC
//
this.DrpMixC.FormattingEnabled = true;
this.DrpMixC.Location = new System.Drawing.Point(74, 19);
this.DrpMixC.Name = "DrpMixC";
this.DrpMixC.Size = new System.Drawing.Size(153, 20);
this.DrpMixC.TabIndex = 52;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(7, 22);
this.label9.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(59, 12);
this.label9.TabIndex = 49;
this.label9.Text = "混合步骤:";
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(153, 357);
this.btnCancel.Margin = new System.Windows.Forms.Padding(5);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(98, 45);
this.btnCancel.TabIndex = 60;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOK
// //
this.btnOK.Location = new System.Drawing.Point(11, 357); this.label5.AutoSize = true;
this.btnOK.Margin = new System.Windows.Forms.Padding(5); this.label5.Location = new System.Drawing.Point(77, 308);
this.btnOK.Name = "btnOK"; this.label5.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0);
this.btnOK.Size = new System.Drawing.Size(98, 45); this.label5.Name = "label5";
this.btnOK.TabIndex = 59; this.label5.Size = new System.Drawing.Size(53, 18);
this.btnOK.Text = "确认"; this.label5.TabIndex = 63;
this.btnOK.UseVisualStyleBackColor = true; this.label5.Text = "产线:";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
// //
// FrmPlanning // FrmPlanning
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(367, 422); this.ClientSize = new System.Drawing.Size(550, 633);
this.Controls.Add(this.cbUnit);
this.Controls.Add(this.label5);
this.Controls.Add(this.txtName);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK); this.Controls.Add(this.btnOK);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.txtCarNumber); this.Controls.Add(this.txtCarNumber);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.cbClass);
this.Controls.Add(this.DrpProductLine); this.Controls.Add(this.label4);
this.Controls.Add(this.DrpFormula);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "FrmPlanning"; this.Name = "FrmPlanning";
this.Text = "计划管理"; this.Text = "计划管理";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
#endregion #endregion
private Label label3; private Label label3;
private System.Windows.Forms.ComboBox DrpProductLine; private System.Windows.Forms.ComboBox DrpFormula;
private System.Windows.Forms.Label label1;
private TextBox txtCarNumber; private TextBox txtCarNumber;
private Label label2; private Label label2;
private GroupBox groupBox1;
private ComboBox DrpMetageA;
private Label label4;
private ComboBox DrpMixA;
private Label label5;
private GroupBox groupBox2;
private ComboBox DrpMetageB2;
private Label label6;
private ComboBox DrpMetageB1;
private Label label7;
private ComboBox DrpMixB;
private Label label8;
private GroupBox groupBox3;
private ComboBox DrpMixC;
private Label label9;
private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOK; private System.Windows.Forms.Button btnOK;
private TextBox txtName;
private Label label1;
private Label label4;
private ComboBox cbClass;
private ComboBox cbUnit;
private Label label5;
} }
} }

@ -5,6 +5,7 @@ using System.Windows.Forms;
using Mesnac.Action.ChemicalWeighing.LjMaterial; using Mesnac.Action.ChemicalWeighing.LjMaterial;
using Mesnac.Action.ChemicalWeighing.LjMetageFormula; using Mesnac.Action.ChemicalWeighing.LjMetageFormula;
using Mesnac.Action.ChemicalWeighing.LjMixFormula; using Mesnac.Action.ChemicalWeighing.LjMixFormula;
using Mesnac.Action.ChemicalWeighing.LjPlanning.Db;
using Mesnac.Action.ChemicalWeighing.LjProdcutLine; using Mesnac.Action.ChemicalWeighing.LjProdcutLine;
namespace Mesnac.Action.ChemicalWeighing.LjPlanning namespace Mesnac.Action.ChemicalWeighing.LjPlanning
@ -27,24 +28,38 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
if (ljPlanningView != null) if (ljPlanningView != null)
{ {
txtCarNumber.Text = ljPlanningView.NumCar.ToString(); txtCarNumber.Text = ljPlanningView.NumCar.ToString();
//根据更新去获取数据 txtName.Text= ljPlanningView.PlanName.ToString();
Checked(DrpMetageA, ljPlanningView.MetageAId); Checked(DrpFormula, ljPlanningView.FormulaId);
Checked(DrpMetageB1,ljPlanningView.MetageB1Id); //cbUnit
Checked(DrpMetageB2, ljPlanningView.MetageB2Id);
Checked(DrpMixA,ljPlanningView.MixAId); Checked(cbUnit, ljPlanningView.Unit);
Checked(DrpMixB,ljPlanningView.MixBId); string cbClass = ljPlanningView.ClassName;
Checked(DrpMixC,ljPlanningView.MixCId); if (cbClass == "早")
{
this.cbClass.SelectedIndex = 0;
}
else
{
if (cbClass == "中")
{
this.cbClass.SelectedIndex = 1;
}
else
{
this.cbClass.SelectedIndex = 2;
}
}
} }
} }
private void Checked(ComboBox alBox,string checkId) private void Checked(ComboBox alBox,int checkId)
{ {
foreach (MyNameValueStr combo in alBox.Items) foreach (MyNameValue combo in alBox.Items)
{ {
if (combo.Id == checkId) if (combo.Id == checkId)
if (combo.Id == checkId)
{ {
alBox.SelectedItem = combo; alBox.SelectedItem = combo;
break; break;
@ -52,53 +67,52 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
} }
} }
private List<ProductLineView> productLineViews;
// private List<MyNameValueStr> lsList;
private List<MyNameValueStr> lsAMixList;
private List<MyNameValueStr> lsBMixList;
private List<MyNameValueStr> lsCMixList;
private void FillController() private void FillController()
{ {
productLineViews = ProductLineDb.GetList();
DrpProductLine.DataSource=productLineViews;
FillComboBox(DrpProductLine);
//var selectedIndex = DrpProductLine.SelectedIndex;
//var productLineView = productLineViews[selectedIndex];
//this.label1.Text=productLineView.DryName;
IEnumerable<MyNameValueStr> ien = MetageFormulaDb.GetMetageNmaValue();
var drpA = ien.ToList();
var drpB = ien.ToList();
var drpC = ien.ToList();
FillComboBox(DrpMetageA);
DrpMetageA.DataSource = drpA;
FillComboBox(DrpMetageB1);
DrpMetageB1.DataSource = drpB;
FillComboBox(DrpMetageB2);
DrpMetageB2.DataSource = drpC;
FillComboBox(DrpFormula);
FillComboBox(cbClass);
FillComboBox(cbUnit);
List<MyNameValue> lsClass = new List<MyNameValue>();
lsClass.Add(new MyNameValue()
{
Id=1,
Name="早"
});
lsClass.Add(new MyNameValue()
{
Id = 2,
Name = "中"
});
lsClass.Add(new MyNameValue()
{
Id = 3,
Name = "晚"
});
cbClass.DataSource = lsClass;
lsAMixList = MixDb.GetMyNameValueStrs(2); List<MyNameValue> lsUnit = new List<MyNameValue>();
DrpMixA.DataSource = lsAMixList; lsUnit.Add(new MyNameValue()
FillComboBox(DrpMixA); {
lsBMixList= MixDb.GetMyNameValueStrs(1); Id = 1,
DrpMixB.DataSource = lsBMixList; Name = "1#"
FillComboBox(DrpMixB); });
lsCMixList = MixDb.GetMyNameValueStrs(3); lsUnit.Add(new MyNameValue()
DrpMixC.DataSource = lsCMixList; {
FillComboBox(DrpMixC); Id = 2,
Name = "2#"
});
lsUnit.Add(new MyNameValue()
{
Id = 3,
Name = "3#"
});
cbUnit.DataSource = lsUnit;
DrpFormula.DataSource = LjFormulaDb.GetDrp();
} }
@ -110,9 +124,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
private void DrpProductLine_SelectedIndexChanged(object sender, System.EventArgs e) private void DrpProductLine_SelectedIndexChanged(object sender, System.EventArgs e)
{ {
var selectedIndex = DrpProductLine.SelectedIndex; var selectedIndex = DrpFormula.SelectedIndex;
var productLineView = productLineViews[selectedIndex];
this.label1.Text = productLineView.DryName;
} }
private void btnCancel_Click(object sender, System.EventArgs e) private void btnCancel_Click(object sender, System.EventArgs e)
@ -136,31 +150,14 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
return; return;
} }
view.UpdateTime = DateTime.Now;
view.NumCar = carNo;
view.MetageAId = DrpMetageA.SelectedValue.ToString();
view.MetageAName = DrpMetageA.Text;
view.MixAId = DrpMixA.SelectedValue.ToString();
view.MixAName = DrpMixA.Text;
view.MetageB1Id = DrpMetageB1.SelectedValue.ToString();
view.MetageB1Name= DrpMetageB1.Text;
view.MetageB2Id = DrpMetageB2.SelectedValue.ToString();
view.MetageB2Name= DrpMetageB2.Text;
view.MixBId= DrpMixB.SelectedValue.ToString();
view.MixBName=DrpMixB.Text;
view.MixCId =DrpMixC.SelectedValue.ToString();
view.MixCName=DrpMixC.Text;
view.ProductLineId = Convert.ToInt32(DrpProductLine.SelectedValue);
view.ProductLineName = label1.Text;
view.PlanName = txtName.Text;
view.CreateTime = DateTime.Now;
view.NumCar = carNo;
view.FormulaId = Convert.ToInt32(DrpFormula.SelectedValue);
view.FormulaName = DrpFormula.Text;
view.ClassName = cbClass.Text;
view.Unit = Convert.ToInt32(cbUnit.SelectedValue);
//需要设计状态 0 未开始 -1 异常退出 1 完成 //需要设计状态 0 未开始 -1 异常退出 1 完成

@ -32,9 +32,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
private void FileControl() private void FileControl()
{ {
DataTable table = DataTable table =
DBHelp.GetTable(@"select Id, No, Status, CreateTime, UpdateTime, BegTime, EndTime, NumCar, Share, MetageAId, MetageAName, MixAId, DBHelp.GetTable(@"select Id,PlanName, PlanNo, Status, CreateTime, UpdateTime, BegTime, EndTime, NumCar, Unit, Remark, IsEnable, FormulaId, FormulaName,'' as StatusName
MixAName, MetageB1Id, MetageB1Name, MetageB2Id, MetageB2Name, MixBId, MixBName, MixCId, ,ClassName from lj_planning where IsEnable=1 order by CreateTime desc ");
MixCName, RecipeType, Remark, ProductLineId, ProductLineName,'' as StatusName from lj_planning where IsEnable=1");
if (this._materialGridControl != null && this._materialGridControl.BaseControl != null) if (this._materialGridControl != null && this._materialGridControl.BaseControl != null)
{ {

@ -12,45 +12,27 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
public static void Add(LjPlanningView view) public static void Add(LjPlanningView view)
{ {
string sql = $"insert into lj_planning " + string sql = $"insert into lj_planning (\"PlanNo\", Status, CreateTime, UpdateTime, BegTime, EndTime, NumCar, Unit, Remark, IsEnable,\r\n " +
$"values (@No,@Status,@CreateTime,@UpdateTime,@BegTime,@EndTime,@NumCar," + $" FormulaId, FormulaName, PlanName, ClassName)\r\nvalues (@PlanNo,@Status,@CreateTime,@UpdateTime,@BegTime,@EndTime,@NumCar,@Unit," +
$"@Share,@MetageAId,@MetageAName,@MixAId,@MixAName,@MetageB1Id,@MetageB1Name,@MetageB2Id," + $" @Remark ,@IsEnable,@FormulaId,@FormulaName,@PlanName,@ClassName);";
$"@MetageB2Name,@MixBId,@MixBName,@MixCId,@MixCName,@RecipeType,@Remark,@ProductLineId,@ProductLineName,@IsEnable)";
IDictionary<string, object> dic = new Dictionary<string, object>(); IDictionary<string, object> dic = new Dictionary<string, object>();
dic["@No"] = view.No; dic["@PlanNo"] = view.PlanNo;
dic["@Status"] = view.Status; dic["@Status"] = view.Status;
dic["@CreateTime"] = view.CreateTime; dic["@CreateTime"] = view.CreateTime;
dic["@UpdateTime"] = view.UpdateTime; dic["@UpdateTime"] = null;
dic["@BegTime"] = view.BegTime; dic["@BegTime"] = view.BegTime;
dic["@EndTime"] = view.EndTime; dic["@EndTime"] = view.EndTime;
dic["@NumCar"] = view.NumCar; dic["@NumCar"] = view.NumCar;
dic["@Unit"] = view.Unit;
dic["@Share"] = view.Share;
dic["@MetageAId"] = view.MetageAId;
dic["@MetageAName"] = view.MetageAName;
dic["@MixAId"] = view.MixAId;
dic["@MixAName"] = view.MixAName;
dic["@MetageB1Id"] = view.MetageB1Id;
dic["@MetageB1Name"] = view.MetageB1Name;
dic["@MetageB2Id"] = view.MetageB2Id;
dic["@MetageB2Name"] = view.MetageB2Name;
dic["@MixBId"] = view.MixBId;
dic["@MixBName"] = view.MixBName;
dic["@MixCId"] = view.MixCId;
dic["@MixCName"] = view.MixCName;
dic["@RecipeType"] = view.RecipeType;
dic["@Remark"] = view.Remark; dic["@Remark"] = view.Remark;
dic["@ProductLineId"] = view.ProductLineId;
dic["@ProductLineName"] = view.ProductLineName;
dic["@IsEnable"] = 1; dic["@IsEnable"] = 1;
dic["@FormulaId"] = view.FormulaId;
dic["@FormulaName"] = view.FormulaName;
dic["@PlanName"] = view.PlanName;
dic["@ClassName"] = view.ClassName;
ExecuteNonQuery(sql,dic); ExecuteNonQuery(sql,dic);
} }
@ -59,35 +41,21 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append(" update lj_planning "); sb.Append(" update lj_planning ");
sb.Append($" set No='{view.No}', "); sb.Append($" set PlanNo='{view.PlanNo}', ");
sb.Append($" Status='{view.Status}', ");
//sb.Append($" CreateTime='{view.CreateTime}', ");
sb.Append($" UpdateTime='{view.UpdateTime}', "); sb.Append($" UpdateTime='{view.UpdateTime}', ");
sb.Append($" BegTime='{view.BegTime}', "); sb.Append($" BegTime='{view.BegTime}', ");
sb.Append($" EndTime='{view.EndTime}', "); sb.Append($" EndTime='{view.EndTime}', ");
sb.Append($" NumCar='{view.NumCar}', "); sb.Append($" NumCar='{view.NumCar}', ");
sb.Append($" Share='{view.Share}', "); sb.Append($" Unit='{view.Unit}', ");
sb.Append($" MetageAId='{view.MetageAId}', "); sb.Append($" FormulaId='{view.FormulaId}', ");
sb.Append($" MetageAName='{view.MetageAName}', "); sb.Append($" FormulaName='{view.FormulaName}', ");
sb.Append($" MixAId='{view.MixAId}', "); sb.Append($" PlanName='{view.PlanName}', ");
sb.Append($" MixAName='{view.MixAName}', "); sb.Append($" ClassName='{view.ClassName}', ");
sb.Append($" MetageB1Id='{view.MetageB1Id}', ");
sb.Append($" MetageB1Name='{view.MetageB1Name}', ");
sb.Append($" MetageB2Id='{view.MetageB2Id}', ");
sb.Append($" MetageB2Name='{view.MetageB2Name}', ");
sb.Append($" MixBId='{view.MixBId}', ");
sb.Append($" MixBName='{view.MixBName}', ");
sb.Append($" MixCId='{view.MixCId}', ");
sb.Append($" MixCName='{view.MixCName}', ");
sb.Append($" RecipeType='{view.RecipeType}', ");
sb.Append($" Remark='{view.Remark}', ");
sb.Append($" ProductLineId={view.ProductLineId}, "); sb.Append($" Remark='{view.Remark}' ");
sb.Append($" ProductLineName='{view.ProductLineName}' ");
sb.Append($" where id={view.Id}"); sb.Append($" where id={view.Id}");
@ -133,10 +101,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
public static LjPlanningView GetById(int id) public static LjPlanningView GetById(int id)
{ {
string sql = $"select Id, No, Status, CreateTime, UpdateTime, BegTime, EndTime, " + string sql = $"select Id, PlanNo, Status, CreateTime, UpdateTime, BegTime, EndTime, NumCar, Unit, Remark, IsEnable, FormulaId, FormulaName, PlanName, ClassName from lj_planning where Id = " + id;
$"NumCar, Share, MetageAId, MetageAName, MixAId, MixAName," +
$" MetageB1Id, MetageB1Name, MetageB2Id, MetageB2Name, MixBId, MixBName, " +
$"MixCId, MixCName, RecipeType, Remark,ProductLineId,ProductLineName from lj_planning where id={id}";
DataTable dt = GetTable(sql); DataTable dt = GetTable(sql);
@ -145,9 +110,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
if (dt.Rows.Count == 1) if (dt.Rows.Count == 1)
{ {
DataRow dr = dt.Rows[0]; DataRow dr = dt.Rows[0];
if (dr["No"] != null) if (dr["PlanNo"] != null)
{ {
view.No = dr["No"].ToString(); view.PlanNo = dr["PlanNo"].ToString();
} }
if (dr["Status"] != null) if (dr["Status"] != null)
@ -160,7 +125,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
view.CreateTime = Convert.ToDateTime(dr["CreateTime"]); view.CreateTime = Convert.ToDateTime(dr["CreateTime"]);
} }
if (dr["UpdateTime"] != null) if (dr["UpdateTime"] != null && dr["UpdateTime"]!=DBNull.Value)
{ {
view.UpdateTime = Convert.ToDateTime(dr["UpdateTime"]); view.UpdateTime = Convert.ToDateTime(dr["UpdateTime"]);
} }
@ -181,100 +146,34 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
view.NumCar = Convert.ToInt32(dr["NumCar"]); view.NumCar = Convert.ToInt32(dr["NumCar"]);
} }
if (dr["Share"] != null)
{
view.Share = Convert.ToInt32(dr["Share"]);
}
if (dr["MetageAId"] != null)
{
view.MetageAId = dr["MetageAId"].ToString();
}
if (dr["MetageAName"] != null)
{
view.MetageAName = dr["MetageAName"].ToString();
}
if (dr["MixAId"] != null)
{
view.MixAId = dr["MetageAId"].ToString();
}
if (dr["MixAName"] != null)
{
view.MixAName = dr["MixAName"].ToString();
}
if (dr["MetageB1Id"] != null) if (dr["Unit"] != null)
{ {
view.MetageB1Id = dr["MetageB1Id"].ToString(); view.Unit = Convert.ToInt32(dr["Unit"]);
} }
if (dr["MetageB1Name"] != null)
{ if (dr["Remark"] != null)
view.MetageB1Name = dr["MetageB1Name"].ToString();
}
if (dr["MetageB2Id"] != null)
{
view.MetageB2Id = dr["MetageB2Id"].ToString();
}
if (dr["MetageB2Name"] != null)
{
view.MetageB2Name = dr["MetageB2Name"].ToString();
}
if (dr["MixBId"] != null)
{
view.MixBId = dr["MixBId"].ToString();
}
if (dr["MixBName"] != null)
{
view.MixBName = dr["MixBName"].ToString();
}
if (dr["MixBId"] != null)
{ {
view.MixBId = dr["MixBId"].ToString(); view.Remark = dr["Remark"].ToString();
} }
if (dr["MixBName"] != null)
{
view.MixBName = dr["MixBName"].ToString(); if (dr["FormulaId"] != null)
}
if (dr["MixCId"] != null)
{ {
view.MixCId = dr["MixCId"].ToString(); view.FormulaId = Convert.ToInt32(dr["FormulaId"]);
} }
if (dr["ClassName"] != null)
if (dr["MixCName"] != null)
{
view.MixCName = dr["MixCName"].ToString();
}
if (dr["RecipeType"] != null)
{ {
view.RecipeType = Convert.ToInt32(dr["RecipeType"]); view.ClassName = dr["ClassName"].ToString();
} }
if (dr["Remark"] != null) if (dr["PlanName"] != null)
{ {
view.Remark = dr["Remark"].ToString(); view.PlanName = dr["PlanName"].ToString();
} }
view.ProductLineId = Convert.ToInt32(dr["ProductLineId"]);
view.ProductLineName = dr["ProductLineName"].ToString();
view.Id = id; view.Id = id;
} }

@ -4,9 +4,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{ {
public class LjPlanningView public class LjPlanningView
{ {
public int Id { get; set; } public int Id { get; set; }
public string No { get; set; } public string PlanNo { get; set; }
public string Status { get; set; } public string Status { get; set; }
@ -20,41 +21,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
public int NumCar { get; set; } public int NumCar { get; set; }
public int Share { get; set; } public int Unit { get; set; }
public string MetageAId { get; set; }
public string MetageAName { get; set; }
public string MixAId { get; set; }
public string MixAName { get; set; }
public string MetageB1Id { get; set; }
public string MetageB1Name { get; set; }
public string MetageB2Id { get; set; } public string Remark { get; set; }
public string MetageB2Name { get; set; }
public string MixBId { get; set; }
public string MixBName { get; set; }
public string MixCId { get; set; }
public string MixCName { get; set; } public bool IsEnable { get; set; }
public int RecipeType { get; set; }
public string Remark { get; set; } public int FormulaId { get; set; }
public int ProductLineId { get; set;} public string FormulaName { get; set; }
public string ProductLineName { get; set;} public string PlanName { get; set; }
public string ClassName { get; set; }
} }
} }

@ -3,7 +3,7 @@
<Object type="Mesnac.Controls.Default.MCDataGridView, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCDataGridView1" children="Controls"> <Object type="Mesnac.Controls.Default.MCDataGridView, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCDataGridView1" children="Controls">
<Property name="DisplayAllColumn">False</Property> <Property name="DisplayAllColumn">False</Property>
<Property name="DgvColumn"> <Property name="DgvColumn">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAACQAAAMAAAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAAJBwAAAAkIAAAACQkAAAAJCgAAAAkLAAAACQwAAAANBwUEAAAAKE1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnMCAAAACl9maWxlZERhdGEMX2Rpc3BsYXlOYW1lAQECAAAABg0AAAAPUHJvZHVjdExpbmVOYW1lBg4AAAAM5Lqn57q/5py65Y+wAQUAAAAEAAAABg8AAAAGTnVtQ2FyBhAAAAAG6L2m5qyhAQYAAAAEAAAABhEAAAALTWV0YWdlQU5hbWUGEgAAABXlubLmt7fmnLrnsonmlpnnp7Dph48BBwAAAAQAAAAGEwAAAAhNaXhBTmFtZQYUAAAAFeW5sua3t+acuua3t+WQiOatpemqpAEIAAAABAAAAAYVAAAADE1ldGFnZUIxTmFtZQYWAAAAFeeziuWMluacuueyieaWmeensOmHjwEJAAAABAAAAAYXAAAADE1ldGFnZUIyTmFtZQYYAAAAEueziuWMluacuuawtOensOmHjwEKAAAABAAAAAYZAAAACE1peEJOYW1lBhoAAAAP57OK5YyW5py65re35ZCIAQsAAAAEAAAABhsAAAAITWl4Q05hbWUGHAAAAA/mub/mt7fmnLrmt7flkIgBDAAAAAQAAAAGHQAAAApTdGF0dXNOYW1lBh4AAAAM6K6h5YiS54q25oCBCw==</Binary> <Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAACQAAANQAAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAAJBwAAAAkIAAAACQkAAAAJCgAAAAkLAAAACQwAAAANBwUEAAAAKE1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnMCAAAACl9maWxlZERhdGEMX2Rpc3BsYXlOYW1lAQECAAAABg0AAAAIUGxhbk5hbWUGDgAAAAzorqHliJLlkI3np7ABBQAAAAQAAAAGDwAAAAZOdW1DYXIGEAAAAAbovabmrKEBBgAAAAQAAAAGEQAAAApDcmVhdGVUaW1lBhIAAAAS5Yib5bu66K6h5YiS5pe26Ze0AQcAAAAEAAAABhMAAAAHQmVnVGltZQYUAAAADOW8gOWni+aXtumXtAEIAAAABAAAAAYVAAAAB0VuZFRpbWUGFgAAAAznu5PmnZ/ml7bpl7QBCQAAAAQAAAAGFwAAAARVbml0BhgAAAAG5Lqn57q/AQoAAAAEAAAABhkAAAALRm9ybXVsYU5hbWUGGgAAAAzphY3mlrnlkI3np7ABCwAAAAQAAAAGGwAAAApTdGF0dXNOYW1lBhwAAAAG54q25oCBAQwAAAAEAAAABh0AAAAJQ2xhc3NOYW1lBh4AAAAG54+t5qyhCw==</Binary>
</Property> </Property>
<Property name="ClickActionList"> <Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary> <Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>

Loading…
Cancel
Save