示例#1
0
 private void btAddXN_Click(object sender, EventArgs e)
 {
     try
     {
         String        ten           = tbLoaiXN.Text.Trim();
         String        note          = tbNote.Text.Trim();
         int           thoiHan       = int.Parse(tbThoiHan.Text.Trim());
         LoaiXetNghiem loaiXetNghiem = new LoaiXetNghiem()
         {
             TenXN = ten, ThoiHan = thoiHan, Note = note
         };
         bool result = new LoaiXetNghiemBUL().ThemLoaiXN(loaiXetNghiem);
         if (result)
         {
             Reload();
         }
         else
         {
             MessageBox.Show("Thêm thất bại");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Lỗi thông tin");
     }
 }
示例#2
0
 private void btUpdateXN_Click(object sender, EventArgs e)
 {
     try
     {
         String        ten           = tbLoaiXN.Text.Trim();
         int           thoiHan       = int.Parse(tbThoiHan.Text.Trim());
         String        note          = tbNote.Text.Trim();
         LoaiXetNghiem loaiXetNghiem = new LoaiXetNghiem()
         {
             TenXN = ten, ThoiHan = thoiHan, Note = note
         };
         bool result = new LoaiXetNghiemBUL().UpdateLoaiXN(IDLoaiXN, loaiXetNghiem);
         if (result)
         {
             Reload();
         }
         else
         {
             MessageBox.Show("Cập nhật thông tin thất bại");
         }
     }
     catch
     {
         MessageBox.Show("Cập nhật thông tin thất bại");
     }
 }
示例#3
0
        public void Reload()
        {
            List <LoaiXetNghiem> loaiXetNghiems = new LoaiXetNghiemBUL().GetDanhMucXN();

            dataGridView1.DataSource            = loaiXetNghiems;
            dataGridView1.Columns[1].HeaderText = "Tên xét nghiệm";
            dataGridView1.Columns[2].HeaderText = "Thời hạn (ngày)";
            dataGridView1.Columns[3].HeaderText = "Ghi chú";
            dataGridView1.Columns[0].Visible    = false;
        }