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();
        }
Esempio n. 2
0
 private void Save()
 {
     if (Check())
     {
         if (frm.isAdd)
         {
             DMLoaiDichVuDataProvider.Insert(SetLoaiDichVuInfo());
             Reset();
         }
         else
         {
             DMLoaiDichVuInfor dm = SetLoaiDichVuInfo();
             dm.IdLoaiDichVu = frm.Oid;
             DMLoaiDichVuDataProvider.Update(dm);
         }
     }
 }