Exemplo n.º 1
0
        public static List <DiemMon> getDiemMon(int namhoc, int hocky)
        {
            List <DiemMon> listct = new List <DiemMon>();
            string         query  = "select * from DiemMon where NamHoc=" + namhoc + " and HocKy=" + hocky;
            DataTable      db     = DataProvider.LoadData(query);

            for (int i = 0; i < db.Rows.Count; i++)
            {
                DiemMon dm = new DiemMon();
                dm.Hocky  = hocky;
                dm.NamHoc = namhoc;

                dm.DiemKT      = db.Rows[i]["DiemKT"].ToString();
                dm.DiemThi     = db.Rows[i]["DiemThi"].ToString();
                dm.DiemTK10    = db.Rows[i]["DiemTK10"].ToString();
                dm.DiemChu     = db.Rows[i]["DiemChu"].ToString();
                dm.MonHoc.MaMH = db.Rows[i]["MaMH"].ToString();

                listct.Add(dm);
            }
            foreach (DiemMon dm in listct)
            {
                dm.MonHoc = BMonHoc.getByMaMH(dm.MonHoc.MaMH);
            }
            return(listct);
        }
Exemplo n.º 2
0
        public static List <LichThi> LoadDataFromSV(string id)
        {
            list = new List <LichThi>();
            XmlDocument doc = new XmlDocument();

            doc.Load("http://localhost:56715/api/lichthi/" + id);
            XmlElement root = doc.DocumentElement;



            foreach (XmlNode node in root.ChildNodes)
            {
                LichThi lt = new LichThi();
                lt.GhepThi      = node.ChildNodes[0].InnerText.Trim();
                lt.GioBD        = node.ChildNodes[1].InnerText.Trim();
                lt.MonHoc       = new MonHoc();
                lt.MonHoc.MaMH  = node.ChildNodes[3].InnerText.Trim();
                lt.MonHoc.TenMH = node.ChildNodes[8].InnerText.Trim();
                lt.NgayThi      = node.ChildNodes[4].InnerText.Trim();
                lt.PhongThi     = node.ChildNodes[5].InnerText.Trim();
                lt.SoLuong      = int.Parse(node.ChildNodes[6].InnerText.Trim());
                lt.SoPhut       = int.Parse(node.ChildNodes[7].InnerText.Trim());
                lt.ToThi        = node.ChildNodes[9].InnerText.Trim();
                list.Add(lt);
                BMonHoc.AddMon(lt.MonHoc);
                AddLT(lt);
            }

            return(list);
        }
Exemplo n.º 3
0
        public static List <LichThi> getAll()
        {
            list = new List <LichThi>();
            string    query = "select * from LichThi";
            DataTable db    = DataProvider.LoadData(query);

            for (int i = 0; i < db.Rows.Count; i++)
            {
                LichThi lt = new LichThi();
                lt.MonHoc      = new MonHoc();
                lt.MonHoc.MaMH = db.Rows[i]["MaMH"].ToString();
                lt.GhepThi     = db.Rows[i]["GhepThi"].ToString();
                lt.ToThi       = db.Rows[i]["ToThi"].ToString();
                lt.SoLuong     = int.Parse(db.Rows[i]["SoLuong"].ToString());
                lt.NgayThi     = db.Rows[i]["NgayThi"].ToString();
                lt.GioBD       = db.Rows[i]["GioBD"].ToString();
                lt.SoPhut      = int.Parse(db.Rows[i]["SoPhut"].ToString());
                lt.PhongThi    = db.Rows[i]["PhongThi"].ToString();
                list.Add(lt);
            }
            foreach (LichThi lt in list)
            {
                lt.MonHoc = BMonHoc.getByMaMH(lt.MonHoc.MaMH);
            }
            return(list);
        }
Exemplo n.º 4
0
        public static List <LichHoc> getAll()
        {
            string query = "select * from LichHoc";

            list = new List <LichHoc>();
            DataTable db = DataProvider.LoadData(query);

            for (int i = 0; i < db.Rows.Count; i++)
            {
                LichHoc mh = new LichHoc();
                mh.Id = db.Rows[i]["Id"].ToString();

                mh.MaLop       = db.Rows[i]["MaLop"].ToString();
                mh.ThoigianBD  = db.Rows[i]["ThoigianBD"].ToString();
                mh.ThoigianKT  = db.Rows[i]["ThoigianKT"].ToString();
                mh.NhomMH      = db.Rows[i]["NhomMH"].ToString();
                mh.MonHoc      = new MonHoc();
                mh.MonHoc.MaMH = db.Rows[i]["MaMH"].ToString();

                list.Add(mh);
            }
            foreach (LichHoc lh in list)
            {
                lh.Chitiet = getChiTiets(lh.Id);
                lh.MonHoc  = BMonHoc.getByMaMH(lh.MonHoc.MaMH);
            }
            return(list);
        }
Exemplo n.º 5
0
        public static List <LichHoc> LoadDataFromSV(string id)
        {
            list = new List <LichHoc>();
            XmlDocument doc = new XmlDocument();

            doc.Load("http://localhost:56715/api/thoikhoabieu/" + id);
            XmlElement root = doc.DocumentElement;



            int k = getID();

            foreach (XmlNode node in root.ChildNodes)
            {
                LichHoc lh = new LichHoc();
                MonHoc  mh = new MonHoc();
                lh.Id          = k.ToString();
                lh.MonHoc      = new MonHoc();
                lh.MonHoc.MaMH = node.ChildNodes[2].InnerText.Trim();
                lh.MaLop       = node.ChildNodes[1].InnerText.Trim();
                lh.NhomMH      = node.ChildNodes[3].InnerText.Trim();
                mh.MaMH        = lh.MonHoc.MaMH;
                mh.TenMH       = node.ChildNodes[7].InnerText.Trim();
                mh.SoTC        = int.Parse(node.ChildNodes[5].InnerText.Trim());
                mh.TileThi     = 0;
                lh.ThoigianBD  = node.ChildNodes[10].InnerText.Trim().Substring(0, 10);
                lh.ThoigianKT  = node.ChildNodes[10].InnerText.Trim().Substring(12);
                List <chiTietLH> listct = new List <chiTietLH>();
                // constant
                int one  = 1;
                int five = 5;
                for (int i = 0; i < node.ChildNodes[8].InnerText.Trim().Length; i++)
                {
                    chiTietLH ct = new chiTietLH();
                    ct.Id = k.ToString();
                    string magv = node.ChildNodes[0].InnerText.Trim().Substring(i * five, five);
                    ct.CBGD       = BUser.getUser(magv).Hoten;
                    ct.Phong      = node.ChildNodes[4].InnerText.Trim().Substring(i * 6, 6);
                    ct.Thu        = node.ChildNodes[8].InnerText.Trim().Substring(i * one, one);
                    ct.TietBatDau = node.ChildNodes[9].InnerText.Trim().Substring(i * one, one);//tiet bat dau = 10

                    ct.SoTiet = node.ChildNodes[6].InnerText.Trim()[i].ToString();
                    listct.Add(ct);
                }
                lh.Chitiet = listct;
                list.Add(lh);
                AddLH(lh);
                BMonHoc.AddMon(mh);
                k++;
            }

            return(list);
        }
Exemplo n.º 6
0
        public static List <DiemThi> LoadDataFromSV(string id)
        {
            list = new List <DiemThi>();
            XmlDocument doc = new XmlDocument();

            doc.Load("http://localhost:56715/api/diemthi/" + id);
            XmlElement root = doc.DocumentElement;



            foreach (XmlNode node in root.ChildNodes)
            {
                DiemThi lt = new DiemThi();
                lt.DiemRL   = node.ChildNodes[0].InnerText.Trim();
                lt.DiemMons = new List <DiemMon>();
                foreach (XmlNode nod in node.ChildNodes[5].ChildNodes)
                {
                    DiemMon dm = new DiemMon();
                    MonHoc  mh = new MonHoc();
                    dm.Hocky       = int.Parse(node.ChildNodes[9].InnerText.Trim()[7].ToString());
                    dm.NamHoc      = int.Parse(node.ChildNodes[9].InnerText.Trim().Substring(17));
                    dm.DiemKT      = nod.ChildNodes[0].InnerText;
                    dm.MonHoc      = new MonHoc();
                    dm.MonHoc.MaMH = nod.ChildNodes[1].InnerText;
                    mh.MaMH        = dm.MonHoc.MaMH;
                    mh.TenMH       = nod.ChildNodes[5].InnerText;
                    mh.SoTC        = int.Parse(nod.ChildNodes[4].InnerText);
                    mh.TileThi     = int.Parse(nod.ChildNodes[3].InnerText.ToString());
                    dm.DiemThi     = nod.ChildNodes[6].InnerText;
                    dm.DiemTK10    = nod.ChildNodes[7].InnerText;
                    dm.DiemChu     = nod.ChildNodes[8].InnerText;
                    lt.DiemMons.Add(dm);
                    AddDiemMon(dm);
                    BMonHoc.AddMon(mh);
                    BMonHoc.UpdateMH(mh);
                }
                lt.DiemTB4    = node.ChildNodes[1].InnerText.Trim();
                lt.DiemTB10   = node.ChildNodes[2].InnerText.Trim();
                lt.DiemTBTL4  = node.ChildNodes[3].InnerText.Trim();
                lt.DiemTBTL10 = node.ChildNodes[4].InnerText.Trim();
                lt.LoaiRL     = node.ChildNodes[6].InnerText.Trim();
                lt.SoTCDat    = node.ChildNodes[7].InnerText.Trim();
                lt.SoTCTL     = node.ChildNodes[8].InnerText.Trim();
                lt.NamHoc     = int.Parse(node.ChildNodes[9].InnerText.Trim().Substring(17));
                lt.Hocky      = int.Parse(node.ChildNodes[9].InnerText.Trim()[7].ToString());

                AddDiemThi(lt);
                list.Add(lt);
            }

            return(list);
        }
Exemplo n.º 7
0
        public static List <CTHocPhi> getCTHP(int NamHoc, int HocKy)
        {
            string          query  = string.Format("select * from CTHocPhi where NamHoc={0} and HocKy={1}", NamHoc, HocKy);
            List <CTHocPhi> listct = new List <CTHocPhi>();
            DataTable       db     = DataProvider.LoadData(query);

            for (int i = 0; i < db.Rows.Count; i++)
            {
                CTHocPhi ct = new CTHocPhi();
                ct.monHoc = BMonHoc.getByMaMH(db.Rows[i]["MaMH"].ToString());

                ct.HocPhi   = db.Rows[i]["HocPhi"].ToString();
                ct.MienGiam = db.Rows[i]["MienGiam"].ToString();
                ct.MaNhom   = db.Rows[i]["MaNhom"].ToString();
                ct.PhaiDong = db.Rows[i]["PhaiDong"].ToString();
                ct.NamHoc   = int.Parse(db.Rows[i]["NamHoc"].ToString());
                ct.HocKy    = int.Parse(db.Rows[i]["HocKy"].ToString());

                listct.Add(ct);
            }
            return(listct);
        }