private void button2_Click(object sender, EventArgs e) { if (MessageBox.Show("هل انت متأكد من حذف المستخدم؟", "حذف المستخدم", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { Business_Layer.CLS_LOGIN login = new Business_Layer.CLS_LOGIN(); login.DELETE_USER(dgvUsers.CurrentRow.Cells[0].Value.ToString()); MessageBox.Show("تم الحذف بنجاح"); this.dgvUsers.DataSource = login.SEARCH_USERS(""); } }
public Users_Manage_Form() { Business_Layer.CLS_LOGIN login = new Business_Layer.CLS_LOGIN(); InitializeComponent(); da = new SqlDataAdapter("SELECT USERNAME AS 'Username',PASSWORD AS 'Password' from Users", sqlcon); da.Fill(dt); metroGrid1.DataSource = dt; bmb = this.BindingContext[dt]; }
private void btnSaveU_Click(object sender, EventArgs e) { if (tUserName.Text != string.Empty || tFullName.Text != string.Empty || tPass.Text != string.Empty || tCPass.Text != string.Empty) { if (tPass.Text == tCPass.Text) { if (btnSaveU.Text == "حفظ") { Business_Layer.CLS_LOGIN user = new Business_Layer.CLS_LOGIN(); user.ADD_USER(tUserName.Text, tPass.Text, tFullName.Text, comboType.Text); MessageBox.Show("تم حفظ المستخدم", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (btnSaveU.Text == "تأكيد التعديل") { Business_Layer.CLS_LOGIN user = new Business_Layer.CLS_LOGIN(); user.EDIT_USER(tUserName.Text, tPass.Text, tFullName.Text, comboType.Text); MessageBox.Show("تم تعديل المستخدم", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("تأكد من تطابق كلمتي المرور", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("تأكد من ملئ جميع البيانات", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } tUserName.Clear(); tCPass.Clear(); tFullName.Clear(); tPass.Clear(); tUserName.Focus(); }
private void btnSave_Click(object sender, EventArgs e) { if (txtboxUsername.Text == string.Empty || txtboxPassword.Text == string.Empty || txtboxConfirmPass.Text == string.Empty) { MessageBox.Show("Please Check Your Data", "Add Operation", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (txtboxPassword.Text != txtboxConfirmPass.Text) { MessageBox.Show("Password Not Match", "Add Operation", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Business_Layer.CLS_LOGIN user = new Business_Layer.CLS_LOGIN(); user.addNewUser(txtboxUsername.Text, txtboxPassword.Text); MessageBox.Show("User Added Successfully", "Add Operation", MessageBoxButtons.OK, MessageBoxIcon.Information); txtboxUsername.Clear(); txtboxPassword.Clear(); txtboxConfirmPass.Clear(); txtboxUsername.Focus(); }