コード例 #1
0
        public static IList<LopInfo> LayDsLop(String namHoc)
        {
            LopData m_LData = new LopData();
            DataTable m_DT = m_LData.LayDsLopForReport(namHoc);

            IList<LopInfo> dS = new List<LopInfo>();

            foreach (DataRow Row in m_DT.Rows)
            {
                LopInfo lop = new LopInfo();

                GiaoVienInfo gv = new GiaoVienInfo();
                gv.MaGiaoVien = Convert.ToString(Row["MaGiaoVien"]);
                gv.TenGiaoVien = Convert.ToString(Row["TenGiaoVien"]);

                KhoiLopInfo kl = new KhoiLopInfo();
                kl.MaKhoiLop = Convert.ToString(Row["MaKhoiLop"]);
                kl.TenKhoiLop = Convert.ToString(Row["TenKhoiLop"]);

                NamHocInfo nh = new NamHocInfo();
                nh.MaNamHoc = Convert.ToString(Row["MaNamHoc"]);
                nh.TenNamHoc = Convert.ToString(Row["TenNamHoc"]);

                lop.MaLop = Convert.ToString(Row["MaLop"]);
                lop.TenLop = Convert.ToString(Row["TenLop"]);
                lop.KhoiLop = kl;
                lop.NamHoc = nh;
                lop.SiSo = Convert.ToInt32(Row["SiSo"]);
                lop.GiaoVien = gv;

                dS.Add(lop);
            }
            return dS;
        }
コード例 #2
0
        public static IList <LopInfo> LayDsLop(String namHoc)
        {
            LopData   m_LData = new LopData();
            DataTable m_DT    = m_LData.LayDsLopForReport(namHoc);

            IList <LopInfo> dS = new List <LopInfo>();

            foreach (DataRow Row in m_DT.Rows)
            {
                LopInfo lop = new LopInfo();

                GiaoVienInfo gv = new GiaoVienInfo();
                gv.MaGiaoVien  = Convert.ToString(Row["MaGiaoVien"]);
                gv.TenGiaoVien = Convert.ToString(Row["TenGiaoVien"]);

                KhoiLopInfo kl = new KhoiLopInfo();
                kl.MaKhoiLop  = Convert.ToString(Row["MaKhoiLop"]);
                kl.TenKhoiLop = Convert.ToString(Row["TenKhoiLop"]);

                NamHocInfo nh = new NamHocInfo();
                nh.MaNamHoc  = Convert.ToString(Row["MaNamHoc"]);
                nh.TenNamHoc = Convert.ToString(Row["TenNamHoc"]);

                lop.MaLop    = Convert.ToString(Row["MaLop"]);
                lop.TenLop   = Convert.ToString(Row["TenLop"]);
                lop.KhoiLop  = kl;
                lop.NamHoc   = nh;
                lop.SiSo     = Convert.ToInt32(Row["SiSo"]);
                lop.GiaoVien = gv;

                dS.Add(lop);
            }
            return(dS);
        }
コード例 #3
0
 public DiemInfo()
 {
     m_HocSinh = new HocSinhInfo();
        m_MonHoc = new MonHocInfo();
        m_HocKy = new HocKyInfo();
        m_NamHoc = new NamHocInfo();
        m_Lop = new LopInfo();
        m_LoaiDiem = new LoaiDiemInfo();
        m_Diem = 0;
 }
コード例 #4
0
        public static IList <KQCaNamTongHopInfo> LayDsKQCaNamTongHop(String maLop, String maNamHoc)
        {
            KQCaNamTongHopData m_KQCNTHData = new KQCaNamTongHopData();
            DataTable          m_DT         = m_KQCNTHData.LayDsKQCaNamTongHopForReport(maLop, maNamHoc);

            IList <KQCaNamTongHopInfo> dS = new List <KQCaNamTongHopInfo>();

            foreach (DataRow Row in m_DT.Rows)
            {
                KQCaNamTongHopInfo ketqua = new KQCaNamTongHopInfo();

                HocSinhInfo hs = new HocSinhInfo();
                hs.MaHocSinh = Convert.ToString(Row["MaHocSinh"]);
                hs.HoTen     = Convert.ToString(Row["HoTen"]);
                hs.GioiTinh  = Convert.ToBoolean(Row["GioiTinh"]);
                hs.NgaySinh  = Convert.ToDateTime(Row["NgaySinh"]);
                LopInfo l = new LopInfo();
                l.MaLop  = Convert.ToString(Row["MaLop"]);
                l.TenLop = Convert.ToString(Row["TenLop"]);

                NamHocInfo nh = new NamHocInfo();
                nh.MaNamHoc  = Convert.ToString(Row["MaNamHoc"]);
                nh.TenNamHoc = Convert.ToString(Row["TenNamHoc"]);

                HocLucInfo hl = new HocLucInfo();
                hl.MaHocLuc  = Convert.ToString(Row["MaHocLuc"]);
                hl.TenHocLuc = Convert.ToString(Row["TenHocLuc"]);

                HanhKiemInfo hkiem = new HanhKiemInfo();
                hkiem.MaHanhKiem  = Convert.ToString(Row["MaHanhKiem"]);
                hkiem.TenHanhKiem = Convert.ToString(Row["TenHanhKiem"]);

                KetQuaInfo kq = new KetQuaInfo();
                kq.MaKetQua  = Convert.ToString(Row["MaKetQua"]);
                kq.TenKetQua = Convert.ToString(Row["TenKetQua"]);

                ketqua.HocSinh  = hs;
                ketqua.Lop      = l;
                ketqua.NamHoc   = nh;
                ketqua.HocLuc   = hl;
                ketqua.HanhKiem = hkiem;
                ketqua.KetQua   = kq;
                ketqua.DTBCaNam = Convert.ToSingle(Row["DTBCaNam"]);

                dS.Add(ketqua);
            }
            return(dS);
        }
コード例 #5
0
        public static IList<KQHKTongHopInfo> LayDsKQHocKyTongHop(String maLop, String maHocKy, String maNamHoc)
        {
            KQHKTongHopData m_KQHKTHData = new KQHKTongHopData();
              DataTable m_DT = m_KQHKTHData.LayDsKQHocKyTongHopForReport(maLop, maHocKy, maNamHoc);

              IList<KQHKTongHopInfo> dS = new List<KQHKTongHopInfo>();

              foreach (DataRow Row in m_DT.Rows)
              {
              KQHKTongHopInfo ketqua = new KQHKTongHopInfo();

              HocSinhInfo hs = new HocSinhInfo();
              hs.MaHocSinh = Convert.ToString(Row["MaHocSinh"]);
              hs.HoTen = Convert.ToString(Row["HoTen"]);

              LopInfo l = new LopInfo();
              l.MaLop = Convert.ToString(Row["MaLop"]);
              l.TenLop = Convert.ToString(Row["TenLop"]);

              HocKyInfo hk = new HocKyInfo();
              hk.MaHocKy = Convert.ToString(Row["MaHocKy"]);
              hk.TenHocKy = Convert.ToString(Row["TenHocKy"]);

              NamHocInfo nh = new NamHocInfo();
              nh.MaNamHoc = Convert.ToString(Row["MaNamHoc"]);
              nh.TenNamHoc = Convert.ToString(Row["TenNamHoc"]);

              HocLucInfo hl = new HocLucInfo();
              hl.MaHocLuc = Convert.ToString(Row["MaHocLuc"]);
              hl.TenHocLuc = Convert.ToString(Row["TenHocLuc"]);

              HanhKiemInfo hkiem = new HanhKiemInfo();
              hkiem.MaHanhKiem = Convert.ToString(Row["MaHanhKiem"]);
              hkiem.TenHanhKiem = Convert.ToString(Row["TenHanhKiem"]);

              ketqua.HocSinh = hs;
              ketqua.Lop = l;
              ketqua.HocKy = hk;
              ketqua.NamHoc = nh;
              ketqua.HocLuc = hl;
              ketqua.HanhKiem = hkiem;
              ketqua.DTBMonHocKy = Convert.ToSingle(Row["DTBMonHocKy"]);
              ketqua.DanhHieuHS = Convert.ToString(Row["DanhHieuHS"]);

              dS.Add(ketqua);
              }
              return dS;
        }
コード例 #6
0
        public static IList <KQHocKyTongHopInfo> LayDsKQHocKyTongHop(String maLop, String maHocKy, String maNamHoc)
        {
            KQHocKyTongHopData m_KQHKTHData = new KQHocKyTongHopData();
            DataTable          m_DT         = m_KQHKTHData.LayDsKQHocKyTongHopForReport(maLop, maHocKy, maNamHoc);

            IList <KQHocKyTongHopInfo> dS = new List <KQHocKyTongHopInfo>();

            foreach (DataRow Row in m_DT.Rows)
            {
                KQHocKyTongHopInfo ketqua = new KQHocKyTongHopInfo();

                HocSinhInfo hs = new HocSinhInfo();
                hs.MaHocSinh = Convert.ToString(Row["MaHocSinh"]);
                hs.HoTen     = Convert.ToString(Row["HoTen"]);

                LopInfo l = new LopInfo();
                l.MaLop  = Convert.ToString(Row["MaLop"]);
                l.TenLop = Convert.ToString(Row["TenLop"]);

                HocKyInfo hk = new HocKyInfo();
                hk.MaHocKy  = Convert.ToString(Row["MaHocKy"]);
                hk.TenHocKy = Convert.ToString(Row["TenHocKy"]);

                NamHocInfo nh = new NamHocInfo();
                nh.MaNamHoc  = Convert.ToString(Row["MaNamHoc"]);
                nh.TenNamHoc = Convert.ToString(Row["TenNamHoc"]);

                HocLucInfo hl = new HocLucInfo();
                hl.MaHocLuc  = Convert.ToString(Row["MaHocLuc"]);
                hl.TenHocLuc = Convert.ToString(Row["TenHocLuc"]);

                HanhKiemInfo hkiem = new HanhKiemInfo();
                hkiem.MaHanhKiem  = Convert.ToString(Row["MaHanhKiem"]);
                hkiem.TenHanhKiem = Convert.ToString(Row["TenHanhKiem"]);

                ketqua.HocSinh     = hs;
                ketqua.Lop         = l;
                ketqua.HocKy       = hk;
                ketqua.NamHoc      = nh;
                ketqua.HocLuc      = hl;
                ketqua.HanhKiem    = hkiem;
                ketqua.DTBMonHocKy = Convert.ToSingle(Row["DTBMonHocKy"]);

                dS.Add(ketqua);
            }
            return(dS);
        }
コード例 #7
0
        public static IList<KQCNTongHopInfo> LayDsKQCaNamTongHop(String maLop, String maNamHoc)
        {
            KQCNTongHopData m_KQCNTHData = new KQCNTongHopData();
               DataTable m_DT = m_KQCNTHData.LayDsKQCaNamTongHopForReport(maLop, maNamHoc);

               IList<KQCNTongHopInfo> dS = new List<KQCNTongHopInfo>();

               foreach (DataRow Row in m_DT.Rows)
               {
               KQCNTongHopInfo ketqua = new KQCNTongHopInfo();

               HocSinhInfo hs = new HocSinhInfo();
               hs.MaHocSinh = Convert.ToString(Row["MaHocSinh"]);
               hs.HoTen = Convert.ToString(Row["HoTen"]);

               LopInfo l = new LopInfo();
               l.MaLop = Convert.ToString(Row["MaLop"]);
               l.TenLop = Convert.ToString(Row["TenLop"]);

               NamHocInfo nh = new NamHocInfo();
               nh.MaNamHoc = Convert.ToString(Row["MaNamHoc"]);
               nh.TenNamHoc = Convert.ToString(Row["TenNamHoc"]);

               HocLucInfo hl = new HocLucInfo();
               hl.MaHocLuc = Convert.ToString(Row["MaHocLuc"]);
               hl.TenHocLuc = Convert.ToString(Row["TenHocLuc"]);

               HanhKiemInfo hkiem = new HanhKiemInfo();
               hkiem.MaHanhKiem = Convert.ToString(Row["MaHanhKiem"]);
               hkiem.TenHanhKiem = Convert.ToString(Row["TenHanhKiem"]);

               KetQuaInfo kq = new KetQuaInfo();
               kq.MaKetQua = Convert.ToString(Row["MaKetQua"]);
               kq.TenKetQua = Convert.ToString(Row["TenKetQua"]);

               ketqua.HocSinh = hs;
               ketqua.Lop = l;
               ketqua.NamHoc = nh;
               ketqua.HocLuc = hl;
               ketqua.HanhKiem = hkiem;
               ketqua.KetQua = kq;
               ketqua.DTBCaNam = Convert.ToSingle(Row["DTBCaNam"]);

               dS.Add(ketqua);
               }
               return dS;
        }
コード例 #8
0
        private void btnCapNhat_Click(object sender, EventArgs e)
        {
            NamHocInfo nam = new NamHocInfo();

            nam.MaNamHoc    = txtMa.Text;
            nam.TenNamHoc   = txtTen.Text;
            nam.NgayBatDau  = dateBatDau.Value;
            nam.NgayKetThuc = dateKetThuc.Value;
            if (Adding)
            {
                control.ThemNamHoc(nam);
                Adding = false;
            }
            else
            {
                if (Deleting)
                {
                    control.XoaNamHoc(nam);
                    Deleting = false;
                }
                else
                {
                    if (Updating)
                    {
                        control.SuaNamHoc(nam);
                        Updating = false;
                    }
                }
            }

            //
            btnThem.Enabled = true;
            btnXoa.Enabled  = true;
            btnSua.Enabled  = true;

            btnBoQua.Visible = false;

            btnCapNhat.Enabled = false;
            //
            txtMa.ReadOnly      = true;
            txtTen.ReadOnly     = true;
            dateBatDau.Enabled  = false;
            dateKetThuc.Enabled = false;
            //
            control.HienThi(dataDSNamHoc, binNamHoc, txtMa, txtTen, dateBatDau, dateKetThuc);
        }
コード例 #9
0
        public DataGridViewRow InfoToRow(NamHocInfo nh, DataGridView grid)
        {
            DataGridViewRow r = (DataGridViewRow)grid.Rows[0].Clone();

            DataGridViewCell c = (DataGridViewCell)r.Cells[0].Clone();

            c.Value = nh.MaNamHoc.ToString();
            r.Cells["txtMaNamHoc"] = c;
            c.Value = nh.TenNamHoc;
            r.Cells["txtTenNamHoc"] = c;
            c.Value = nh.NgayBatDau;
            r.Cells["txtNgayBatDau"] = c;
            c.Value = nh.NgayKetThuc;
            r.Cells["txtNgayKetThuc"] = c;

            return(r);
        }
コード例 #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="maNamHoc"></param>
        /// <returns></returns>
        public NamHocInfo LayTuMa(string maNamHoc)
        {
            if (this.Data == null)
            {
                this.Data = new NamHocData();
            }
            DataTable  table = this.Data.LayTuMa(maNamHoc);
            NamHocInfo info  = new NamHocInfo();

            if (table.Rows.Count > 0)
            {
                info.MaNamHoc  = table.Rows[0]["MaNamHoc"].ToString();
                info.TenNamHoc = table.Rows[0]["TenNamHoc"].ToString();
                return(info);
            }
            return(null);
        }
コード例 #11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btThemMoi_Click(object sender, EventArgs e)
        {
            DataRowView row  = (DataRowView)this.bnDS.BindingSource.AddNew();
            NamHocInfo  info = this.PhatSinh();

            row["MaNamHoc"]  = info.MaNamHoc;
            row["TenNamHoc"] = info.TenNamHoc;
            this.bnDS.BindingSource.MoveLast();

            this.btThemMoi.Enabled = false;
            this.btXoa.Enabled     = false;
            this.btBoQua.Enabled   = true;
            this.btLuu.Enabled     = true;

            this.itThemMoi.Enabled = false;
            this.itXoa.Enabled     = false;
            this.itBoQua.Enabled   = true;
            this.itLuu.Enabled     = true;
        }
コード例 #12
0
        public static IList <KQHocKyMonHocInfo> LayDsKQHocKyMonHoc(String maLop, String maMonHoc, String maHocKy, String maNamHoc)
        {
            KQHocKyMonHocData m_KQHKMHData = new KQHocKyMonHocData();
            DataTable         m_DT         = m_KQHKMHData.LayDsKQHocKyMonHocForReport(maLop, maMonHoc, maHocKy, maNamHoc);

            IList <KQHocKyMonHocInfo> dS = new List <KQHocKyMonHocInfo>();

            foreach (DataRow Row in m_DT.Rows)
            {
                KQHocKyMonHocInfo ketqua = new KQHocKyMonHocInfo();

                HocSinhInfo hs = new HocSinhInfo();
                hs.MaHocSinh = Convert.ToString(Row["MaHocSinh"]);
                hs.HoTen     = Convert.ToString(Row["HoTen"]);

                LopInfo l = new LopInfo();
                l.MaLop  = Convert.ToString(Row["MaLop"]);
                l.TenLop = Convert.ToString(Row["TenLop"]);

                MonHocInfo mh = new MonHocInfo();
                mh.MaMonHoc  = Convert.ToString(Row["MaMonHoc"]);
                mh.TenMonHoc = Convert.ToString(Row["TenMonHoc"]);

                HocKyInfo hk = new HocKyInfo();
                hk.MaHocKy  = Convert.ToString(Row["MaHocKy"]);
                hk.TenHocKy = Convert.ToString(Row["TenHocKy"]);

                NamHocInfo nh = new NamHocInfo();
                nh.MaNamHoc  = Convert.ToString(Row["MaNamHoc"]);
                nh.TenNamHoc = Convert.ToString(Row["TenNamHoc"]);

                ketqua.HocSinh     = hs;
                ketqua.Lop         = l;
                ketqua.MonHoc      = mh;
                ketqua.HocKy       = hk;
                ketqua.NamHoc      = nh;
                ketqua.DTBKiemTra  = Convert.ToSingle(Row["DTBKiemTra"]);
                ketqua.DTBMonHocKy = Convert.ToSingle(Row["DTBMonHocKy"]);

                dS.Add(ketqua);
            }
            return(dS);
        }
コード例 #13
0
        public static IList<KQHKMonHocInfo> LayDsKQHocKyMonHoc(String maLop, String maMonHoc, String maHocKy, String maNamHoc)
        {
            KQHKMonHocData m_KQHKMHData = new KQHKMonHocData();
               DataTable m_DT = m_KQHKMHData.LayDsKQHocKyMonHocForReport(maLop, maMonHoc, maHocKy, maNamHoc);

               IList<KQHKMonHocInfo> dS = new List<KQHKMonHocInfo>();

               foreach (DataRow Row in m_DT.Rows)
               {
               KQHKMonHocInfo ketqua = new KQHKMonHocInfo();

               HocSinhInfo hs = new HocSinhInfo();
               hs.MaHocSinh = Convert.ToString(Row["MaHocSinh"]);
               hs.HoTen = Convert.ToString(Row["HoTen"]);

               LopInfo l = new LopInfo();
               l.MaLop = Convert.ToString(Row["MaLop"]);
               l.TenLop = Convert.ToString(Row["TenLop"]);

               MonHocInfo mh = new MonHocInfo();
               mh.MaMonHoc = Convert.ToString(Row["MaMonHoc"]);
               mh.TenMonHoc = Convert.ToString(Row["TenMonHoc"]);

               HocKyInfo hk = new HocKyInfo();
               hk.MaHocKy = Convert.ToString(Row["MaHocKy"]);
               hk.TenHocKy = Convert.ToString(Row["TenHocKy"]);

               NamHocInfo nh = new NamHocInfo();
               nh.MaNamHoc = Convert.ToString(Row["MaNamHoc"]);
               nh.TenNamHoc = Convert.ToString(Row["TenNamHoc"]);

               ketqua.HocSinh = hs;
               ketqua.Lop = l;
               ketqua.MonHoc = mh;
               ketqua.HocKy = hk;
               ketqua.NamHoc = nh;
               ketqua.DTBMonHocKy = Convert.ToSingle(Row["DTBMonHocKy"]);

               dS.Add(ketqua);
               }
               return dS;
        }
コード例 #14
0
 public void SuaNamHoc(NamHocInfo nam)
 {
     Data.SuaNamHoc(nam);
 }
コード例 #15
0
 public void XoaNamHoc(NamHocInfo nam)
 {
     Data.XoaNamHoc(nam);
 }
コード例 #16
0
 public void ThemNamHoc(NamHocInfo nam)
 {
     Data.ThemNamHoc(nam);
 }
コード例 #17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmPhanLop_Load(object sender, EventArgs e)
        {
            if (this.KhoiLopControllerCu == null)
            {
                this.KhoiLopControllerCu = new KhoiLopController();
            }
            if (this.LopControllerCu == null)
            {
                this.LopControllerCu = new LopController();
            }
            if (this.HocSinhControllerCu == null)
            {
                this.HocSinhControllerCu = new HocSinhController();
            }
            if (this.PhanLopControllerCu == null)
            {
                this.PhanLopControllerCu = new PhanLopController();
            }

            if (this.NamHocController == null)
            {
                this.NamHocController = new NamHocController();
            }
            if (this.KhoiLopControllerMoi == null)
            {
                this.KhoiLopControllerMoi = new KhoiLopController();
            }
            if (this.LopControllerMoi == null)
            {
                this.LopControllerMoi = new LopController();
            }
            if (this.HocSinhControllerMoi == null)
            {
                this.HocSinhControllerMoi = new HocSinhController();
            }
            if (this.PhanLopControllerMoi == null)
            {
                this.PhanLopControllerMoi = new PhanLopController();
            }

            string     maNamHocMoi   = this.NamHocController.LayMaCuoi();
            string     maNamHocCu    = this.NamHocController.LayMaTruoc(maNamHocMoi);
            NamHocInfo infoNamHocMoi = this.NamHocController.LayTuMa(maNamHocMoi);
            NamHocInfo infoNamHocCu  = this.NamHocController.LayTuMa(maNamHocCu);

            this.gbNamHocCu.Text  = "Năm Học " + infoNamHocCu.TenNamHoc;
            this.gbNamHocCu.Tag   = maNamHocCu;
            this.gbNamHocMoi.Text = "Năm Học " + infoNamHocMoi.TenNamHoc;
            this.gbNamHocMoi.Tag  = maNamHocMoi;

            this.KhoiLopControllerMoi.HienThiCombobox(this.cmbKhoiLopMoi);
            this.KhoiLopControllerCu.HienThiCombobox(this.cmbKhoiLopCu);

            this.cmbKhoiLopMoi.SelectedIndex = 0;
            this.cmbKhoiLopCu.SelectedIndex  = 0;
            if (this.cmbLopMoi.Items.Count > 0)
            {
                this.cmbLopMoi.SelectedIndex = 0;
            }
            if (this.cmbLopCu.Items.Count > 0)
            {
                this.cmbLopCu.SelectedIndex = 0;
            }
        }