private void DeleteButton_Click(object sender, EventArgs e) { List <int> studentIds = (from DataGridViewRow r in StudentDataGridView.Rows where Convert.ToBoolean(r.Cells[1].Value) == true select Convert.ToInt32(r.Cells[0].Value)).ToList(); ConfirmForm confirmForm = new ConfirmForm("Đồng ý xóa ?"); confirmForm.ShowDialog(); if (confirmForm.Result == DialogResult.Yes) { try { int result = managingStudentService.DeleteManyStudent(studentIds); if (result > 0) { //MessageBox.Show("Xóa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); NotificationForm notificationForm = new NotificationForm("Xóa thành công", "Thông báo", MessageBoxIcon.Information); notificationForm.ShowDialog(); LoadStudentList(); } else { //MessageBox.Show("Xóa không thành công", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); NotificationForm notificationForm = new NotificationForm("Xóa không thành công", "Cảnh báo", MessageBoxIcon.Warning); notificationForm.ShowDialog(); } } catch (Exception ex) { //MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); NotificationForm notificationForm = new NotificationForm(Common.Common.COMMON_ERORR, "Lỗi", MessageBoxIcon.Error); notificationForm.ShowDialog(); } } }
private void LockButton_Click(object sender, EventArgs e) { try { List <int> accountIds = (from DataGridViewRow r in AccountDataGridView.Rows where Convert.ToBoolean(r.Cells[1].Value) == true select Convert.ToInt32(r.Cells[0].Value)).ToList(); if (accountIds.Count == 0) { //MessageBox.Show("Chưa chọn tài khoản nào", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); NotificationForm notificationForm = new NotificationForm("Chưa chọn tài khoản nào", "Cảnh báo", MessageBoxIcon.Warning); notificationForm.ShowDialog(); return; } int result = accountService.LockManyAccount(accountIds); ConfirmForm confirmForm = new ConfirmForm("Đồng ý xóa ?"); confirmForm.ShowDialog(); if (confirmForm.Result == DialogResult.Yes) { try { if (accountIds.Count > 0) { //MessageBox.Show("Khóa tài khoản thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); NotificationForm notificationForm = new NotificationForm("Khóa tài khoản thành công", "Thông báo", MessageBoxIcon.Information); notificationForm.ShowDialog(); } else { //MessageBox.Show("Khóa tài khoản không thành công", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); NotificationForm notificationForm = new NotificationForm("Khóa tài khoản không thành công", "Thông báo", MessageBoxIcon.Warning); notificationForm.ShowDialog(); } } catch (Exception ex) { NotificationForm notificationForm = new NotificationForm(Common.Common.COMMON_ERORR, "Lỗi", MessageBoxIcon.Warning); notificationForm.ShowDialog(); } } LoadAccountList(); } catch (Exception ex) { //MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); NotificationForm notificationForm = new NotificationForm(Common.Common.COMMON_ERORR, "Lỗi", MessageBoxIcon.Error); notificationForm.ShowDialog(); } }
private void DeleteButton_Click(object sender, EventArgs e) { try { List <int> roleIds = (from RoleModel r in RoleCheckedListBox.CheckedItems select r.Id).ToList(); if (roleIds.Count == 0) { NotificationForm notification = new NotificationForm("Vui lòng chọn 1 hoặc nhiều vai trò để xóa", "Cảnh báo", MessageBoxIcon.Warning); notification.ShowDialog(); return; } ConfirmForm confirmForm = new ConfirmForm("Xóa vai trò có thể ảnh hưởng đến quyền truy cập các tài khoản ,Bạn có đồng ý xóa"); confirmForm.ShowDialog(); if (confirmForm.Result == DialogResult.Yes) { if (roleIds.Count > 0) { int result = accountService.DeleteManyRole(roleIds); if (result > 0) { //MessageBox.Show("Xóa quyền thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); NotificationForm notificationForm = new NotificationForm("Xóa vai trò thành công", "Thông báo", MessageBoxIcon.Information); notificationForm.ShowDialog(); } else { //MessageBox.Show("Xóa quyền không thành công", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); NotificationForm notificationForm = new NotificationForm("Xóa vai trò không thành công", "Cảnh báo", MessageBoxIcon.Warning); notificationForm.ShowDialog(); } LoadRoleList(); } else { //MessageBox.Show("Chưa chọn quyền nào", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); NotificationForm notificationForm = new NotificationForm("Chưa chọn vai trò nào", "Cảnh báo", MessageBoxIcon.Warning); notificationForm.ShowDialog(); } } } catch (Exception ex) { //MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); NotificationForm notificationForm = new NotificationForm(Common.Common.COMMON_ERORR, "Lỗi", MessageBoxIcon.Error); notificationForm.ShowDialog(); } }
private void DeleteButton_Click(object sender, EventArgs e) { try { ConfirmForm confirmForm = new ConfirmForm("Bạn có chắc chắn xóa?"); confirmForm.ShowDialog(); if (confirmForm.Result == DialogResult.Yes) { List <int> villageIds = (from DataGridViewRow r in VillageDataGridView.Rows where Convert.ToBoolean(r.Cells[1].Value) == true select Convert.ToInt32(r.Cells[0].Value)).ToList(); if (villageIds.Count == 0) { //MessageBox.Show("Chưa chọn tài khoản nào", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); NotificationForm notificationForm = new NotificationForm("Chưa chọn xã nào", "Cảnh báo", MessageBoxIcon.Warning); notificationForm.ShowDialog(); return; } int result = managingAdministrativeBoundariesService.DeleteManyVillage(villageIds); if (villageIds.Count > 0) { //MessageBox.Show("Xóa tài khoản thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); NotificationForm notificationForm = new NotificationForm("Xóa xã thành công", "Thông báo", MessageBoxIcon.Information); notificationForm.ShowDialog(); } else { //MessageBox.Show("Xóa tài khoản không thành công", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); NotificationForm notificationForm = new NotificationForm("Xóa xã không thành công", "Cảnh báo", MessageBoxIcon.Warning); notificationForm.ShowDialog(); } } LoadSearchedVillage(); } catch (Exception ex) { //MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); NotificationForm notificationForm = new NotificationForm(Common.Common.COMMON_ERORR, "Lỗi", MessageBoxIcon.Error); notificationForm.ShowDialog(); } }
private void DeleteButton_Click(object sender, EventArgs e) { try { List <int> copiedCertIds = (from DataGridViewRow r in CopiedCertDataGridView.Rows where Convert.ToBoolean(r.Cells[1]) == true select Convert.ToInt32(r.Cells[0])).ToList(); ConfirmForm confirmForm = new ConfirmForm("Đồng ý xóa ?"); confirmForm.ShowDialog(); if (confirmForm.Result == DialogResult.Yes) { } } catch (Exception ex) { NotificationForm notificationForm = new NotificationForm(Common.Common.COMMON_ERORR, "Lỗi", MessageBoxIcon.Error); notificationForm.ShowDialog(); } }