private void button1_Click(object sender, EventArgs e) { String action = comboBox2.Text; String branch = comboBox1.Text; if (action.Equals("EDIT")) { EditBranch eb = new EditBranch(branch); this.Hide(); eb.Show(); } else if (action.Equals("DELETE")) { MyDbCon md = new MyDbCon(); String query = "delete from branch where bcode=" + comboBox1.Text + ""; if (md.runQuery(query)) { MessageBox.Show("Deleted Successfully."); this.Hide(); Branch b = new Branch(); b.Show(); } else { MessageBox.Show("Failed !!"); } } else { MessageBox.Show("Failed to delete."); } }
private void button1_Click(object sender, EventArgs e) { MyDbCon md = new MyDbCon(); String query = "delete from subject where scode=" + comboBox1.Text + ""; if (md.runQuery(query)) { MessageBox.Show("Deleted Successfully."); this.Hide(); Subject b = new Subject(); b.Show(); } else { MessageBox.Show("Failed !!"); } }
private void button1_Click(object sender, EventArgs e) { MyDbCon mdb = new MyDbCon(); String sql = "UPDATE branch SET bname='" + textBox2.Text + "',byear=" + textBox3.Text + ",bshift=" + textBox4.Text + " WHERE bcode=" + branch + ""; if (mdb.runQuery(sql)) { this.Hide(); MessageBox.Show("Updated Succefully !!"); Branch b = new Branch(); b.Show(); } else { MessageBox.Show("There is no branch."); } }
private void button1_Click(object sender, EventArgs e) { MyDbCon mdb = new MyDbCon(); String sql = "update subject set scode=" + textBox1.Text + ", sname='" + textBox2.Text + "', bcode=" + textBox3.Text + ", years=" + textBox4.Text + " where scode=" + comboBox3.Text; if (mdb.runQuery(sql)) { this.Hide(); MessageBox.Show("Updated Successfully!!"); Subject sb = new Subject(); sb.Show(); } else { MessageBox.Show("Failed !!"); } }
private void button1_Click(object sender, EventArgs e) { if (textBox2.Text.Equals(textBox3.Text)) { MyDbCon mdb = new MyDbCon(); String sql = "UPDATE `admin` SET `password`=" + textBox3.Text + " WHERE id=1 and password = "******"Password Changed Successfully!!"); this.Close(); } } else { MessageBox.Show("New and Confirm password dosen't match."); } }
private void button1_Click(object sender, EventArgs e) { if (comboBox3.Text.Equals("") || comboBox3.Text.Equals(null)) { MessageBox.Show("Please Select/Choose The Teacher ID First."); } else { MyDbCon mdb = new MyDbCon(); String sql = "Update teacher set tname='" + textBox1.Text + "', tshort='" + textBox2.Text + "' where tid=" + comboBox3.Text; if (mdb.runQuery(sql)) { MessageBox.Show("Teacher Details Updated Successfully!!"); this.Hide(); Teacher t = new Teacher(); t.Show(); } else { MessageBox.Show("Updation Failed !!"); } } }