Пример #1
0
 public static IList<University> GetList()
 {
     Universiteties db = new Universiteties();
     return db.GetList();
 }
Пример #2
0
 private static void AddToDb()
 {
     System.Collections.Generic.List<University> univ = new System.Collections.Generic.List<University>();
     StringBuilder str = new StringBuilder("", 100);
     int lastID = GetLastId();
     University buf = Get(lastID.ToString());
     Regex newReg = new Regex(@">+[^<]+</a");
     int i = 0;
     int b = 0;
     string sId = (Convert.ToInt32(buf.StateID) + 1).ToString();
     MatchCollection matches = newReg.Matches("");
     foreach (Match mat in matches)
     {
         buf.StateID = sId;
         str.Append(mat.Value);
         str.Remove(0, 1);
         b = str.Length;
         str.Remove((b - 3), 3);
         buf.Name = str.ToString();
         i++;
         buf.UniversityID = (i + lastID).ToString();
         str.Remove(0, str.Length);
         univ.Add(buf);
         buf = new University();
     }
     List<University> univer = new List<University>(univ);
     Universiteties db = new Universiteties();
     db.AddList(univer);
 }
Пример #3
0
 public static University Get(string id)
 {
     Universiteties db = new Universiteties();
     return db.Get(id);
 }