Example #1
0
 private void m_cmd_sua_Click(object sender, EventArgs e)
 {
     try
     {
         DataRow v_dr = m_grv_dm_hoc_ky.GetDataRow(m_grv_dm_hoc_ky.FocusedRowHandle);
         if (v_dr == null)
         {
             MessageBox.Show("Hãy chọn 1 dòng dữ liệu!");
         }
         else
         {
             if (check_du_lieu_truoc_luu())
             {
                 US_DM_HOC_KY v_us = new US_DM_HOC_KY((decimal)v_dr["ID"]);
                 v_us.strMA_HOC_KY       = m_txt_ma_hoc_ky.Text;
                 v_us.dcNAM_HOC_BAT_DAU  = CIPConvert.ToDecimal(m_txt_nam_bat_dau.Text);
                 v_us.dcNAM_HOC_KET_THUC = CIPConvert.ToDecimal(m_txt_nam_ket_thuc.Text);
                 v_us.Update();
                 MessageBox.Show("Cập nhật thành công học kỳ:" + m_txt_ma_hoc_ky.Text);
                 load_data_2_grid();
             }
         }
     }
     catch
     {
         MessageBox.Show("Đã xảy ra lỗi trong quá trình xử lý!");
     }
 }
Example #2
0
 private void m_cmd_xoa_Click(object sender, EventArgs e)
 {
     try
     {
         DataRow v_dr = m_grv_dm_hoc_ky.GetDataRow(m_grv_dm_hoc_ky.FocusedRowHandle);
         if (v_dr != null)
         {
             US_DM_HOC_KY v_us   = new US_DM_HOC_KY(CIPConvert.ToDecimal(v_dr["ID"].ToString()));
             DialogResult result = new DialogResult();
             result = MessageBox.Show("Bạn có chắc chắc muốn xóa học kỳ ?" + v_us.strMA_HOC_KY, "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
             if (result == DialogResult.Yes)
             {
                 v_us.dcTRANG_THAI_HSD = 10;
                 v_us.Update();
                 MessageBox.Show("Bạn vừa xóa thành công!");
                 load_data_2_grid();
             }
         }
         else
         {
             MessageBox.Show("Hãy chọn học kỳ cần xóa!");
         }
     }
     catch
     {
         MessageBox.Show("Đã xảy ra lỗi trong hệ thống!");
     }
 }
Example #3
0
        private void load_data_2_thong_tin_lop_hoc(US_DM_LOP_HOC v_us_lop_hoc)
        {
            US_DM_HOC_KY   v_us_hoc_ky   = new US_DM_HOC_KY(CIPConvert.ToDecimal(v_us_lop_hoc.dcID_HOC_KY));
            US_DM_HOC_PHAN v_us_hoc_phan = new US_DM_HOC_PHAN(CIPConvert.ToDecimal(v_us_lop_hoc.dcID_HOC_PHAN));

            m_cbo_ma_lop_hoc.SelectedValue = v_us_lop_hoc.dcID;
            m_txt_ma_hoc_phan.Text         = v_us_hoc_phan.strMA_HOC_PHAN.ToString();
            m_txt_trong_so.Text            = v_us_hoc_phan.dcTRONG_SO.ToString();
            m_txt_so_tin_chi_hoc_phan.Text = v_us_hoc_phan.dcSO_TIN_CHI_HOC_PHAN.ToString();
        }
Example #4
0
 private void m_cmd_ok_Click(object sender, EventArgs e)
 {
     try
     {
         if (check_du_lieu_truoc_luu())
         {
             US_DM_HOC_KY v_us = new US_DM_HOC_KY();
             v_us.dcTRANG_THAI_HSD   = 7;
             v_us.dcNAM_HOC_BAT_DAU  = CIPConvert.ToDecimal(m_txt_nam_bat_dau.Text);
             v_us.dcNAM_HOC_KET_THUC = CIPConvert.ToDecimal(m_txt_nam_ket_thuc.Text);
             v_us.strMA_HOC_KY       = m_txt_ma_hoc_ky.Text;
             v_us.Insert();
             this.Close();
             MessageBox.Show("Thêm thành công học kỳ:" + m_txt_ma_hoc_ky.Text);
         }
     }
     catch
     {
         MessageBox.Show("Đã xảy ra lỗi hệ thống!");
     }
 }