diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/FrmMetageFormula.Designer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/FrmMetageFormula.Designer.cs
new file mode 100644
index 0000000..09439bc
--- /dev/null
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/FrmMetageFormula.Designer.cs
@@ -0,0 +1,301 @@
+using System.ComponentModel;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace Mesnac.Action.ChemicalWeighing.LjMetageFormula
+{
+ partial class FrmMetageFormula
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.DrpType = new System.Windows.Forms.ComboBox();
+ this.comboBox1 = new System.Windows.Forms.ComboBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.comboBox2 = new System.Windows.Forms.ComboBox();
+ this.TxtWeight = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.label5 = new System.Windows.Forms.Label();
+ this.txtDifference = new System.Windows.Forms.TextBox();
+ this.label6 = new System.Windows.Forms.Label();
+ this.txtName = new System.Windows.Forms.TextBox();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.dataGridView1 = new System.Windows.Forms.DataGridView();
+ this.No = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.MaterialName = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Difference = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.groupBox1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // DrpType
+ //
+ this.DrpType.FormattingEnabled = true;
+ this.DrpType.Location = new System.Drawing.Point(164, 46);
+ this.DrpType.Name = "DrpType";
+ this.DrpType.Size = new System.Drawing.Size(121, 20);
+ this.DrpType.TabIndex = 18;
+ this.DrpType.SelectedIndexChanged += new System.EventHandler(this.DrpType_SelectedIndexChanged);
+ //
+ // comboBox1
+ //
+ this.comboBox1.FormattingEnabled = true;
+ this.comboBox1.Location = new System.Drawing.Point(164, 81);
+ this.comboBox1.Name = "comboBox1";
+ this.comboBox1.Size = new System.Drawing.Size(121, 20);
+ this.comboBox1.TabIndex = 19;
+ this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(83, 51);
+ this.label3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(59, 12);
+ this.label3.TabIndex = 16;
+ this.label3.Text = "物料类别:";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(83, 84);
+ this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(59, 12);
+ this.label1.TabIndex = 17;
+ this.label1.Text = "物料名称:";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(83, 117);
+ this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(59, 12);
+ this.label2.TabIndex = 17;
+ this.label2.Text = "存储设备:";
+ //
+ // comboBox2
+ //
+ this.comboBox2.FormattingEnabled = true;
+ this.comboBox2.Location = new System.Drawing.Point(164, 114);
+ this.comboBox2.Name = "comboBox2";
+ this.comboBox2.Size = new System.Drawing.Size(121, 20);
+ this.comboBox2.TabIndex = 19;
+ this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
+ //
+ // TxtWeight
+ //
+ this.TxtWeight.Location = new System.Drawing.Point(164, 145);
+ this.TxtWeight.Margin = new System.Windows.Forms.Padding(5);
+ this.TxtWeight.Name = "TxtWeight";
+ this.TxtWeight.Size = new System.Drawing.Size(129, 21);
+ this.TxtWeight.TabIndex = 21;
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(83, 145);
+ this.label4.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(35, 12);
+ this.label4.TabIndex = 20;
+ this.label4.Text = "重量:";
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(83, 184);
+ this.label5.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(35, 12);
+ this.label5.TabIndex = 20;
+ this.label5.Text = "公差:";
+ //
+ // txtDifference
+ //
+ this.txtDifference.Location = new System.Drawing.Point(164, 184);
+ this.txtDifference.Margin = new System.Windows.Forms.Padding(5);
+ this.txtDifference.Name = "txtDifference";
+ this.txtDifference.Size = new System.Drawing.Size(129, 21);
+ this.txtDifference.TabIndex = 21;
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(83, 9);
+ this.label6.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(59, 12);
+ this.label6.TabIndex = 20;
+ this.label6.Text = "配方名称:";
+ //
+ // txtName
+ //
+ this.txtName.Location = new System.Drawing.Point(164, 9);
+ this.txtName.Margin = new System.Windows.Forms.Padding(5);
+ this.txtName.Name = "txtName";
+ this.txtName.Size = new System.Drawing.Size(129, 21);
+ this.txtName.TabIndex = 21;
+ //
+ // groupBox1
+ //
+ this.groupBox1.Controls.Add(this.dataGridView1);
+ this.groupBox1.Location = new System.Drawing.Point(12, 276);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(572, 289);
+ this.groupBox1.TabIndex = 22;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "称量配方";
+ //
+ // dataGridView1
+ //
+ this.dataGridView1.AllowUserToAddRows = false;
+ this.dataGridView1.AllowUserToDeleteRows = false;
+ this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.No, this.MaterialName, this.Weight, this.Difference });
+ this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.dataGridView1.Location = new System.Drawing.Point(3, 17);
+ this.dataGridView1.Name = "dataGridView1";
+ this.dataGridView1.ReadOnly = true;
+ this.dataGridView1.RowTemplate.Height = 23;
+ this.dataGridView1.Size = new System.Drawing.Size(566, 269);
+ this.dataGridView1.TabIndex = 0;
+ //
+ // No
+ //
+ this.No.DataPropertyName = "No";
+ this.No.HeaderText = "序号";
+ this.No.MaxInputLength = 10;
+ this.No.Name = "No";
+ this.No.ReadOnly = true;
+ //
+ // MaterialName
+ //
+ this.MaterialName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+ this.MaterialName.DataPropertyName = "MaterialName";
+ this.MaterialName.HeaderText = "物料";
+ this.MaterialName.Name = "MaterialName";
+ this.MaterialName.ReadOnly = true;
+ //
+ // Weight
+ //
+ this.Weight.DataPropertyName = "Weight";
+ this.Weight.HeaderText = "重量";
+ this.Weight.Name = "Weight";
+ this.Weight.ReadOnly = true;
+ //
+ // Difference
+ //
+ this.Difference.DataPropertyName = "Difference";
+ this.Difference.HeaderText = "公差";
+ this.Difference.Name = "Difference";
+ this.Difference.ReadOnly = true;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(81, 236);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 23;
+ this.button1.Text = "添加物料";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(295, 236);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(75, 23);
+ this.button2.TabIndex = 23;
+ this.button2.Text = "删除物料";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // FrmMetageFormula
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(632, 635);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.groupBox1);
+ this.Controls.Add(this.txtName);
+ this.Controls.Add(this.txtDifference);
+ this.Controls.Add(this.TxtWeight);
+ this.Controls.Add(this.label6);
+ this.Controls.Add(this.label5);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.DrpType);
+ this.Controls.Add(this.comboBox2);
+ this.Controls.Add(this.comboBox1);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Name = "FrmMetageFormula";
+ this.Text = "称量配方管理";
+ this.groupBox1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+ }
+
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.TextBox txtName;
+
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.TextBox txtDifference;
+
+ private System.Windows.Forms.TextBox TxtWeight;
+ private System.Windows.Forms.Label label4;
+
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.ComboBox comboBox2;
+
+ private System.Windows.Forms.ComboBox DrpType;
+ private System.Windows.Forms.ComboBox comboBox1;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label1;
+
+ #endregion
+
+ private GroupBox groupBox1;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.DataGridView dataGridView1;
+ private DataGridViewTextBoxColumn No;
+ private DataGridViewTextBoxColumn MaterialName;
+ private DataGridViewTextBoxColumn Weight;
+ private DataGridViewTextBoxColumn Difference;
+ }
+}
\ No newline at end of file
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/FrmMetageFormula.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/FrmMetageFormula.cs
new file mode 100644
index 0000000..a4e62b8
--- /dev/null
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/FrmMetageFormula.cs
@@ -0,0 +1,162 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+using DevExpress.Office.Utils;
+using Mesnac.Action.ChemicalWeighing.LjMaterial;
+
+namespace Mesnac.Action.ChemicalWeighing.LjMetageFormula
+{
+ public partial class FrmMetageFormula : Form
+ {
+ private WeightFormulaView view = new WeightFormulaView();
+ public FrmMetageFormula()
+ {
+ InitializeComponent();
+
+ DrpType.ValueMember = "Id";
+ DrpType.DisplayMember = "Name";
+
+ comboBox1.ValueMember = "Id";
+ comboBox1.DisplayMember = "Name";
+
+ comboBox2.ValueMember = "Id";
+ comboBox2.DisplayMember = "Name";
+
+ Init();
+
+ this.dataGridView1.AutoGenerateColumns = false;
+ }
+
+ private void Init()
+ {
+ var drpMtype = MaterialInfoTypeHelp.GetType();
+
+ this.DrpType.DataSource = drpMtype;
+ }
+
+ private void DrpType_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ var nameValueCollection = MaterialInfoTypeHelp.GetALLByTypeId(Convert.ToInt32(DrpType.SelectedValue));
+ this.comboBox1.DataSource = nameValueCollection;
+
+ }
+
+ private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ IList ls = null;
+ //表示大仓的物料
+ if (DrpType.SelectedValue.ToString() == "1")
+ {
+ ls = StockMaterialDb.GetStockByMtypIdMId(Convert.ToInt32(DrpType.SelectedValue), Convert.ToInt32(comboBox1.SelectedValue));
+ }
+ else
+ {
+ ls = DaybinMaterialDb.GetStockByMtypIdMId(Convert.ToInt32(DrpType.SelectedValue), Convert.ToInt32(comboBox1.SelectedValue));
+ }
+
+ if (ls == null || ls.Count == 0)
+ {
+ if (ls == null) ls = new List();
+ ls.Add(new MyNameValue()
+ {
+ Id = 0,
+ Name = "请选择"
+ });
+ }
+ this.comboBox2.DataSource = ls;
+
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ //假如添加
+ string txtNameValue = txtName.Text.Trim();
+ if (string.IsNullOrEmpty(txtNameValue))
+ {
+ txtName.Focus();
+ MessageBox.Show("请输入配方名称");
+ return;
+ }
+
+ var comboBox2SelectedValue = comboBox2.SelectedValue;
+ if (comboBox2SelectedValue.ToString()=="0")
+ {
+ comboBox2.Focus();
+ MessageBox.Show("请选择存储设备");
+ return;
+ }
+
+
+ var weight = TxtWeight.Text.Trim();
+ if (!float.TryParse(weight, out var weigh))
+ {
+ TxtWeight.Focus();
+ MessageBox.Show("请输入正确的重量");
+ return;
+ }
+
+ var difference = txtDifference.Text.Trim();
+ if (!float.TryParse(weight, out var deff))
+ {
+ txtDifference.Focus();
+ MessageBox.Show("请输入正确的比重");
+ return;
+ }
+
+ if (view.MtypeId == 0)
+ {
+ view.MtypeId = (int)DrpType.SelectedValue;
+ view.MtypeName = DrpType.Text;
+ }
+ else
+ {
+ if (view.MtypeId != (int)DrpType.SelectedValue)
+ {
+ MessageBox.Show("请选择相同的物料类别");
+ return;
+ }
+ }
+
+ int count;
+ count = view.DataGrid.Count(x => x.MId==(int)this.comboBox1.SelectedValue);
+ if (count > 0)
+ {
+ MessageBox.Show("请添加相同的物料 请删除后重试");
+ return;
+ }
+
+ view.DataGrid.Add(new WeightMaterilaData()
+ {
+ MId = (int)this.comboBox1.SelectedValue,
+ MaterialName = comboBox1.Text,
+ Difference = deff,
+ Weight = weigh
+ });
+ view.SetNo();
+
+ this.dataGridView1.DataSource = null;
+ this.dataGridView1.DataSource = view.DataGrid;
+
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ var dataGridViewSelectedRowCollection = this.dataGridView1.SelectedRows;
+ if (dataGridViewSelectedRowCollection.Count==0)
+ {
+ MessageBox.Show("请选择要删除的数据");
+ return;
+ }
+ else
+ {
+ var dataGridViewSelectedRow = dataGridViewSelectedRowCollection[0];
+ var dataGridViewCell =(int)dataGridViewSelectedRow.Cells["No"].Value;
+ view.DataGrid.RemoveAll(x => x.No == dataGridViewCell);
+ view.SetNo();
+ this.dataGridView1.DataSource = null;
+ this.dataGridView1.DataSource = view.DataGrid;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/FrmMetageFormula.resx b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/FrmMetageFormula.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/FrmMetageFormula.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/StockMaterialDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/StockMaterialDb.cs
new file mode 100644
index 0000000..d8410d6
--- /dev/null
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/StockMaterialDb.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Runtime.CompilerServices;
+using DevExpress.DataProcessing;
+using Mesnac.Action.ChemicalWeighing.LjMaterial;
+
+namespace Mesnac.Action.ChemicalWeighing.LjMetageFormula
+{
+ public partial class StockMaterialDb:DBHelp
+ {
+ public static IList GetStockByMtypIdMId(int mtypeId, int mid)
+ {
+ IList myNameValues = new List();
+
+ string sql = $"select Id,StockName from lj_stock_material where MTypeId={mtypeId} and MId={mid}";
+ var dataTable = GetTable(sql);
+ foreach (DataRow dataTableRow in dataTable.Rows)
+ {
+ myNameValues.Add(new MyNameValue()
+ {
+ Id = Convert.ToInt32(dataTableRow[0]),
+ Name = dataTableRow[1].ToString()
+ });
+ }
+
+ return myNameValues;
+ }
+ }
+
+
+ public class DaybinMaterialDb : DBHelp
+ {
+ public static IList GetStockByMtypIdMId(int mtypeId, int mid)
+ {
+ IList myNameValues = new List();
+
+ string sql = $"select id, daybinname from lj_day_material where MTypeId={mtypeId} and MId={mid}";
+ var dataTable = GetTable(sql);
+ foreach (DataRow dataTableRow in dataTable.Rows)
+ {
+ myNameValues.Add(new MyNameValue()
+ {
+ Id = Convert.ToInt32(dataTableRow[0]),
+ Name = dataTableRow[1].ToString()
+ });
+ }
+
+ return myNameValues;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/WeightFormulaView.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/WeightFormulaView.cs
new file mode 100644
index 0000000..9abacc7
--- /dev/null
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetageFormula/WeightFormulaView.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Mesnac.Action.ChemicalWeighing.LjMetageFormula
+{
+ internal class WeightFormulaView
+ {
+ public WeightFormulaView()
+ {
+ Id = Guid.NewGuid().ToString("N");
+ DataGrid = new List();
+ }
+
+ public string Id { get; set; }
+
+ public string Name { get; set; }
+
+ public int MtypeId { get; set; }
+
+ public string MtypeName { get; set; }
+
+
+ public List DataGrid { get; set; }
+
+
+ public void SetNo()
+ {
+ for (var i =1; i <= DataGrid.Count; i++)
+ {
+ DataGrid[i-1].No = i;
+ }
+ }
+
+ }
+
+
+ public class WeightMaterilaData
+ {
+ public int No { get; set; }
+ public int MId { get; set; }
+ public string MaterialName { get; set; }
+ public float Weight { get; set; }
+ public float Difference { get; set; }
+
+ }
+}
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/FrmStock.Designer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/FrmStock.Designer.cs
index 6c147e5..db4f78f 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/FrmStock.Designer.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/FrmStock.Designer.cs
@@ -33,126 +33,29 @@ namespace Mesnac.Action.ChemicalWeighing.LjStock
///
private void InitializeComponent()
{
- this.Jog = new System.Windows.Forms.TextBox();
- this.label9 = new System.Windows.Forms.Label();
- this.Lead = new System.Windows.Forms.TextBox();
- this.label8 = new System.Windows.Forms.Label();
- this.SlowScale = new System.Windows.Forms.TextBox();
- this.label7 = new System.Windows.Forms.Label();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.Slow = new System.Windows.Forms.TextBox();
- this.High = new System.Windows.Forms.TextBox();
this.TankName = new System.Windows.Forms.TextBox();
- this.TankCode = new System.Windows.Forms.TextBox();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
- this.label6 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
+ this.DrpType = new System.Windows.Forms.ComboBox();
+ this.comboBox2 = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
- // Jog
- //
- this.Jog.Location = new System.Drawing.Point(133, 333);
- this.Jog.Margin = new System.Windows.Forms.Padding(5);
- this.Jog.Name = "Jog";
- this.Jog.Size = new System.Drawing.Size(129, 21);
- this.Jog.TabIndex = 39;
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(52, 336);
- this.label9.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(47, 12);
- this.label9.TabIndex = 38;
- this.label9.Text = "点动值:";
- //
- // Lead
- //
- this.Lead.Location = new System.Drawing.Point(133, 298);
- this.Lead.Margin = new System.Windows.Forms.Padding(5);
- this.Lead.Name = "Lead";
- this.Lead.Size = new System.Drawing.Size(129, 21);
- this.Lead.TabIndex = 37;
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(52, 301);
- this.label8.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(47, 12);
- this.label8.TabIndex = 36;
- this.label8.Text = "提前量:";
- //
- // SlowScale
- //
- this.SlowScale.Location = new System.Drawing.Point(133, 256);
- this.SlowScale.Margin = new System.Windows.Forms.Padding(5);
- this.SlowScale.Name = "SlowScale";
- this.SlowScale.Size = new System.Drawing.Size(129, 21);
- this.SlowScale.TabIndex = 35;
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(52, 259);
- this.label7.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(47, 12);
- this.label7.TabIndex = 34;
- this.label7.Text = "慢称值:";
- //
- // comboBox1
- //
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Location = new System.Drawing.Point(133, 14);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(121, 20);
- this.comboBox1.TabIndex = 33;
- //
- // Slow
- //
- this.Slow.Location = new System.Drawing.Point(133, 209);
- this.Slow.Margin = new System.Windows.Forms.Padding(5);
- this.Slow.Name = "Slow";
- this.Slow.Size = new System.Drawing.Size(129, 21);
- this.Slow.TabIndex = 31;
- //
- // High
- //
- this.High.Location = new System.Drawing.Point(133, 163);
- this.High.Margin = new System.Windows.Forms.Padding(5);
- this.High.Name = "High";
- this.High.Size = new System.Drawing.Size(129, 21);
- this.High.TabIndex = 32;
- //
// TankName
//
this.TankName.Enabled = false;
- this.TankName.Location = new System.Drawing.Point(133, 116);
+ this.TankName.Location = new System.Drawing.Point(141, 113);
this.TankName.Margin = new System.Windows.Forms.Padding(5);
this.TankName.Name = "TankName";
this.TankName.Size = new System.Drawing.Size(129, 21);
this.TankName.TabIndex = 29;
//
- // TankCode
- //
- this.TankCode.Enabled = false;
- this.TankCode.Location = new System.Drawing.Point(133, 65);
- this.TankCode.Margin = new System.Windows.Forms.Padding(5);
- this.TankCode.Name = "TankCode";
- this.TankCode.Size = new System.Drawing.Size(129, 21);
- this.TankCode.TabIndex = 30;
- //
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.btnCancel.Location = new System.Drawing.Point(227, 392);
+ this.btnCancel.Location = new System.Drawing.Point(225, 220);
this.btnCancel.Margin = new System.Windows.Forms.Padding(5);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(98, 45);
@@ -163,7 +66,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjStock
//
// btnOK
//
- this.btnOK.Location = new System.Drawing.Point(54, 392);
+ this.btnOK.Location = new System.Drawing.Point(52, 220);
this.btnOK.Margin = new System.Windows.Forms.Padding(5);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(98, 45);
@@ -172,26 +75,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjStock
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(52, 209);
- this.label6.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(83, 12);
- this.label6.TabIndex = 23;
- this.label6.Text = "低速称量速度:";
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(52, 163);
- this.label5.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(83, 12);
- this.label5.TabIndex = 22;
- this.label5.Text = "高速称量速度:";
- //
// label4
//
this.label4.AutoSize = true;
@@ -200,75 +83,73 @@ namespace Mesnac.Action.ChemicalWeighing.LjStock
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(53, 12);
this.label4.TabIndex = 24;
- this.label4.Text = "料仓名称";
+ this.label4.Text = "大仓名称";
+ //
+ // DrpType
+ //
+ this.DrpType.FormattingEnabled = true;
+ this.DrpType.Location = new System.Drawing.Point(141, 16);
+ this.DrpType.Name = "DrpType";
+ this.DrpType.Size = new System.Drawing.Size(121, 20);
+ this.DrpType.TabIndex = 42;
+ this.DrpType.SelectedIndexChanged += new System.EventHandler(this.DrpType_SelectedIndexChanged);
+ //
+ // comboBox2
+ //
+ this.comboBox2.FormattingEnabled = true;
+ this.comboBox2.Location = new System.Drawing.Point(141, 54);
+ this.comboBox2.Name = "comboBox2";
+ this.comboBox2.Size = new System.Drawing.Size(121, 20);
+ this.comboBox2.TabIndex = 43;
//
// label3
//
this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(52, 65);
+ this.label3.Location = new System.Drawing.Point(52, 24);
this.label3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(59, 12);
- this.label3.TabIndex = 26;
- this.label3.Text = "料仓编码:";
+ this.label3.TabIndex = 40;
+ this.label3.Text = "物料类别:";
//
- // label1
+ // label2
//
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(52, 17);
- this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(59, 12);
- this.label1.TabIndex = 25;
- this.label1.Text = "物料名称:";
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(54, 62);
+ this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(59, 12);
+ this.label2.TabIndex = 41;
+ this.label2.Text = "物料名称:";
//
// FrmStock
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(362, 450);
- this.Controls.Add(this.Jog);
- this.Controls.Add(this.label9);
- this.Controls.Add(this.Lead);
- this.Controls.Add(this.label8);
- this.Controls.Add(this.SlowScale);
- this.Controls.Add(this.label7);
- this.Controls.Add(this.comboBox1);
- this.Controls.Add(this.Slow);
- this.Controls.Add(this.High);
+ this.Controls.Add(this.DrpType);
+ this.Controls.Add(this.comboBox2);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.label2);
this.Controls.Add(this.TankName);
- this.Controls.Add(this.TankCode);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
- this.Controls.Add(this.label6);
- this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.label1);
this.Name = "FrmStock";
- this.Text = "料仓物料";
+ this.Text = "大仓物料";
this.ResumeLayout(false);
this.PerformLayout();
}
- private System.Windows.Forms.TextBox Jog;
- private System.Windows.Forms.Label label9;
- private System.Windows.Forms.TextBox Lead;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.TextBox SlowScale;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.ComboBox comboBox1;
- private System.Windows.Forms.TextBox Slow;
- private System.Windows.Forms.TextBox High;
+ private System.Windows.Forms.ComboBox DrpType;
+ private System.Windows.Forms.ComboBox comboBox2;
+ private System.Windows.Forms.Label label2;
+
private System.Windows.Forms.TextBox TankName;
- private System.Windows.Forms.TextBox TankCode;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOK;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label label1;
#endregion
}
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/FrmStock.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/FrmStock.cs
index 5474a31..1a65f6e 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/FrmStock.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/FrmStock.cs
@@ -25,178 +25,65 @@ namespace Mesnac.Action.ChemicalWeighing.LjStock
private void Init()
{
- var nameValueCollection = MaterialInfoTypeHelp.GetALL();
- this.comboBox1.DataSource = nameValueCollection;
- comboBox1.ValueMember = "Id";
- comboBox1.DisplayMember = "Name";
- foreach (MyNameValue combo in comboBox1.Items)
+ var dataTable = StockDbHelp.GetById(viewl.Id);
+ if (dataTable.Rows.Count == 1)
{
- if (combo.Id == viewl.MTypeId)
- {
- comboBox1.SelectedItem = combo;
- break;
- }
- }
-
- if (null != viewl)
- {
- this.TankCode.Text = viewl.Code;
+ var dr = dataTable.Rows[0];
+ viewl.MTypeId = Convert.ToInt32(dr["MTypeId"]);
+ viewl.MId = Convert.ToInt32(dr["MId"]);
+ viewl.StockName = dr["StockName"].ToString();
this.TankName.Text = viewl.StockName;
- this.High.Text = viewl.High.ToString();
- this.Slow.Text = viewl.Slow.ToString();
- this.SlowScale.Text = viewl.SlowScale.ToString();
- this.Lead.Text = viewl.Lead.ToString();
- this.Jog.Text = viewl.Jog.ToString();
+ this.TankName.Enabled = false;
}
- }
- private void btnOK_Click(object sender, EventArgs e)
- {
- #region check
-
- if (string.IsNullOrEmpty(High.Text.Trim()))
- {
- High.Focus();
- MessageBox.Show("请输入高速称量速度");
- return;
- }
- else
- {
- if (float.TryParse(High.Text.Trim(),out float a))
- {
- if (a < 0 || a > 50)
- {
- High.Focus();
- MessageBox.Show("请输入正确高速称量速度[0.0~50.0]");
- return;
- }
- }
- else
- {
- High.Focus();
- MessageBox.Show("请输入正确高速称量速度[0.0~50.0]");
- return;
- }
- }
-
-
+
+ var drpMtype = MaterialInfoTypeHelp.GetType();
+ DrpType.ValueMember = "Id";
+ DrpType.DisplayMember = "Name";
+ this.DrpType.DataSource = drpMtype;
+
- if (string.IsNullOrEmpty(Slow.Text.Trim()))
+ foreach (MyNameValue combo in DrpType.Items)
{
- Slow.Focus();
- MessageBox.Show("请输入慢速称量速度");
- return;
- }
- else
- {
- if (float.TryParse(Slow.Text.Trim(),out float b))
- {
- if (b < 0 || b > 50)
- {
- Slow.Focus();
- MessageBox.Show("请输入正确低速称量速度[0.0~50.0]");
- return;
- }
- }
- else
+ if (combo.Id == viewl.MTypeId)
{
- Slow.Focus();
- MessageBox.Show("请输入正确低速称量速度[0.0~50.0]");
- return;
+ DrpType.SelectedItem = combo;
+ DrpType.Enabled = false;
+ break;
}
}
-
-
+ }
- if (string.IsNullOrEmpty(SlowScale.Text.Trim()))
- {
- SlowScale.Focus();
- MessageBox.Show("请输入慢称值");
- return;
- }
- else
- {
- if (float.TryParse(SlowScale.Text.Trim(),out float b))
- {
- if (b < 0 || b > 10)
- {
- SlowScale.Focus();
- MessageBox.Show("请输入正确低速称量速度[0.0~10.0]");
- return;
- }
- }
- else
- {
- SlowScale.Focus();
- MessageBox.Show("请输入正确低速称量速度[0.0~10.0]");
- return;
- }
- }
+ private void btnOK_Click(object sender, EventArgs e)
+ {
+
+
+ viewl.MId = Convert.ToInt32(comboBox2.SelectedValue);
+ viewl.MName = comboBox2.Text;
+
+ StockDbHelp.Update(viewl);
+ this.DialogResult = System.Windows.Forms.DialogResult.OK;
+ }
+
+
+
+ private void DrpType_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ var nameValueCollection = MaterialInfoTypeHelp.GetALLByTypeId(Convert.ToInt32(DrpType.SelectedValue));
+ this.comboBox2.DataSource = nameValueCollection;
+ comboBox2.ValueMember = "Id";
+ comboBox2.DisplayMember = "Name";
- if (string.IsNullOrEmpty(Lead.Text.Trim()))
- {
- Lead.Focus();
- MessageBox.Show("请输入提前量");
- return;
- }
- else
- {
- if (float.TryParse(Lead.Text.Trim(),out float b))
- {
- if (b < 0 || b > 10)
- {
- Lead.Focus();
- MessageBox.Show("请输入正确低速称量速度[0.0~10.0]");
- return;
- }
- }
- else
- {
- Lead.Focus();
- MessageBox.Show("请输入正确低速称量速度[0.0~10.0]");
- return;
- }
- }
- if (string.IsNullOrEmpty(Jog.Text.Trim()))
+ foreach (MyNameValue combo in comboBox2.Items)
{
- Jog.Focus();
- MessageBox.Show("请输入点动值");
- return;
- }
- else
- {
- if (float.TryParse(Lead.Text.Trim(),out float b))
- {
- if (b < 0 || b > 20)
- {
- Jog.Focus();
- MessageBox.Show("请输入正确低速称量速度[0.0~20.0]");
- return;
- }
- }
- else
+ if (combo.Id == viewl.MId)
{
- Jog.Focus();
- MessageBox.Show("请输入正确低速称量速度[0.0~20.0]");
- return;
+ comboBox2.SelectedItem = combo;
+ break;
}
}
-
- #endregion
-
-
- viewl.MTypeId = Convert.ToInt32(this.comboBox1.SelectedValue);
- viewl.High = Convert.ToSingle(High.Text);
- viewl.Slow = Convert.ToSingle(Slow.Text);
- viewl.SlowScale = Convert.ToSingle(SlowScale.Text);
- viewl.Lead = Convert.ToSingle(Lead.Text);
- viewl.Jog = Convert.ToSingle(Jog.Text);
-
-
- StockDbHelp.Update(viewl);
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
}
}
\ No newline at end of file
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/InItDbAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/InItDbAction.cs
index c019109..0fdaa1a 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/InItDbAction.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/InItDbAction.cs
@@ -21,16 +21,14 @@ namespace Mesnac.Action.ChemicalWeighing.LjStock
UpdateAction.OnUpdateMaterial += Process_Event;
DbMCControl materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local,
- "Stock").FirstOrDefault(); //获取物料数据控件
+ "lj_stock_material").FirstOrDefault(); //获取物料数据控件
this._materialGridControl = materialGridControl;
FileControl();
}
private void FileControl()
{
- string sql = @"select stock.*,mater.MaterialTypeName from Stock stock
-left join MaterialInfoType mater
-on stock.MTypeId=mater.Id";
+ string sql = @"select Id, Code, StockName, MTypeId, MTypeName, MId, MName, Remark from lj_stock_material;";
DataTable table = DBHelp.GetTable(sql);
if (this._materialGridControl != null && this._materialGridControl.BaseControl != null)
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/StockDbHelp.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/StockDbHelp.cs
index bd27d65..5456221 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/StockDbHelp.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/StockDbHelp.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Data;
using Mesnac.Action.ChemicalWeighing.LjMaterial;
namespace Mesnac.Action.ChemicalWeighing.LjStock
@@ -7,25 +8,24 @@ namespace Mesnac.Action.ChemicalWeighing.LjStock
{
public static int Update(StockView view)
{
- string sql = @"update [Stock] set
-[MTypeId] = @MTypeId,
-[High] = @High,
-[Slow] = @Slow,
-[SlowScale] = @SlowScale,
-[Lead] = @Lead,
-[Jog] = @Jog where id=@id";
+ string sql = @"update lj_stock_material set MId=@MId ,MName=@MName where id=@id";
IDictionary dic = GetDefault();
dic.Add("@id",view.Id);
- dic.Add("@MTypeId",view.MTypeId);
- dic.Add("@High",view.High);
- dic.Add("@Slow",view.Slow);
- dic.Add("@SlowScale",view.SlowScale);
- dic.Add("@Lead",view.Lead);
- dic.Add("@Jog",view.Jog);
-
+ dic.Add("@MId",view.MId);
+ dic.Add("@MName",view.MName);
ExecuteNonQuery(sql, dic);
return 1;
}
+
+
+ public static DataTable GetById(int Id)
+ {
+ string sql =
+ "select Id, Code, StockName, MTypeId, MTypeName, MId, MName, Remark from lj_stock_material where id=" +
+ Id;
+
+ return GetTable(sql);
+ }
}
}
\ No newline at end of file
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/StockView.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/StockView.cs
index eab672c..0ba60be 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/StockView.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/StockView.cs
@@ -9,7 +9,8 @@
///
///
///
- public string Code { get; set; }
+ public int MId { get; set; }
+ public string MName { get; set; }
///
///
///
@@ -18,33 +19,11 @@
///
///
public int MTypeId { get; set; }
- ///
- ///
- ///
- public float High { get; set; }
- ///
- ///
- ///
- public float Slow { get; set; }
- ///
- ///
- ///
- public float SlowScale { get; set; }
- ///
- ///
- ///
- public float Lead { get; set; }
- ///
- ///
- ///
- public float Jog { get; set; }
+
///
///
///
public string Remark { get; set; }
- ///
- /// 小料1
- ///
- public string MaterialTypeName { get; set; }
+
}
}
\ No newline at end of file
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/UpdateAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/UpdateAction.cs
index 6a7f098..4077d0f 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/UpdateAction.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjStock/UpdateAction.cs
@@ -17,7 +17,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjStock
this._runtime = runtime;
DbMCControl materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local,
- "Stock").FirstOrDefault(); //获取物料数据控件
+ "lj_stock_material").FirstOrDefault(); //获取物料数据控件
this._materialGridControl = materialGridControl;
DataGridView clientGridView = this._materialGridControl.BaseControl as DataGridView;
@@ -36,14 +36,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjStock
StockView actionCodeView = new StockView()
{
Id = (int)dataGridViewRow.Cells["id"].Value,
- Code = dataGridViewRow.Cells["Code"].Value.ToString(),
- StockName = dataGridViewRow.Cells["StockName"].Value.ToString(),
- MTypeId = (int)dataGridViewRow.Cells["MTypeId"].Value,
- High = Convert.ToInt64(dataGridViewRow.Cells["High"].Value),
- Slow = Convert.ToInt64(dataGridViewRow.Cells["Slow"].Value),
- SlowScale = Convert.ToInt64(dataGridViewRow.Cells["SlowScale"].Value),
- Lead = Convert.ToInt64(dataGridViewRow.Cells["Lead"].Value),
- Jog = Convert.ToInt64(dataGridViewRow.Cells["Jog"].Value)
+
};
FrmStock frmStock = new FrmStock(actionCodeView);
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjTanNum/UpdateAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjTanNum/UpdateAction.cs
index 81798c6..cb1284b 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjTanNum/UpdateAction.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjTanNum/UpdateAction.cs
@@ -17,7 +17,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjTanNum
this._runtime = runtime;
DbMCControl materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local,
- "TankNumCoding").FirstOrDefault(); //获取物料数据控件
+ "lj_stock_material").FirstOrDefault(); //获取物料数据控件
this._materialGridControl = materialGridControl;
DataGridView clientGridView = this._materialGridControl.BaseControl as DataGridView;
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj
index d76e206..39a10bd 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj
@@ -261,6 +261,14 @@
+
+ Form
+
+
+ FrmMetageFormula.cs
+
+
+
Form
@@ -571,6 +579,9 @@
FrmMaterial.cs
+
+ FrmMetageFormula.cs
+
FrmMetage.cs
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs
index 11b5990..a6c5227 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs
@@ -7,6 +7,7 @@ using System.Windows.Forms;
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Entity;
+using Mesnac.Action.ChemicalWeighing.LjMetageFormula;
using Mesnac.Basic;
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
@@ -31,8 +32,10 @@ namespace Mesnac.Action.ChemicalWeighing.Test
dbHelper.ClearParameter();
dbHelper.CommandType = CommandType.Text;
dbHelper.CommandText = sql;
-
- dbHelper.ExecuteNonQuery();
+
+
+ FrmMetageFormula frmMetageFormula = new FrmMetageFormula();
+ frmMetageFormula.Show();
//ParametersWithPc.B1.FirstWord 256 768
@@ -51,16 +54,21 @@ namespace Mesnac.Action.ChemicalWeighing.Test
// //badc1e 2
// var read = BasePlcHelper.Instance.PlcRead(instanceRecipeName0, out int[] ss);
+
//192.168.153.100
- var firstWordNowValue = BasePlcHelper.Instance.test;
- var a = BasePlcHelper.Instance.tst0;
- var b = BasePlcHelper.Instance.tst1;
- var bs = BasePlcHelper.Instance.tst2;
+ // var firstWordNowValue = BasePlcHelper.Instance.test;
+ // var a = BasePlcHelper.Instance.tst0;
+ // var b = BasePlcHelper.Instance.tst1;
+ // var bs = BasePlcHelper.Instance.tst2;
+
- var bo = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 0, 1, out short[] aaaaa);
- var aa = Mesnac.Basic.DataProcessor.Swap(aaaaa[0]); //注意:西门子PLC需要高低位转换
- var qq = Convert.ToBoolean(aa);
+ // var bo = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 2, 2, out short[] f);
+ // var a2 = Mesnac.Basic.DataProcessor.Swap(f[0]); //注意:西门子PLC需要高低位转换
+ //
+ // bo = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 0, 1, out short[] aaaaa);
+ // var aa = Mesnac.Basic.DataProcessor.Swap(aaaaa[0]); //注意:西门子PLC需要高低位转换
+ // var qq = Convert.ToBoolean(aa);
//
//
//
@@ -77,27 +85,27 @@ namespace Mesnac.Action.ChemicalWeighing.Test
// }
- var plcReadds = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 1, 1, out short[] bbbb);
- var bSwap = Mesnac.Basic.DataProcessor.Swap(bbbb[0]); //注意:西门子PLC需要高低位转换
-
- var bytesa = BitConverter.GetBytes(bSwap);
-
- bool[] bits = new bool[8];
-
- for (int i = 0; i <8; i++)
- {
- bits[i] = (bytesa[0] & (1 << i)) != 0;
-
- }
- bool[] bits2 = new bool[8];
-
- for (int i = 0; i <8; i++)
- {
- bits2[i] = (bytesa[1] & (1 << i)) != 0;
-
- }
-
- var ss = "asdf";
+ // var plcReadds = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 1, 1, out short[] bbbb);
+ // var bSwap = Mesnac.Basic.DataProcessor.Swap(bbbb[0]); //注意:西门子PLC需要高低位转换
+ //
+ // var bytesa = BitConverter.GetBytes(bSwap);
+ //
+ // bool[] bits = new bool[8];
+ //
+ // for (int i = 0; i <8; i++)
+ // {
+ // bits[i] = (bytesa[0] & (1 << i)) != 0;
+ //
+ // }
+ // bool[] bits2 = new bool[8];
+ //
+ // for (int i = 0; i <8; i++)
+ // {
+ // bits2[i] = (bytesa[1] & (1 << i)) != 0;
+ //
+ // }
+ //
+ // var ss = "asdf";
//
// short test = ssss[0];
// var bytes = BitConverter.GetBytes(test);
diff --git a/Main/MCEdit/Data/EventConfig/小料称量/榄菊料仓物料.xml b/Main/MCEdit/Data/EventConfig/小料称量/榄菊大仓物料.xml
similarity index 79%
rename from Main/MCEdit/Data/EventConfig/小料称量/榄菊料仓物料.xml
rename to Main/MCEdit/Data/EventConfig/小料称量/榄菊大仓物料.xml
index 95513c9..fced784 100644
--- a/Main/MCEdit/Data/EventConfig/小料称量/榄菊料仓物料.xml
+++ b/Main/MCEdit/Data/EventConfig/小料称量/榄菊大仓物料.xml
@@ -2,15 +2,15 @@
-
+
- 初始化料仓物料
- 初始化料仓物料
+ 初始大料仓物料
+ 初始大料仓物料
- 修改料仓物料
- 修改料仓物料
+ 修改大仓物料
+ 修改大仓物料
diff --git a/Main/MCEdit/Data/MCProject/SCWSProject2.mprj b/Main/MCEdit/Data/MCProject/SCWSProject2.mprj
index b5fbe7c..fa84fa0 100644
--- a/Main/MCEdit/Data/MCProject/SCWSProject2.mprj
+++ b/Main/MCEdit/Data/MCProject/SCWSProject2.mprj
@@ -35,6 +35,7 @@
+
diff --git a/Main/MCEdit/Data/MCProject/nodeDevice.xml b/Main/MCEdit/Data/MCProject/nodeDevice.xml
index a37df5d..b558563 100644
--- a/Main/MCEdit/Data/MCProject/nodeDevice.xml
+++ b/Main/MCEdit/Data/MCProject/nodeDevice.xml
@@ -7697,7 +7697,7 @@
-
+
diff --git a/Main/MCEdit/Data/MCProject/nodeForm/FormStockMaterial.xml b/Main/MCEdit/Data/MCProject/nodeForm/FormStockMaterial.xml
new file mode 100644
index 0000000..629cd02
--- /dev/null
+++ b/Main/MCEdit/Data/MCProject/nodeForm/FormStockMaterial.xml
@@ -0,0 +1,117 @@
+
+
diff --git a/Main/MCEdit/MCEdit.csproj b/Main/MCEdit/MCEdit.csproj
index d99f3ba..c58792b 100644
--- a/Main/MCEdit/MCEdit.csproj
+++ b/Main/MCEdit/MCEdit.csproj
@@ -203,7 +203,7 @@
Designer
PreserveNewest
-
+
Designer
PreserveNewest