Beispiel #1
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (checkText() == true)
     {
         if (check_flag == true)
         {
             dtoPHONGBENH = new DTO_PhongBenh(txtMaphong.Text, txtVitri.Text);
             if (busPHONGBENH.Add(dtoPHONGBENH) == true)
             {
                 XtraMessageBox.Show("Thêm phòng bệnh " + txtMaphong.Text + " thành công!");
                 if (addPhong != null)
                 {
                     addPhong(this, new EventArgs());
                 }
             }
             else
             {
                 XtraMessageBox.Show("Thêm phòng bệnh không thành công!!!");
             }
         }
         else
         {
             if (checkText() == true)
             {
                 dtoPHONGBENH = new DTO_PhongBenh(txtMaphong.Text, txtVitri.Text);
                 if (busPHONGBENH.Update(dtoPHONGBENH) == true)
                 {
                     XtraMessageBox.Show("Sửa phòng bệnh " + txtMaphong.Text + " thành công!");
                     if (updatePhong != null)
                     {
                         updatePhong(this, new EventArgs());
                     }
                 }
                 else
                 {
                     XtraMessageBox.Show("Sửa phòng bệnh không thành công!!!");
                 }
             }
             else
             {
                 XtraMessageBox.Show("Chọn dòng cần sửa!");
             }
         }
         refreshAll();
         LockControls();
         HienThi();
     }
     else
     {
         XtraMessageBox.Show("Chưa nhập đủ dữ liệu!");
     }
 }