Example #1
0
 private void DoRowClick(GridView view, Point pt)
 {
     GridHitInfo info = view.CalcHitInfo(pt);
     if (info.InRow || info.InRowCell)
     {
         DataRow v_dr = m_grv_diem_thi.GetDataRow(m_grv_diem_thi.FocusedRowHandle);
         if (v_dr != null)
         {
             US_DM_SINH_VIEN v_us_sinh_vien = new US_DM_SINH_VIEN(CIPConvert.ToDecimal(v_dr["ID_SINH_VIEN"].ToString()));
             load_data_2_thong_tin_sinh_vien(v_us_sinh_vien);
             US_DM_LOP_HOC v_us_lop_hoc = new US_DM_LOP_HOC(CIPConvert.ToDecimal(v_dr["ID_LOP_HOC"].ToString()));
             load_data_2_thong_tin_lop_hoc(v_us_lop_hoc);
             m_txt_diem_qua_trinh.Text = v_dr["DIEM_QUA_TRINH"].ToString();
             m_txt_diem_thi.Text = v_dr["DIEM_THI"].ToString();
         }
     }
 }
Example #2
0
        private void m_cmd_OK_Click(object sender, EventArgs e)
        {
            try
            {
                if (check_du_lieu_truoc_luu())
                {
                    US_DM_LOP_HOC v_us = new US_DM_LOP_HOC();
                    v_us.strMA_LOP_HOC = m_txt_ma_lop_hoc.Text;
                    v_us.dcID_HOC_KY =(decimal) m_cbo_hoc_ky.SelectedValue;
                    v_us.dcID_HOC_PHAN = (decimal)m_cbo_hoc_phan.SelectedValue;
                    v_us.dcID_GIANG_VIEN = (decimal)m_cbo_giang_vien.SelectedValue;
                    v_us.dcTRANG_THAI_HSD = 7;
                    v_us.Insert();
                    this.Close();
                    MessageBox.Show("Đã thêm thành công lớp học: " + m_txt_ma_lop_hoc.Text);
                }

            }
            catch
            {
                MessageBox.Show("Đã xảy ra lỗi trong hệ thống!");
            }
        }
Example #3
0
 private void m_cbo_ma_lop_hoc_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (CIPConvert.ToDecimal(m_cbo_ma_lop_hoc.SelectedValue.ToString()) > -1)
         {
             US_DM_LOP_HOC v_us_lop_hoc = new US_DM_LOP_HOC(CIPConvert.ToDecimal(m_cbo_ma_lop_hoc.SelectedValue.ToString()));
             load_data_2_thong_tin_lop_hoc(v_us_lop_hoc);
         }
         else
         {
             m_txt_ma_hoc_phan.Text = "";
             m_txt_so_tin_chi_hoc_phan.Text = "";
             m_txt_trong_so.Text = "";
         }
         load_data_2_grid();
     }
     catch
     {
         MessageBox.Show("Đã xảy ra lỗi trong hệ thống!");
     }
 }
Example #4
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 #5
0
        private void m_cmd_xoa_Click(object sender, EventArgs e)
        {
            try
            {
                DataRow v_dr = m_grv_dm_lop_hoc.GetDataRow(m_grv_dm_lop_hoc.FocusedRowHandle);
                if (v_dr != null)
                {
                    US_DM_LOP_HOC v_us = new US_DM_LOP_HOC(CIPConvert.ToDecimal(v_dr["ID"].ToString()));

                    DialogResult result = new DialogResult();
                    result = MessageBox.Show("Bạn có chắc chắc muốn xóa lớp học ? \n" + v_us.strMA_LOP_HOC, "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 lớp học cần xóa!");
                }
            }
            catch
            {
                MessageBox.Show("Đã xảy ra lỗi hệ thống!");
            }
        }
Example #6
0
 private void m_cmd_sua_Click(object sender, EventArgs e)
 {
     try
     {
         DataRow v_dr = m_grv_dm_lop_hoc.GetDataRow(m_grv_dm_lop_hoc.FocusedRowHandle);
         if( v_dr == null)
         {
             MessageBox.Show("Chọn 1 dòng!");
         }
         else
         {
             if (check_du_lieu_truoc_khi_luu(v_dr))
             {
                 US_DM_LOP_HOC v_us = new US_DM_LOP_HOC((decimal)v_dr["ID"]);
                 v_us.strMA_LOP_HOC = m_txt_ma_lop_hoc.Text;
                 v_us.dcID_GIANG_VIEN = (decimal)m_cbo_giang_vien.SelectedValue;
                 v_us.dcID_HOC_PHAN = (decimal)m_cbo_hoc_phan.SelectedValue;
                 v_us.dcID_HOC_KY = (decimal)m_cbo_hoc_ky.SelectedValue;
                 v_us.Update();
                 MessageBox.Show("Cập nhật thành công");
                 load_data_2_grid();
             }
         }
     }
     catch
     {
         MessageBox.Show("Đã xảy ra lỗi trong hệ thống");
     }
 }