private void ucActions1_OnDelete(object obj) { //DeleteItem(); DMNhomNguoiDungInfor khaibao = new DMNhomNguoiDungInfor(); khaibao.MaNhom = Convert.ToString(getValue("clMa")); DMNhomNguoiDungDataProvider.Delete(khaibao); MessageBox.Show("Xóa Thành Công", "Thông Báo"); dgvList.DataSource = DMNhomNguoiDungDataProvider.GetListNhomInfo(); }
private void frmDM_NhomNguoiDung_Load(object sender, EventArgs e) { try { dgvList.DataSource = DMNhomNguoiDungDataProvider.GetListNhomInfo(); } catch (Exception ex) { #if DEBUG MessageBox.Show("Lỗi ngoại lệ: " + ex.ToString(), Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MessageBox.Show("Lỗi ngoại lệ: " + ex.Message, Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error); #endif this.Dispose(); } }
private void ucActions1_OnValidate(object obj, ActionState actionMode) { switch (actionMode) { case ActionState.ADD: case ActionState.UPDATE: if (txtMa.Text == String.Empty) { throw new Exception("Mã Nhóm không Được Để Trống!"); } if (DMNhomNguoiDungDataProvider.Kiemtra(Exist)) { throw new Exception("Mã Nhóm Đã Tồn Tại!"); } break; } }
private void ucActions1_OnAdd(object obj) { DMNhomNguoiDungDataProvider.Insert(getinfor()); MessageBox.Show("Thêm bảng thành công!"); dgvList.DataSource = DMNhomNguoiDungDataProvider.GetListNhomInfo(); }
private void ucActions1_OnUpdate(object obj) { DMNhomNguoiDungDataProvider.Update(getinfor()); MessageBox.Show("Sửa bảng thành công!"); dgvList.DataSource = DMNhomNguoiDungDataProvider.GetListNhomInfo(); }
protected override void OnLoad() { ListInitInfo = DMNhomNguoiDungDataProvider.GetListNhomInfo(); }