Exemple #1
0
 private void vSaveRegisterCoures(int vCheck)
 {
     dtoDkHoc             = new DANG_KI_HOC();
     boDangKiHoc          = new BO_DANG_KI_HOC();
     dtoDiem              = new DIEM();
     boDiem               = new BO_DIEM();
     dtoDkHoc.DKH_Code    = txtDKHCode.Text;
     dtoDkHoc.DKH_BienLai = txtSoBienLai.Text;
     dtoDkHoc.DKH_Diem    = null;
     dtoDkHoc.DKH_LanThi  = null;
     dtoDkHoc.DKH_LOPID   = int.Parse(lookUpLop.GetColumnValue("LOP_ID").ToString());
     dtoDkHoc.DKH_HOVID   = gHocVienID;
     if (vCheck == 1)
     {
         //Lưu vào bảng đăng kí học
         boDangKiHoc.insert(dtoDkHoc);
         dtoDiem.DIE_CHCID        = int.Parse(lookCcID.GetColumnValue("CHC_ID").ToString());
         dtoDiem.DIE_LOPID        = int.Parse(lookUpLop.GetColumnValue("LOP_ID").ToString());
         dtoDiem.DIE_HOVID        = gHocVienID;
         dtoDiem.DIE_Diem         = null;
         dtoDiem.DIE_LanThi       = 1;
         dtoDiem.DIE_NgayNhapDiem = null;
         for (int ii = 0; ii < listSubject.ItemCount; ii++)
         {
             if (listSubject.GetItemChecked(ii))
             {
                 // Luu vao table Diem
                 dtoDiem.DIE_MONID = int.Parse(listSubject.GetItemValue(ii).ToString());
                 boDiem.insert(dtoDiem);
             }
         }
     }
 }
Exemple #2
0
        private void sSaveRegisterCoures(int sCheck)
        {
            dtoDkHoc             = new DANG_KI_HOC();
            boDkHoc              = new BO_DANG_KI_HOC();
            dtoDiem              = new DIEM();
            boDiem               = new BO_DIEM();
            dtoDkHoc.DKH_Code    = txtDKHCode.Text;
            dtoDkHoc.DKH_BienLai = txtSoBienLai.Text;
            dtoDkHoc.DKH_Diem    = null;
            dtoDkHoc.DKH_LanThi  = null;
            dtoDkHoc.DKH_LOPID   = int.Parse(lookUpLop.GetColumnValue("LOP_ID").ToString());
            dtoDkHoc.DKH_HOVID   = gIDHocVien;
            if (sCheck == 1)
            {
                // Lay lai ID hoc vien o day de insert vao bang diem.
                boDkHoc.insert(dtoDkHoc);

                dtoDiem.DIE_CHCID        = int.Parse(lookCcID.GetColumnValue("CHC_ID").ToString());
                dtoDiem.DIE_LOPID        = int.Parse(lookUpLop.GetColumnValue("LOP_ID").ToString());
                dtoDiem.DIE_HOVID        = gIDHocVien;
                dtoDiem.DIE_Diem         = null;
                dtoDiem.DIE_LanThi       = 1;
                dtoDiem.DIE_NgayNhapDiem = null;

                for (int ii = 0; ii < listSubject.ItemCount; ii++)
                {
                    if (listSubject.GetItemChecked(ii))
                    {
                        // Luu vao table Diem
                        dtoDiem.DIE_MONID = int.Parse(listSubject.GetItemValue(ii).ToString());
                        boDiem.insert(dtoDiem);
                    }
                }
            }
            else if (sCheck == 2)
            {
                dtoDkHoc.DKH_ID = mDkhId;
                boDkHoc.update(dtoDkHoc);
                MessageBox.Show("Cập nhập thông tin thành công", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #3
0
        private void saveStudentIntoNewClass()
        {
            dtoDkHoc = new DANG_KI_HOC();
            dtoDiem  = new DIEM();
            boDiem   = new BO_DIEM();
            boDkh    = new BO_DANG_KI_HOC();
            //int sCcId = -1;
            //int sIdMon = -1;
            //int sClassId = -1;
            //int sStudenstId = -1;
            dtoDkHoc.DKH_BienLai = string.Empty;
            dtoDiem.DIE_LOPID    = dtoDkHoc.DKH_LOPID = int.Parse(lookLopNew.GetColumnValue("LOP_ID").ToString());
            dtoDkHoc.DKH_Diem    = null;
            dtoDkHoc.DKH_LanThi  = null;
            dtoDiem.DIE_CHCID    = int.Parse(lookChungChiNew.GetColumnValue("CHC_ID").ToString());
            for (int i = 0; i < grvNewClass.RowCount; i++)
            {
                dtoDkHoc.DKH_Code = sGeneralCodeDangKiHocVien().ToString();
                // ID hoc vien o day moi chi lay la ID cuoi, nen khong dam bao insert dung hoc vien vao bang diem
                dtoDiem.DIE_HOVID = dtoDkHoc.DKH_HOVID = int.Parse(grvNewClass.GetRowCellValue(i, "HOV_ID").ToString());
                boDkh.insert(dtoDkHoc);

                dtoDiem.DIE_Diem         = null;
                dtoDiem.DIE_LanThi       = 1;
                dtoDiem.DIE_NgayNhapDiem = null;
                for (int ii = 0; ii < listSubject.ItemCount; ii++)
                {
                    if (listSubject.GetItemChecked(ii))
                    {
                        // Luu vao table Diem
                        dtoDiem.DIE_MONID = int.Parse(listSubject.GetItemValue(ii).ToString());
                        boDiem.insert(dtoDiem);
                    }
                }
            }
        }