Ejemplo n.º 1
0
 private void btnOkSua_Click(object sender, EventArgs e)
 {
     if ((txtMaTG.Text != "") && (txtTenTG.Text != ""))
     {
         try
         {
             TacGia_DTO tacGia = new TacGia_DTO(txtMaTG.Text, txtTenTG.Text, rtbThongTinTG.Text);
             BUS_OBJ.suaTG(tacGia);
             HienThiDuLieu();
         }
         catch (Exception ex)
         {
             MetroFramework.MetroMessageBox.Show(this, ex.Message);
         }
         finally
         {
             btnCancel_Click(sender, e);
             //if (conn.State == ConnectionState.Open) conn.Close();
         }
     }
     else
     {
         MetroFramework.MetroMessageBox.Show(this, "Nhập thiếu dữ liệu.", "Lỗi.", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         if (txtMaTG.Text == "")
         {
             txtMaTG.Focus();
         }
         if (txtTenTG.Text == "")
         {
             txtTenTG.Focus();
         }
     }
 }