private void button1_Click(object sender, EventArgs e) { if (txtpn.Text != "") { string sn = null; if (txtsn.Visible == true && txtsn.Text != "") { sn = txtsn.Text.Trim(); } else { sn = null; } string tmepid = null, Olid = null; string strsql = $"exec usp_OLNotnullInsertPN '{txtpn.Text.Trim()}','{sn}'"; DataSet ds = new DataSet(); ds = SqlHelper.ExcuteDataSet(strsql); if (ds != null) { tmepid = ds.Tables[0].Rows[0]["out"].ToString(); Olid = ds.Tables[0].Rows[0]["ol"].ToString(); } if (tmepid == "1") { labloc.Text = Olid; Server_Class.onoffled(Olid, 0); affirmloc(); } else { Server_Class.Error("3"); groupview(); } } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 4) { if (dataGridView1.CurrentRow.Cells ["Column5"].Value.ToString() == "取料") { label6.Text = dataGridView1.CurrentRow.Cells["Column1"].Value.ToString(); Server_Class.onoffled(label6.Text, 0); dataGridView1.CurrentRow.Cells["Column5"].Value = "拿走了"; enterloc(); } } }
public static void offled() { string strsql = "exec usp_updatePortStatus"; SqlHelper.ExecuteNonQuery(strsql); int s = Server_Class.list1.Count; if (s > 0) { for (int i = 0; i < s; i++) { Server_Class.onoffled(Server_Class.list1[0].ToString(), 1); } } }
private void button1_Click(object sender, EventArgs e) { if (txtloc.Text != "") { int a = 0; if (radioButton1.Checked == true) { a = 0; } else if (radioButton2.Checked == true) { a = 1; } Server_Class.onoffled(txtloc.Text, a); txtloc.Clear(); txtloc.Focus(); } }
private void thled() { Server_Class.Error("1"); Thread.Sleep(1000); this.Invoke((EventHandler) delegate { num1 = 0; for (int i = 0; i < GridViewPO.RowCount; i++) { if (GridViewPO.Rows[i].Cells["Location"].Value.ToString() != "") { num1++; Server_Class.onoffled(GridViewPO.Rows[i].Cells["Location"].Value.ToString(), 0); } } }); }
private void textBox2_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { temp = 0; for (int i = 0; i < GridViewPO.RowCount; i++) { if (GridViewPO.Rows[i].Cells["Location"].Value != null) { if (textBox2.Text == GridViewPO.Rows[i].Cells["Location"].Value.ToString() && GridViewPO.Rows[i].Cells["zt"].Value == null) { GridViewPO.Rows[i].Cells["zt"].Value = "√"; TakePart(textBox2.Text.Trim()); Server_Class.onoffled(textBox2.Text.Trim(), 1); textBox2.Clear(); num++; temp = 1; break; } } } if (temp != 1) { Server_Class.Error("0"); str = "请扫描正确的库位"; textBox2.Clear(); textBox2.Focus(); } if (num == num1) { Thread.Sleep(1000); Server_Class.Error("2"); MessageBox.Show("备料完成", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); GridViewPO.DataSource = null; tabControl1.Visible = false; txtpo.Clear(); txtpo.Focus(); } } }
private void txtrloc_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (txtrloc.Text == labloc.Text) { Server_Class.onoffled(txtrloc.Text, 1); Thread.Sleep(200); Server_Class.Error("2"); panel1.Visible = false; txtpn.Focus(); } else { Server_Class.Error("0"); str = "扫描正确的库位"; txtrloc.Clear(); txtrloc.Focus(); } } }
private void txtrloc_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (txtrloc.Text == label6.Text) { string strsql = $"exec usp_pnout '{txtrloc.Text.Trim()}'"; if (SqlHelper.ExecuteNonQuery(strsql)) { Server_Class.onoffled(txtrloc.Text, 1); panel1.Visible = false; txtpn.Clear(); txtsn.Clear(); txtpn.Focus(); } } else { Server_Class.Error("0"); str = "请扫描正确的库位"; txtrloc.Clear(); txtrloc.Focus(); } } }
private void leds(string ol) { Server_Class.onoffled(ol, 0); Thread.Sleep(1000); Server_Class.onoffled(ol, 1); }