public List<ChiTietDiemChuan> GetDiemChuan(string matruong, int nam)
 {
     string sql = string.Format("SELECT CN.MANGANH, CN.TENNGANH, DC.KHOITHI, DC.DIEM FROM CHUYENNGANH CN JOIN DIEMCHUAN DC ON (CN.MANGANH = DC.MANGANH AND CN.KHOITHI = DC.KHOITHI) WHERE CN.MATRUONG = '{0}' AND DC.NAM = {1} GROUP BY CN.MANGANH, CN.TENNGANH, DC.KHOITHI, DC.DIEM", matruong, nam);
     List<ChiTietDiemChuan> list = new List<ChiTietDiemChuan>();
     var dataTable = dataProvider.ExecuteQuery(sql);
     foreach (DataRow row in dataTable.Rows)
     {
         ChiTietDiemChuan chiTiet = new ChiTietDiemChuan();
         chiTiet.Diem = float.Parse(row["Diem"].ToString());
         chiTiet.MaNganh = row["MaNganh"].ToString();
         chiTiet.TenNganh = row["TenNganh"].ToString();
         chiTiet.KhoiThi = row["KhoiThi"].ToString();
         list.Add(chiTiet);
     }
     return list;
 }
Esempio n. 2
0
        public List <ChiTietDiemChuan> GetDiemChuan(string matruong, int nam)
        {
            string sql = string.Format("SELECT CN.MANGANH, CN.TENNGANH, DC.KHOITHI, DC.DIEM FROM CHUYENNGANH CN JOIN DIEMCHUAN DC ON (CN.MANGANH = DC.MANGANH AND CN.KHOITHI = DC.KHOITHI) WHERE CN.MATRUONG = '{0}' AND DC.NAM = {1} GROUP BY CN.MANGANH, CN.TENNGANH, DC.KHOITHI, DC.DIEM", matruong, nam);
            List <ChiTietDiemChuan> list = new List <ChiTietDiemChuan>();
            var dataTable = dataProvider.ExecuteQuery(sql);

            foreach (DataRow row in dataTable.Rows)
            {
                ChiTietDiemChuan chiTiet = new ChiTietDiemChuan();
                chiTiet.Diem     = float.Parse(row["Diem"].ToString());
                chiTiet.MaNganh  = row["MaNganh"].ToString();
                chiTiet.TenNganh = row["TenNganh"].ToString();
                chiTiet.KhoiThi  = row["KhoiThi"].ToString();
                list.Add(chiTiet);
            }
            return(list);
        }