diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMaterial/MaterialInfoTypeHelp.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMaterial/MaterialInfoTypeHelp.cs index 1fde7b5..572e2d8 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMaterial/MaterialInfoTypeHelp.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMaterial/MaterialInfoTypeHelp.cs @@ -107,7 +107,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjMaterial { string sql = @"update [lj_material] set [MTypeId]=@MtypeId, -[MaterialName] = @MaterialName where id=@id"; + [MaterialName] = @MaterialName where id=@id"; IDictionary dic = new Dictionary(); dic.Add("@MaterialName",materialinfoTypeName); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/Db/LjFormulaDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/Db/LjFormulaDb.cs index 2f86cdd..ed8010a 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/Db/LjFormulaDb.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/Db/LjFormulaDb.cs @@ -48,7 +48,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning.Db public static List GetDrp() { - string sql = "select Id, FormulaNo, FormulaName from Lj_Formula"; + string sql = "select Id, FormulaNo, FormulaName from Lj_Formula where IsEnable = 1"; var dataTable = GetTable(sql); List < MyNameValue> myNames=new List(); foreach (DataRow item in dataTable.Rows) { diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DelAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DelAction.cs index 18824cc..d74bf68 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DelAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DelAction.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using Mesnac.Action.Base; @@ -24,19 +25,41 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning DataGridView clientGridView = this._materialGridControl.BaseControl as DataGridView; + //验证是否选中某物料 if (clientGridView.SelectedRows.Count != 1) { - - MessageBox.Show("请选择要修改的数据", Mesnac.Basic.LanguageHelper.Caption, - MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show("请选择要修改的数据", Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information); this._runtime.IsReturn = true; return; } - - var dataGridViewRow = clientGridView.SelectedRows[0]; - var id = Convert.ToInt32(dataGridViewRow.Cells["Id"].Value); - LjPlanningDb.SoftDel(id); + + List ls = new List() + { + 0 + }; + + if (MessageBox.Show("确定删除?", "删除确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + var dataGridViewRow = clientGridView.SelectedRows[0]; + var id = Convert.ToInt32(dataGridViewRow.Cells["Id"].Value); + + var status=LjPlanningDb.GetStatusById(id); + if (ls.Contains(status)) + { + LjPlanningDb.SoftDel(id); + } + else + { + MessageBox.Show("禁止删除"); + } + + + } + else + { + return; + } if (OnDelete != null) { diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.Designer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.Designer.cs index 7bee093..d66bc69 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.Designer.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.Designer.cs @@ -215,7 +215,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.groupBox2.Controls.Add(this.groupBox3); this.groupBox2.Location = new System.Drawing.Point(12, 76); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(445, 638); + this.groupBox2.Size = new System.Drawing.Size(445, 579); this.groupBox2.TabIndex = 1; this.groupBox2.TabStop = false; this.groupBox2.Text = "称量配方"; @@ -227,7 +227,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.tabControl2.Location = new System.Drawing.Point(6, 212); this.tabControl2.Name = "tabControl2"; this.tabControl2.SelectedIndex = 0; - this.tabControl2.Size = new System.Drawing.Size(433, 419); + this.tabControl2.Size = new System.Drawing.Size(433, 363); this.tabControl2.TabIndex = 1; // // tabPage3 @@ -238,17 +238,18 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Name = "tabPage3"; this.tabPage3.Padding = new System.Windows.Forms.Padding(3); - this.tabPage3.Size = new System.Drawing.Size(425, 393); + this.tabPage3.Size = new System.Drawing.Size(425, 337); this.tabPage3.TabIndex = 0; this.tabPage3.Text = "糊化机(#A)"; this.tabPage3.UseVisualStyleBackColor = true; + this.tabPage3.Click += new System.EventHandler(this.tabPage3_Click); // // groupBox6 // this.groupBox6.Controls.Add(this.dataGridWater1); - this.groupBox6.Location = new System.Drawing.Point(6, 190); + this.groupBox6.Location = new System.Drawing.Point(6, 168); this.groupBox6.Name = "groupBox6"; - this.groupBox6.Size = new System.Drawing.Size(413, 161); + this.groupBox6.Size = new System.Drawing.Size(413, 165); this.groupBox6.TabIndex = 71; this.groupBox6.TabStop = false; this.groupBox6.Text = "水称"; @@ -264,7 +265,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.dataGridWater1.Name = "dataGridWater1"; this.dataGridWater1.RowHeadersWidth = 62; this.dataGridWater1.RowTemplate.Height = 23; - this.dataGridWater1.Size = new System.Drawing.Size(401, 135); + this.dataGridWater1.Size = new System.Drawing.Size(401, 139); this.dataGridWater1.TabIndex = 69; this.dataGridWater1.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridWater1_DefaultValuesNeeded); // @@ -314,7 +315,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.dataGridSilo1.Name = "dataGridSilo1"; this.dataGridSilo1.RowHeadersWidth = 62; this.dataGridSilo1.RowTemplate.Height = 23; - this.dataGridSilo1.Size = new System.Drawing.Size(414, 156); + this.dataGridSilo1.Size = new System.Drawing.Size(414, 134); this.dataGridSilo1.TabIndex = 63; this.dataGridSilo1.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridSilo_DefaultValuesNeeded); // @@ -506,7 +507,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning // // BtnSave // - this.BtnSave.Location = new System.Drawing.Point(76, 970); + this.BtnSave.Location = new System.Drawing.Point(917, 711); this.BtnSave.Name = "BtnSave"; this.BtnSave.Size = new System.Drawing.Size(119, 47); this.BtnSave.TabIndex = 2; @@ -516,12 +517,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning // // groupBox5 // - this.groupBox5.Controls.Add(this.tabControl3); this.groupBox5.Controls.Add(this.tabControl1); this.groupBox5.Controls.Add(this.groupBox7); this.groupBox5.Location = new System.Drawing.Point(463, 76); this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(947, 692); + this.groupBox5.Size = new System.Drawing.Size(588, 579); this.groupBox5.TabIndex = 3; this.groupBox5.TabStop = false; this.groupBox5.Text = "混合配方"; @@ -530,10 +530,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning // this.tabControl3.Controls.Add(this.tabPage5); this.tabControl3.Controls.Add(this.tabPage6); - this.tabControl3.Location = new System.Drawing.Point(6, 431); + this.tabControl3.Location = new System.Drawing.Point(12, 661); this.tabControl3.Name = "tabControl3"; this.tabControl3.SelectedIndex = 0; - this.tabControl3.Size = new System.Drawing.Size(905, 256); + this.tabControl3.Size = new System.Drawing.Size(879, 256); this.tabControl3.TabIndex = 5; // // tabPage5 @@ -544,7 +544,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.tabPage5.Location = new System.Drawing.Point(4, 22); this.tabPage5.Name = "tabPage5"; this.tabPage5.Padding = new System.Windows.Forms.Padding(3); - this.tabPage5.Size = new System.Drawing.Size(897, 230); + this.tabPage5.Size = new System.Drawing.Size(871, 230); this.tabPage5.TabIndex = 0; this.tabPage5.Text = "湿混机(#A)"; this.tabPage5.UseVisualStyleBackColor = true; @@ -583,7 +583,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.dataGridWeter1.Name = "dataGridWeter1"; this.dataGridWeter1.RowHeadersWidth = 62; this.dataGridWeter1.RowTemplate.Height = 23; - this.dataGridWeter1.Size = new System.Drawing.Size(862, 196); + this.dataGridWeter1.Size = new System.Drawing.Size(857, 196); this.dataGridWeter1.TabIndex = 64; this.dataGridWeter1.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridWeter1_DefaultValuesNeeded_1); // @@ -720,7 +720,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.tabControl1.Location = new System.Drawing.Point(6, 232); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(709, 197); + this.tabControl1.Size = new System.Drawing.Size(577, 343); this.tabControl1.TabIndex = 4; // // tabPage1 @@ -729,7 +729,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(701, 171); + this.tabPage1.Size = new System.Drawing.Size(569, 317); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "糊化机(#A)"; this.tabPage1.UseVisualStyleBackColor = true; @@ -746,7 +746,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.dataGridSiloH1.Name = "dataGridSiloH1"; this.dataGridSiloH1.RowHeadersWidth = 62; this.dataGridSiloH1.RowTemplate.Height = 23; - this.dataGridSiloH1.Size = new System.Drawing.Size(689, 155); + this.dataGridSiloH1.Size = new System.Drawing.Size(557, 304); this.dataGridSiloH1.TabIndex = 66; this.dataGridSiloH1.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridSiloH1_DefaultValuesNeeded); // @@ -847,7 +847,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.groupBox7.Controls.Add(this.dataGridDryer1Action); this.groupBox7.Location = new System.Drawing.Point(6, 20); this.groupBox7.Name = "groupBox7"; - this.groupBox7.Size = new System.Drawing.Size(709, 208); + this.groupBox7.Size = new System.Drawing.Size(573, 208); this.groupBox7.TabIndex = 0; this.groupBox7.TabStop = false; this.groupBox7.Text = "干混机(#A)"; @@ -864,7 +864,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning this.dataGridDryer1Action.Name = "dataGridDryer1Action"; this.dataGridDryer1Action.RowHeadersWidth = 62; this.dataGridDryer1Action.RowTemplate.Height = 23; - this.dataGridDryer1Action.Size = new System.Drawing.Size(702, 189); + this.dataGridDryer1Action.Size = new System.Drawing.Size(564, 189); this.dataGridDryer1Action.TabIndex = 63; this.dataGridDryer1Action.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridDryer1Action_DefaultValuesNeeded); // @@ -904,7 +904,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning // // BtnCanel // - this.BtnCanel.Location = new System.Drawing.Point(264, 970); + this.BtnCanel.Location = new System.Drawing.Point(917, 828); this.BtnCanel.Name = "BtnCanel"; this.BtnCanel.Size = new System.Drawing.Size(119, 47); this.BtnCanel.TabIndex = 2; @@ -916,7 +916,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1463, 1029); + this.ClientSize = new System.Drawing.Size(1063, 927); + this.Controls.Add(this.tabControl3); this.Controls.Add(this.groupBox5); this.Controls.Add(this.BtnCanel); this.Controls.Add(this.BtnSave); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.cs index 668eba1..f207ee0 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.cs @@ -332,15 +332,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning private List GetAction(int deviceUnitId) { - string sql = "select ActionCode.id,code,ActionName,ActionCode.Remark,DeviceUnitId,DeviceUnit.Name\r\n from ActionCode\r\n left join DeviceUnit on ActionCode.DeviceUnitId = DeviceUnit.Id "; + string sql = "select ActionCode.id,code,ActionName,ActionCode.Remark,DeviceUnitId,DeviceUnit.Name\r\n " + + " from ActionCode\r\n " + + " left join DeviceUnit on ActionCode.DeviceUnitId = DeviceUnit.Id where IsEnable=1"; if(deviceUnitId > 0) { - sql += " where DeviceUnitId=" + deviceUnitId ; + sql += " and DeviceUnitId=" + deviceUnitId ; - sql += " order by code"; + } + + sql += " order by code"; var dataTable = DBHelp.GetTable(sql); List ls = new List(); foreach (DataRow o in dataTable.Rows) @@ -1143,6 +1147,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } } + private void tabPage3_Click(object sender, EventArgs e) + { + + } } } \ No newline at end of file diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.resx b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.resx index 3da266d..9404fd0 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.resx +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/FrmWeiRecipeDataAdd.resx @@ -189,22 +189,28 @@ True - + True - + True - + True - + True - + True - + + True + + + True + + True @@ -261,30 +267,6 @@ True - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - True @@ -309,28 +291,4 @@ True - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - \ No newline at end of file