private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         using (quanLyCongViecEntities = new QuanLyCongViecEntities())
         {
             quanLyCongViecEntities.DeleteGDVanBanDen(IdEdit);
             XtraMessageBox.Show("Xóa thông tin thành công");
         }
         GetAllNull();
     }
     catch (Exception)
     {
         XtraMessageBox.Show("Thông tin không có trong cơ sở dữ liệu");
     }
 }
Exemple #2
0
        private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Guid guid = (Guid)grvTienDoCongViec.GetFocusedRowCellValue("Id");

            try
            {
                using (quanLyCongViecEntities = new QuanLyCongViecEntities())
                {
                    quanLyCongViecEntities.DeleteGDVanBanDen(guid);
                    XtraMessageBox.Show("Xóa thông tin thành công");
                }
                GetAllGDVanBanDen();
            }
            catch (Exception)
            {
                XtraMessageBox.Show("Vui lòng xóa ở bảng dưới trước khi xóa ở đây");
            }
        }