private void settingsToolStripMenuItem_Click(object sender, EventArgs e) { settings set = new settings(); MainClass.showWindow(set, this); }
public override void btnView_Click(object sender, EventArgs e) { PurchaseInvoiceDetails pid = new PurchaseInvoiceDetails(); MainClass.showWindow(pid, this, MDI.ActiveForm); }
public override void editBtn_Click(object sender, EventArgs e) { edit = 1; MainClass.enable(leftPanel); }
public override void saveBtn_Click(object sender, EventArgs e) { //Here we enable and disable the red asterisc "*" in the form, validating that no txt left unfilled if (nameTxt.Text == "") { nameErrorLabel.Visible = true; } else { nameErrorLabel.Visible = false; } if (usernameTxt.Text == "") { usernameErrorLabel.Visible = true; } else { usernameErrorLabel.Visible = false; } if (passwordTxt.Text == "") { passwordErrorLabel.Visible = true; } else { passwordErrorLabel.Visible = false; } if (emailTxt.Text == "") { emailErrorLabel.Visible = true; } else { emailErrorLabel.Visible = false; } if (phoneTxt.Text == "") { phoneErrorLabel.Visible = true; } else { phoneErrorLabel.Visible = false; } if (statusDD.SelectedIndex == -1) { statusErrorLabel.Visible = true; } else { statusErrorLabel.Visible = false; } if (nameErrorLabel.Visible || usernameErrorLabel.Visible || passwordErrorLabel.Visible || emailErrorLabel.Visible || phoneErrorLabel.Visible || statusErrorLabel.Visible) { MainClass.ShowMSG("Fields with * are mandatory", "Stop", "Error"); //Error is the type of msg } else { if (statusDD.SelectedIndex == 0) { stat = 1; } else if (statusDD.SelectedIndex == 1) { stat = 0; } if (edit == 0) //Code for SAVE operation { insertion i = new insertion(); i.insertUser(nameTxt.Text, usernameTxt.Text, passwordTxt.Text, emailTxt.Text, phoneTxt.Text, stat); r.showUsers(dataGridView1, UserIDGV, NameGV, UserNameGV, PassGV, EmailGV, PhoneGV, StatusGV); MainClass.disable_reset(leftPanel); } else if (edit == 1) //Code for UPDATE operation { DialogResult dr = MessageBox.Show("Are you sure , you want to update record?", "Question...", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { updation u = new updation(); if (statusDD.SelectedIndex == 0) { stat = 1; } else if (statusDD.SelectedIndex == 1) { stat = 0; } u.updateUser(userID, nameTxt.Text, usernameTxt.Text, passwordTxt.Text, emailTxt.Text, phoneTxt.Text, stat); r.showUsers(dataGridView1, UserIDGV, NameGV, UserNameGV, PassGV, EmailGV, PhoneGV, StatusGV); MainClass.disable_reset(leftPanel); } } } }
public override void addBtn_Click(object sender, EventArgs e) { MainClass.enable_reset(leftPanel); //after we click "add" the register panel will be unlocked edit = 0; }
private void Users_Load(object sender, EventArgs e) { MainClass.disable(leftPanel); //we disable the elements from leftpanel with the method of MainClass //r.showUsers(dataGridView1, UserIDGV, NameGV, UserNameGV, PassGV, EmailGV, PhoneGV, StatusGV); //Load the Grid View }
public override void button2_Click(object sender, EventArgs e) { edit = 1; MainClass.enable(lftPanel); }
public override void button1_Click(object sender, EventArgs e) { MainClass.enable_reset(lftPanel); edit = 0; }
private void Products_Load(object sender, EventArgs e) { MainClass.disable_reset(lftPanel); r.getList("st_getCategoriesList", categoryDD, "Category", "ID"); groupBox1.Enabled = false; }