private void button2_Click(object sender, EventArgs e) { foreach (var s in PLCSystem_SRM.Dic_SRM_Request) { SRM_Respone cr = null; PLCSystem_SRM.Dic_SRM_Res.TryGetValue(s.Key, out cr); //if(comboBox1.Text == "入库") //{ // cr.s_FrPattern = 2; //} //if (comboBox1.Text == "出库") //{ // cr.s_FrPattern = 1; //} //cr.s_FrStand = (ushort)int.Parse(textBox4.Text); //cr.s_FrLine = (ushort)int.Parse(textBox5.Text); //cr.s_FrGrid = (ushort)int.Parse(textBox6.Text); //cr.s_FrTier = (ushort)int.Parse(textBox7.Text); //cr.s_ToStand = (ushort)int.Parse(textBox11.Text); //cr.s_ToLine = (ushort)int.Parse(textBox10.Text); //cr.s_ToGrid = (ushort)int.Parse(textBox9.Text); //cr.s_ToTier = (ushort)int.Parse(textBox8.Text); //cr.s_Execute = 1; break; } }
public static void WriteSrmData(string inOut, int stand, int list, int blank, int floor) { foreach (var s in PLCSystem_SRM.Dic_SRM_Request) { SRM_Respone cr = null; PLCSystem_SRM.Dic_SRM_Res.TryGetValue(s.Key, out cr); //if (inOut == "入库") //{ // cr.s_FrPattern = 2; // cr.s_ToStand = 0; // cr.s_FrLine = 0; // cr.s_FrGrid = 0; // cr.s_FrTier = 0; // cr.s_FrStand = (ushort)stand; // cr.s_ToLine = (ushort)list; // cr.s_ToGrid = (ushort)blank; // cr.s_ToTier = (ushort)floor; // cr.s_Execute = 1; //} //if (inOut == "出库") //{ // cr.s_FrPattern = 1; // cr.s_FrStand = 0; // cr.s_FrLine = (ushort)list; // cr.s_FrGrid = (ushort)blank; // cr.s_FrTier = (ushort)floor; // cr.s_ToStand = (ushort)stand; // cr.s_ToLine = 0; // cr.s_ToGrid = 0; // cr.s_ToTier = 0; // cr.s_Execute = 1; //} //cr.s_Fault = 1; break; } }
private void button2_Click(object sender, EventArgs e) { //创建入库预约 try { DataTable dt; var db = new DBAccess_MySql("MySql"); dataGridView1.Columns.Clear(); string outString = ""; string houseNumber = ""; int line = 0; int list = 0; int blank = 0; int floor = 0; sql = "SELECT house_number,line,list,blank,floor FROM house_info WHERE house_number = '" + comboBox1.Text + "'"; var rlt = db.QuerySQL_ToTable(sql, out dt, out outString); if (dt == null || dt.Rows.Count <= 0) { return; } houseNumber = dt.Rows[0]["house_number"].ToString(); line = int.Parse(dt.Rows[0]["line"].ToString()); list = int.Parse(dt.Rows[0]["list"].ToString()); blank = int.Parse(dt.Rows[0]["blank"].ToString()); floor = int.Parse(dt.Rows[0]["floor"].ToString()); foreach (var s in PLCSystem_SRM.Dic_SRM_Request) { SRM_Respone cr = null; PLCSystem_SRM.Dic_SRM_Res.TryGetValue(s.Key, out cr); //if (button1.Text == "入库") //{ // cr.s_FrPattern = 2; //} //if (button1.Text == "出库") //{ // cr.s_FrPattern = 1; //} //cr.s_ToStand = 0; //cr.s_FrLine = 0; //cr.s_FrGrid = 0; //cr.s_FrTier = 0; //cr.s_FrStand = 2; //cr.s_ToLine = (ushort)list; //cr.s_ToGrid = (ushort)blank; //cr.s_ToTier = (ushort)floor; //cr.s_Execute = 1; //cr.s_Fault = 1; break; } //跟新货位状态 sql = "UPDATE house_info SET house_state = 'S' WHERE house_number = '" + houseNumber + "'"; rlt = db.ExecSql(sql, out outString); //更新库存数据 sql = "INSERT INTO house_data(house_number,goods_code,goods_name,have_number,in_house_time) VALUES('" + houseNumber + "','" + tb_suppliesName.Text + "','" + tb_specification.Text + "'," + int.Parse(textBox1.Text) + ",SYSDATE())"; rlt = db.ExecSql(sql, out outString); update_goodInfo(); comboBox1.Text = ""; } catch { MessageBox.Show("操作不正确!"); } }