public override void deletebtn_Click(object sender, EventArgs e) { if (delStatus == 1) { DialogResult dr = MessageBox.Show("Want to delete this record?", "Question.", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { Deletion.deleteData("st_deleteUsers", "@userID", userID); MainClass.resetDisable(leftpanel); RetrivalData.getUsers(dataGridView1, userIDGV, NameGV, usernameGV, passGV, phoneGV, addressGV, RoleIDGV, RoleGV); } } }
public override void savebtn_Click(object sender, EventArgs e) { if (MainClass.checkControls(leftpanel).Count == 0) { if (edit == 0)//save { insertion.insertUsers(userTxt.Text, usernameTxt.Text, passwordTxt.Text, addressTxt.Text, phoneTxt.Text, Convert.ToInt16(rolesDD.SelectedValue.ToString())); MainClass.resetDisable(leftpanel); RetrivalData.getUsers(dataGridView1, userIDGV, NameGV, usernameGV, passGV, phoneGV, addressGV, RoleIDGV, RoleGV); } else if (edit == 1)//update { Updates.updateUsers(userID, userTxt.Text, usernameTxt.Text, passwordTxt.Text, addressTxt.Text, phoneTxt.Text, Convert.ToInt16(rolesDD.SelectedValue.ToString())); MainClass.resetDisable(leftpanel); RetrivalData.getUsers(dataGridView1, userIDGV, NameGV, usernameGV, passGV, phoneGV, addressGV, RoleIDGV, RoleGV); } } else { MessageBox.Show("Please enter all required fiels"); } }
public override void viewbtn_Click(object sender, EventArgs e) { RetrivalData.getUsers(dataGridView1, userIDGV, NameGV, usernameGV, passGV, phoneGV, addressGV, RoleIDGV, RoleGV); }