private void ucActions1_OnDelete(object obj) { //DMLoaiDichVuInfor khaibao = new DMLoaiDichVuInfor(); //khaibao.IdLoaiDichVu = Convert.ToInt32(getValue("clIdLoaiDichVu")); DMLoaiDichVuDataProvider.Delete(new DMLoaiDichVuInfor { IdLoaiDichVu = Convert.ToInt32(getValue("clIdLoaiDichVu")) }); MessageBox.Show("Xóa Thành Công", "Thông Báo"); dgvList.DataSource = DMLoaiDichVuDataProvider.GetListDichVuInfo(); }
private void ucActions1_OnAdd(object obj) { DMLoaiDichVuInfor dmLoaiDichVuInfor = new DMLoaiDichVuInfor(); dmLoaiDichVuInfor.MaLoaiDichVu = txtMaLoaiDichVu.Text; dmLoaiDichVuInfor.TenDichVu = txtTenLoaiDichVu.Text; dmLoaiDichVuInfor.GhiChu = txtGhiChu.Text; dmLoaiDichVuInfor.SuDung = Convert.ToInt32(cbSuDung.Checked); DMLoaiDichVuDataProvider.Insert(dmLoaiDichVuInfor); MessageBox.Show("Thêm bảng thành công!"); dgvList.DataSource = DMLoaiDichVuDataProvider.GetListDichVuInfo(); }
private void frmDM_LoaiDichVu_Load(object sender, EventArgs e) { try { dgvList.DataSource = DMLoaiDichVuDataProvider.GetListDichVuInfo(); } 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(); } }
protected override void LoadData() { grcBase.DataSource = DMLoaiDichVuDataProvider.GetListDichVuInfo(); btnTimKiem.Text = Resources.btnSearch; }