private void btn3_Click(object sender, EventArgs e) { switch (deptCode) { case "CM": this.Hide(); WHStock stk = new WHStock(this); stk.Show(); break; case "WC": this.Hide(); WHStock wstk = new WHStock(this); wstk.Show(); break; case "AD": case "PM": case "AM": this.Hide(); SupplierMenu sm = new SupplierMenu(this); sm.Show(); break; } }
private void btnSubmit_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(tbNo.Text) || string.IsNullOrWhiteSpace(tbName.Text) || string.IsNullOrWhiteSpace(tbContact.Text)) { MessageBox.Show("You must input all fields", "Check Your Input", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { SNo = tbNo.Text; SName = tbName.Text; SContact = tbContact.Text; SAddress = rtbAdd.Text; MySqlCommand command = new MySqlCommand("UPDATE Supplier SET SupplierName = '" + SName + "', SupplierContact = '" + SContact + "', SupplierAddress = '" + SAddress + "' WHERE SupplierNo = '" + SNo + "';", cnn); cnn.Open(); command.ExecuteNonQuery(); cnn.Close(); MessageBox.Show("Update Success!", "Updated", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); m.Show(); } }
private void button1_Click(object sender, EventArgs e) { this.Close(); m.Show(); }