private void btnDelete_Click(object sender, EventArgs e) { DialogResult s = RadMessageBox.Show("Are you sure you want to delete " + rddStaff.SelectedText + "?", "Confirmation", MessageBoxButtons.YesNo); if (s == System.Windows.Forms.DialogResult.Yes) { using (fingermachDataSetTableAdapters.staffTableAdapter tbl = new fingermachDataSetTableAdapters.staffTableAdapter()) { tbl.DeleteUser(int.Parse(rddStaff.SelectedValue.ToString())); } RadMessageBox.Show("User has been deleted"); btnChange.Tag = "start"; btnChange.Text = "&Change Permission"; radGridView1.AllowEditRow = false; radGridView2.AllowEditRow = false; radGridView1.ReadOnly = true; radGridView2.ReadOnly = true; rddStaff.Enabled = true; grpPermission.Enabled = false; grpReset.Enabled = false; grpIndividual.Enabled = false; } this.staffTableAdapter.Fill(this.fingermachDataSet.staff); }
private void btnChange_Click(object sender, EventArgs e) { if (NBConfig.ValidUserID != -1 && (!string.IsNullOrEmpty(txtPwd.Text))) { DialogResult res = RadMessageBox.Show("Yakin akan mengubah password anda?", "SMS - Verification", MessageBoxButtons.YesNo, RadMessageIcon.Question); if (res == System.Windows.Forms.DialogResult.Yes) { using (fingermachDataSetTableAdapters.staffTableAdapter tbl = new fingermachDataSetTableAdapters.staffTableAdapter()) { tbl.UpdatePassword(txtPwd.Text, NBConfig.ValidUserID); } helper.NotifMessage("Password has been changed successfully"); txtPwd.ResetText(); } else { //do nothing } } }
private void btnReset_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtReset.Text)) { DialogResult res = RadMessageBox.Show("Yakin akan mengubah password user yg terpilih?", "SMS - Verification", MessageBoxButtons.YesNo, RadMessageIcon.Question); if (res == System.Windows.Forms.DialogResult.Yes) { using (fingermachDataSetTableAdapters.staffTableAdapter tbl = new fingermachDataSetTableAdapters.staffTableAdapter()) { tbl.UpdatePassword(txtReset.Text, int.Parse(rddStaff.SelectedValue.ToString())); } RadMessageBox.Show("Password has been changed successfully"); txtReset.ResetText(); } else { //do nothing } } else { RadMessageBox.Show("New password is empty! Password has not been changed"); } }