Exemple #1
0
 private void btnNguyCoGia_Click(object sender, EventArgs e)
 {
     try
     { if (btnNguyCoGia.Text.Trim().Equals("Nguy cơ giả"))
       {
           if (XtraMessageBox.Show("Bạn có chắc chắn phát hiện bệnh nhân này là trường hợp nguy cơ giả không?", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
           {
               var res = BioNet_Bus.BenhNhanNguyCoGia(long.Parse(this.txtRowIDBenhNhanNguyCo.Text.Trim()));
               if (res.Result)
               {
                   XtraMessageBox.Show("Cập nhật thành công", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Information);
                   this.LoadDanhSachCho();
                   this.loadDanhSachBNNguyCoGia();
                   this.GCChiTietKetQua.DataSource = null;
                   this.GCChiTietKQCu.DataSource   = null;
                   this.Reset();
                   this.btnMoi.Enabled       = false;
                   this.btnNguyCoGia.Enabled = false;
               }
               else
               {
                   MessageBox.Show("Lỗi khi loại bệnh nhân ra khỏi danh sách cần theo dõi! \r\n Lỗi chi tiết : " + res.StringError.ToString(), "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
               }
           }
       }
       else
       {
           if (XtraMessageBox.Show("Bạn có chắc chắn bệnh nhân này là nguy cơ cao không?", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
           {
               var res = BioNet_Bus.BenhNhanNguyCoCao(long.Parse(this.txtRowIDBenhNhanNguyCo.Text.Trim()));
               if (res.Result)
               {
                   XtraMessageBox.Show("Cập nhật thành công", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Information);
                   this.LoadDanhSachCho();
                   this.loadDanhSachBNNguyCoGia();
                   this.GCChiTietKetQua.DataSource = null;
                   this.GCChiTietKQCu.DataSource   = null;
                   this.Reset();
                   this.btnMoi.Enabled       = false;
                   this.btnNguyCoGia.Enabled = false;
               }
               else
               {
                   MessageBox.Show("Lỗi khi đưa bệnh nhân vào danh sách cần theo dõi! \r\n Lỗi chi tiết : " + res.StringError.ToString(), "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
               }
           }
       } }
     catch (Exception ex)
     {
         MessageBox.Show("Lỗi khi loại bệnh nhân ra khỏi danh sách cần theo dõi! \r\n Lỗi chi tiết : " + ex.ToString(), "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }