Example #1
0
 private void m_cmd_ok_Click(object sender, EventArgs e)
 {
     try
     {
         if (kiemtradulieu())
         {
             US_DM_HOC_PHAN v_us = new US_DM_HOC_PHAN();
             v_us.dcID_KHOA_VIEN = CIPConvert.ToDecimal(m_cbo_khoa_vien.SelectedValue.ToString());
             v_us.dcSO_TIN_CHI_HOC_PHAN = CIPConvert.ToDecimal(m_txt_so_tin_chi_hoc_phan.Text);
             v_us.dcSO_TIN_CHI_HOC_PHI = CIPConvert.ToDecimal(m_txt_so_tin_chi_hoc_phi.Text);
             v_us.strTEN_HOC_PHAN = m_txt_ten_hoc_phan.Text;
             v_us.strMA_HOC_PHAN = m_txt_ma_hoc_phan.Text;
             v_us.dcTRONG_SO = CIPConvert.ToDecimal(m_txt_trong_so.Text);
             v_us.dcTRANG_THAI_HSD = 7;
             v_us.Insert();
             MessageBox.Show("Thêm thành công!");
             this.Close();
         }
     }
     catch
     {
         MessageBox.Show("Đã xảy ra lỗi trong hệ thống!");
     }
 }
Example #2
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 #3
0
        private void m_cmd_xoa_Click(object sender, EventArgs e)
        {
            try
            {
                DataRow v_dr = m_grv_dm_hoc_phan.GetDataRow(m_grv_dm_hoc_phan.FocusedRowHandle);
                if (v_dr != null)
                {
                    US_DM_HOC_PHAN v_us = new US_DM_HOC_PHAN(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 phần " + v_us.strTEN_HOC_PHAN + " ?", "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 một dòng!");
                }
            }
            catch
            {
                MessageBox.Show("Đã xảy ra lỗi trong hệ thống!");
            }
        }
Example #4
0
 private void m_cmd_sua_Click(object sender, EventArgs e)
 {
     try
     {
         DataRow v_dr = m_grv_dm_hoc_phan.GetDataRow(m_grv_dm_hoc_phan.FocusedRowHandle);
         if (v_dr != null)
         {
             if (kiemtradulieu())
             {
                 US_DM_HOC_PHAN v_us = new US_DM_HOC_PHAN(CIPConvert.ToDecimal(v_dr["ID"].ToString()));
                 v_us.dcID_KHOA_VIEN = CIPConvert.ToDecimal(m_cbo_khoa_vien.SelectedValue.ToString());
                 v_us.dcSO_TIN_CHI_HOC_PHAN = CIPConvert.ToDecimal(m_txt_so_tin_chi_hoc_phan.Text);
                 v_us.dcSO_TIN_CHI_HOC_PHI = CIPConvert.ToDecimal(m_txt_so_tin_chi_hoc_phi.Text);
                 v_us.strTEN_HOC_PHAN = m_txt_ten_hoc_phan.Text;
                 v_us.dcTRONG_SO = CIPConvert.ToDecimal(m_txt_trong_so.Text);
                 v_us.strMA_HOC_PHAN = m_txt_ma_hoc_phan.Text;
                 v_us.Update();
                 MessageBox.Show("Cập nhật thành công!");
                 load_data_2_grid();
             }
         }
         else
         {
             MessageBox.Show("Hãy chọn một dòng!");
         }
     }
     catch
     {
         MessageBox.Show("Đã xảy ra lỗi trong hệ thống!");
     }
 }