private void bsettingchange_Click(object sender, EventArgs e) { if (tnewpas.Text.Length > 7 || (tnewpas.Text == "" && trenewpass.Text == "")) { string usname = tusername.Text; string oldpas = toldpas.Text; string newpas = tnewpas.Text; string renewpas = trenewpass.Text; if (cc == null) { cc = new yesnofrm(2, uid, usname, oldpas, newpas, renewpas, uname); cc.Owner = this; cc.FormClosed += new FormClosedEventHandler(cc_FormClosed); cc.warningtext = "Are You Sure To Save Settings?"; cc.Show(); this.Enabled = false; } else { cc.Activate(); } } else { MessageBox.Show("Password must be contained atleast 8 characters"); } }
private void bunifuThinButton23_Click(object sender, EventArgs e) { cc = new yesnofrm(3); cc.Owner = this; cc.FormClosed += new FormClosedEventHandler(cc_FormClosed); cc.warningtext = "Are You Sure To Save ?"; cc.Show(); this.Enabled = false; }
private void addshowbutton_Click(object sender, EventArgs e) { if (ob == null) { hg = new yesnofrm(5); hg.Owner = this; hg.FormClosed += new FormClosedEventHandler(hg_FormClosed); hg.warningtext = "Do You want to save supplier details?"; hg.Show(); this.Enabled = false; } else { ob.Activate(); } }
private void bunifuFlatButton1_Click(object sender, EventArgs e) { if (ob == null) { ob = new yesnofrm(1); ob.Owner = this; ob.FormClosed += new FormClosedEventHandler(ob_FormClosed); ob.warningtext = "Are you sure.Do You Want to Logout?"; ob.Show(); this.Enabled = false; } else { ob.Activate(); } }
public void closebutton_Click(object sender, EventArgs e) { yesnofrm de; if (dataGridView1.Rows.Count == 0) { main_window mra = (main_window)this.Owner; mra.Enabled = true; closebutton.Enabled = false; this.Close(); } else { de = new yesnofrm(4); de.Owner = this; de.warningtext = "Do you want to save list before leaving?"; de.Show(); this.Enabled = false; } }
private void button_createnew_Click(object sender, EventArgs e) { try { if (text_firstname.Text == "" || text_lastname.Text == "" || text_surname.Text == "" || text_nicnumber.Text == "" || text_mnumber.Text == "" || text_addnum.Text == "" || text_addstreet.Text == "" || text_addtown.Text == "" || text_type.Text == "" || text_username.Text == "" || text_newpassword.Text == "" || text_repass.Text == "") { MessageBox.Show("You cannot keep blank fields "); } else { if (!text_type.Text.Contains("MainAdmin") && !text_type.Text.Contains("Admin") && !text_type.Text.Contains("User")) { MessageBox.Show("You have selected wrong Account type "); } else if (text_newpassword.Text.Length < 8) { MessageBox.Show("Password must be contained atleast 8 characters"); } else if (text_repass.Text != text_newpassword.Text) { MessageBox.Show("New password and re-enter password are not matching"); } else { yesnofrm bb = new yesnofrm(7); bb.Owner = this; bb.warningtext = "Do you Want to create Account"; this.Enabled = false; bb.Show(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void UA_savebutton_Click(object sender, EventArgs e) { try { bool botype = false; bool bofill = true; if (UA_type.Text == "MainAdmin" || UA_type.Text == "Admin" || UA_type.Text == "User") { botype = true; } if (UA_firstname.Text == "" || UA_lastname.Text == "" || UA_surname.Text == "" || UA_nic.Text == "" || UA_date.Text == "" || UA_mobnumber.Text == "" || UA_addressnum.Text == "" || UA_addressstreet.Text == "" || UA_addresstown.Text == "") { bofill = false; } if (botype == true && bofill == true) { ee = new yesnofrm(6); ee.Owner = this; ee.FormClosed += new FormClosedEventHandler(ee_FormClosed); ee.warningtext = "Are You Sure To Save ?"; ee.Show(); this.Enabled = false; } else { MessageBox.Show("You cannot keep blank fields"); } } catch (Exception) { throw; } }
private void button_pay_Click(object sender, EventArgs e) { bool type = false; string selecting = combo_choose_supplier.Text; if (paytype == "Cash" || paytype == "Cheque" || paytype == "Cash and Cheque") { type = true; } bool sname = false; if (combo_choose_supplier.SelectedIndex > -1) { sname = true; } try { if (type == true && sname == true && text_payment.Text != "") { yesnofrm cc = new yesnofrm(8); cc.Owner = this; cc.warningtext = "Are You Sure To Pay ?"; cc.Show(); this.Enabled = false; } else { MessageBox.Show("Check the supplier name , payment type or Amount"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void button_recorrect_Click(object sender, EventArgs e) { try { dbconnection db = new dbconnection(); bool sname = false; if (combo_choose_supplier.SelectedIndex > -1) { sname = true; } bool billnumber = false; int billnums = Int32.Parse(text_rebillnum.Text); db.openconnection(); string query54 = "select * from supplierbills where suppliername='" + combo_choose_supplier.Text + "' and billno='" + billnums + "';"; db.command(query54); while (db.readdata().Read()) { billnumber = true; } db.closeconnection(); int rebno = Int32.Parse(text_rebillnum.Text); string btype = ""; db.openconnection(); string query61 = "select * from supplierbills where billno='" + rebno + "';"; db.command(query61); while (db.readdata().Read()) { btype = db.readdata().GetString("type"); } db.closeconnection(); bool re = false; db.openconnection(); string query62 = "select * from supplierbills where rebillno='" + Int32.Parse(text_rebillnum.Text) + "';"; db.command(query62); while (db.readdata().Read()) { re = true; } if (sname == true && billnumber == true) { if (btype == "Re-Correction") { MessageBox.Show("You can't Re-Correction this Transaction"); } else if (re == true) { MessageBox.Show("this transaction already has been Re-corrected"); } else { yesnofrm cc = new yesnofrm(9); cc.Owner = this; cc.warningtext = "Are You Sure To Re-Correct ?"; cc.Show(); this.Enabled = false; } } else { MessageBox.Show("Bill no is not existing with this supplier or invalied bill number"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
void cc_FormClosed(object sender, FormClosedEventArgs e) { cc = null; }
private void button_recorrect_Click(object sender, EventArgs e) { try { dbconnection ab = new dbconnection(); bool sname = false; if (combo_add_name.SelectedIndex > -1) { sname = true; } bool correct = false; double oldsalary = 0; int renum = Int32.Parse(text_rebillnum.Text); ab.openconnection(); string query68 = "select * from salarybills where billno='" + renum + "' and userid='" + combo_add_name.Text + "';"; ab.command(query68); while (ab.readdata().Read()) { correct = true; } ab.closeconnection(); if (text_rebillnum.Text == "") { MessageBox.Show("Enter Transaction No"); } else { if (sname == true && correct == true) { ab.openconnection(); string query69 = "select * from salarybills where billno='" + text_rebillnum.Text + "';"; string btype = ""; ab.command(query69); while (ab.readdata().Read()) { btype = ab.readdata().GetString("type"); } ab.closeconnection(); dbconnection ac = new dbconnection(); bool re = false; string query70 = "select * from salarybills where rebillno='" + text_rebillnum.Text + "';"; ac.openconnection(); ac.command(query70); while (ac.readdata().Read()) { re = true; } ac.closeconnection(); if (btype == "Re-Correction") { MessageBox.Show("You can't Re-Correction this Transaction"); } else if (re == true) { MessageBox.Show("this transaction already has been Re - corrected"); } else { yesnofrm cc = new yesnofrm(10); cc.Owner = this; cc.warningtext = "Are You Sure To Re-Correct ?"; cc.Show(); this.Enabled = false; } } else { MessageBox.Show("Bill no is not existing with this user or invalied bill number"); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
void hg_FormClosed(object sender, FormClosedEventArgs e) { ob = null; }
void ee_FormClosed(object sender, FormClosedEventArgs e) { ee = null; }