public DataTable Get(KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo)
        {
            ArrayList colParam = new ArrayList();

            colParam.Add(CreateParam("@KQHT_ChoNhapLaiDiem_SinhVienID", SqlDbType.Int, pKQHT_ChoNhapLaiDiem_SinhVienInfo.KQHT_ChoNhapLaiDiem_SinhVienID));

            return(RunProcedureGet("sp_KQHT_ChoNhapLaiDiem_SinhVien_Get", colParam));
        }
        public void Delete(KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo)
        {
            ArrayList colParam = new ArrayList();

            colParam.Add(CreateParam("@KQHT_ChoNhapLaiDiem_SinhVienID", SqlDbType.Int, pKQHT_ChoNhapLaiDiem_SinhVienInfo.KQHT_ChoNhapLaiDiem_SinhVienID));

            RunProcedure("sp_KQHT_ChoNhapLaiDiem_SinhVien_Delete", colParam);
        }
        public int Add(KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo)
        {
            int ID = 0;

            ID            = oDKQHT_ChoNhapLaiDiem_SinhVien.Add(pKQHT_ChoNhapLaiDiem_SinhVienInfo);
            mErrorMessage = oDKQHT_ChoNhapLaiDiem_SinhVien.ErrorMessages;
            mErrorNumber  = oDKQHT_ChoNhapLaiDiem_SinhVien.ErrorNumber;
            return(ID);
        }
        public int Add(KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo)
        {
            ArrayList colParam = new ArrayList();

            colParam.Add(CreateParam("@IDKQHT_ChoNhapLaiDiem", SqlDbType.Int, pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDKQHT_ChoNhapLaiDiem));
            colParam.Add(CreateParam("@IDSV_SinhVien", SqlDbType.Int, pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDSV_SinhVien));
            colParam.Add(CreateParamOut("@ID", SqlDbType.Int));

            return((int)RunProcedureOut("sp_KQHT_ChoNhapLaiDiem_SinhVien_Add", colParam));
        }
        public List <KQHT_ChoNhapLaiDiem_SinhVienInfo> GetList(KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo)
        {
            List <KQHT_ChoNhapLaiDiem_SinhVienInfo> oKQHT_ChoNhapLaiDiem_SinhVienInfoList = new List <KQHT_ChoNhapLaiDiem_SinhVienInfo>();
            DataTable dtb = Get(pKQHT_ChoNhapLaiDiem_SinhVienInfo);

            if (dtb != null)
            {
                for (int i = 0; i < dtb.Rows.Count; i++)
                {
                    pKQHT_ChoNhapLaiDiem_SinhVienInfo = new KQHT_ChoNhapLaiDiem_SinhVienInfo();

                    pKQHT_ChoNhapLaiDiem_SinhVienInfo.KQHT_ChoNhapLaiDiem_SinhVienID = int.Parse(dtb.Rows[i][pKQHT_ChoNhapLaiDiem_SinhVienInfo.strKQHT_ChoNhapLaiDiem_SinhVienID].ToString());
                    pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDKQHT_ChoNhapLaiDiem          = int.Parse(dtb.Rows[i][pKQHT_ChoNhapLaiDiem_SinhVienInfo.strIDKQHT_ChoNhapLaiDiem].ToString());
                    pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDSV_SinhVien = int.Parse(dtb.Rows[i][pKQHT_ChoNhapLaiDiem_SinhVienInfo.strIDSV_SinhVien].ToString());

                    oKQHT_ChoNhapLaiDiem_SinhVienInfoList.Add(pKQHT_ChoNhapLaiDiem_SinhVienInfo);
                }
            }
            return(oKQHT_ChoNhapLaiDiem_SinhVienInfoList);
        }
Esempio n. 6
0
        private void btnDongY_Click(object sender, EventArgs e)
        {
            if (chkDiemThanhPhan.Checked || chkThiLan1.Checked || chkDiemThanhPhanL2.Checked || chkThiLan2.Checked)
            {
                DataRow[] arrDr = dtDanhSach.Select("Chon = 1");
                if (arrDr.Length > 0)
                {
                    cBKQHT_DaChuyenDiem   oBKQHT_DaChuyenDiem    = new cBKQHT_DaChuyenDiem();
                    KQHT_DaChuyenDiemInfo pKQHT_DaChuyenDiemInfo = new KQHT_DaChuyenDiemInfo();

                    pKQHT_DaChuyenDiemInfo.IDXL_MonHocTrongKy = IDXL_MonHocTrongKy;

                    if (chkDiemThanhPhan.Enabled)
                    {
                        pKQHT_DaChuyenDiemInfo.DaNhapDiemThanhPhan = !chkDiemThanhPhan.Checked;
                    }
                    else
                    {
                        pKQHT_DaChuyenDiemInfo.DaNhapDiemThanhPhan = false;
                    }

                    if (chkThiLan1.Enabled)
                    {
                        pKQHT_DaChuyenDiemInfo.DaNhapDiemThiL1 = !chkThiLan1.Checked;
                    }
                    else
                    {
                        pKQHT_DaChuyenDiemInfo.DaNhapDiemThiL1 = false;
                    }

                    if (chkDiemThanhPhanL2.Enabled)
                    {
                        pKQHT_DaChuyenDiemInfo.DaNhapDiemThanhPhanL2 = !chkDiemThanhPhanL2.Checked;
                    }
                    else
                    {
                        pKQHT_DaChuyenDiemInfo.DaNhapDiemThanhPhanL2 = false;
                    }

                    if (chkThiLan2.Enabled)
                    {
                        pKQHT_DaChuyenDiemInfo.DaNhapDiemThiL2 = !chkThiLan2.Checked;
                    }
                    else
                    {
                        pKQHT_DaChuyenDiemInfo.DaNhapDiemThiL2 = false;
                    }

                    try
                    {
                        // Update vao bang KQHT_DaChuyenDiem
                        oBKQHT_DaChuyenDiem.UpdateTrangThaiChuyen(pKQHT_DaChuyenDiemInfo);

                        // Thêm thông tin về lần cho nhập lại điểm này vào bảng KQHT_ChoNhapLaiDiem
                        cBKQHT_ChoNhapLaiDiem            oBKQHT_ChoNhapLaiDiem             = new cBKQHT_ChoNhapLaiDiem();
                        cBKQHT_ChoNhapLaiDiem_SinhVien   oBKQHT_ChoNhapLaiDiem_SinhVien    = new cBKQHT_ChoNhapLaiDiem_SinhVien();
                        KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo = new KQHT_ChoNhapLaiDiem_SinhVienInfo();

                        bool DiemThanhPhan_L2, DiemThi_L2, DiemThi_L1;

                        DiemThanhPhan_L2 = chkDiemThanhPhanL2.Enabled ? chkDiemThanhPhanL2.Checked : false;
                        DiemThi_L2       = chkThiLan2.Enabled ? chkThiLan2.Checked : false;
                        DiemThi_L1       = chkThiLan1.Enabled ? chkThiLan1.Checked : false;

                        pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDKQHT_ChoNhapLaiDiem =
                            oBKQHT_ChoNhapLaiDiem.AddChuyenDiem(IDXL_MonHocTrongKy, Program.objUserCurrent.HT_UserID,
                                                                chkDiemThanhPhan.Checked, DiemThi_L1, DiemThanhPhan_L2, DiemThi_L2);

                        // Thêm chi tiết các sinh viên được chuyển lại điểm vào bảng KQHT_ChoNhapLaiDiem_SinhVien
                        foreach (DataRow dr in arrDr)
                        {
                            pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDSV_SinhVien = int.Parse(dr["SV_SinhVienID"].ToString());
                            oBKQHT_ChoNhapLaiDiem_SinhVien.Add(pKQHT_ChoNhapLaiDiem_SinhVienInfo);
                        }

                        // Lưu lại điểm trước khi nhập lại của các sinh viên được chuyển lại điểm này
                        oBKQHT_ChoNhapLaiDiem.LuuDiemHienTai(pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDKQHT_ChoNhapLaiDiem, IDXL_MonHocTrongKy);

                        ThongBao("Đã cập nhật trạng thái chuyển điểm thành công.");

                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    catch (Exception ex)
                    {
                        ThongBaoLoi("Có lỗi khi cập nhật trạng thái chuyển điểm: " + ex.Message);
                    }
                }
                else
                {
                    ThongBao("Bạn phải chọn ít nhất 1 sinh viên!");
                }
            }
        }
 public void ToInfo(ref KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo, DataRow dr)
 {
     pKQHT_ChoNhapLaiDiem_SinhVienInfo.KQHT_ChoNhapLaiDiem_SinhVienID = int.Parse(dr[pKQHT_ChoNhapLaiDiem_SinhVienInfo.strKQHT_ChoNhapLaiDiem_SinhVienID].ToString());
     pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDKQHT_ChoNhapLaiDiem          = int.Parse(dr[pKQHT_ChoNhapLaiDiem_SinhVienInfo.strIDKQHT_ChoNhapLaiDiem].ToString());
     pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDSV_SinhVien = int.Parse(dr[pKQHT_ChoNhapLaiDiem_SinhVienInfo.strIDSV_SinhVien].ToString());
 }
 public void ToDataRow(KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo, ref DataRow dr)
 {
     dr[pKQHT_ChoNhapLaiDiem_SinhVienInfo.strKQHT_ChoNhapLaiDiem_SinhVienID] = pKQHT_ChoNhapLaiDiem_SinhVienInfo.KQHT_ChoNhapLaiDiem_SinhVienID;
     dr[pKQHT_ChoNhapLaiDiem_SinhVienInfo.strIDKQHT_ChoNhapLaiDiem]          = pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDKQHT_ChoNhapLaiDiem;
     dr[pKQHT_ChoNhapLaiDiem_SinhVienInfo.strIDSV_SinhVien] = pKQHT_ChoNhapLaiDiem_SinhVienInfo.IDSV_SinhVien;
 }
 public void Delete(KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo)
 {
     oDKQHT_ChoNhapLaiDiem_SinhVien.Delete(pKQHT_ChoNhapLaiDiem_SinhVienInfo);
     mErrorMessage = oDKQHT_ChoNhapLaiDiem_SinhVien.ErrorMessages;
     mErrorNumber  = oDKQHT_ChoNhapLaiDiem_SinhVien.ErrorNumber;
 }
 public DataTable Get(KQHT_ChoNhapLaiDiem_SinhVienInfo pKQHT_ChoNhapLaiDiem_SinhVienInfo)
 {
     return(oDKQHT_ChoNhapLaiDiem_SinhVien.Get(pKQHT_ChoNhapLaiDiem_SinhVienInfo));
 }