Exemple #1
0
 public void butLuu_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtID.Text.Trim() == "")
         {
         }
         if (txtStt.Text.Trim() == "")
         {
             txtStt.Text = m_v.get_stt_v_nhombhyt.ToString();
         }
         if (txtTen.Text.Trim() == "")
         {
             MessageBox.Show(this,
                             lan.Change_language_MessageText("Nhập tên nhóm viện phí BHYT!"), m_v.s_AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
             txtTen.Focus();
             return;
         }
         if (m_id == "")
         {
             m_id = m_v.get_id_v_nhombhyt.ToString();
         }
         else
         {
             try
             {
                 if (m_v.dadung_v_nhombhyt(m_id) == -1)
                 {
                     if (!m_v.is_dba_admin(m_userid))
                     {
                         MessageBox.Show(this,
                                         lan.Change_language_MessageText("Thông tin này chỉ xem, không cho phép cập nhật!") + "\n" +
                                         lan.Change_language_MessageText("Liên hệ vơi quản trị hệ thống để được trợ giúp."), m_v.s_AppName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                         return;
                     }
                 }
             }
             catch
             {
             }
         }
         if (m_v.f_get_v_nhombhyt("", "", txtTen.Text.Trim(), "", "").Tables[0].Select("id <> " + m_id).Length > 0)
         {
             MessageBox.Show(this,
                             lan.Change_language_MessageText("Tên nhóm đã tồn tại, chọn tên khác!"), m_v.s_AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
             txtTen.Focus();
             return;
         }
         m_v.upd_v_nhombhyt(decimal.Parse(m_id), decimal.Parse(txtStt.Text.Trim()), txtTen.Text, txtViettat.Text, chkReadonly.Checked?1:0);
         f_Enable(false);
         butMoi.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }