Пример #1
0
 public static void init_Materials()
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_materials";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     Materials = new List<Material>();
     while (rdr.Read())
     {
         Material m = new ActivityRoom(int.Parse(rdr.GetValue(0).ToString()), rdr.GetValue(1).ToString());
         Materials.Add(m);
     }
 }
Пример #2
0
 public static void init_Activities()
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_activities";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     Activities = new List<Activity>();
     while (rdr.Read())
     {
         Activity a = new ActivityRoom(int.Parse(rdr.GetValue(0).ToString()), rdr.GetValue(1).ToString(), int.Parse(rdr.GetValue(2).ToString()), int.Parse(rdr.GetValue(3).ToString()), rdr.GetValue(4).ToString());
         Activities.Add(a);
     }
 }
Пример #3
0
 public static void init_Employees()//מילוי המערך מתוך בסיס הנתונים
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_employees";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     Employees = new List<Employee>();
     while (rdr.Read())
     {
         Employee e = new Employee(rdr.GetValue(0).ToString(), rdr.GetValue(1).ToString(), rdr.GetValue(2).ToString(), rdr.GetValue(3).ToString(), rdr.GetValue(4).ToString(), int.Parse(rdr.GetValue(5).ToString()));
         Employees.Add(e);
     }
 }
Пример #4
0
 public static void init_TechnicalFailures()
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_technicalFailure";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     TechnicalFailures = new List<TechnicalFailure>();
     while (rdr.Read())
     {
         TechnicalFailure tf = new ActivityRoom(int.Parse(rdr.GetValue(0).ToString()), DateTime.Parse((rdr.GetValue(1).ToString())), DateTime.Parse((rdr.GetValue(2).ToString())), int.Parse(rdr.GetValue(3).ToString());
         TechnicalFailures.Add(tf);
     }
 }
Пример #5
0
 public static void init_EmbedEmployeesToActivities()
 {
     SqlCommand c = new SqlCommand();
     c.CommandText = "EXECUTE dbo.Get_all_embedEmployeesToActivities";
     SQL_CON SC = new SQL_CON();
     SqlDataReader rdr = SC.execute_query(c);
     EmbedEmployeesToActivities = new List<EmbedEmployeeToActivity>();
     while (rdr.Read())
     {
         EmbedEmployeeToActivity eetar = new ActivityRoom(int.Parse(rdr.GetValue(0).ToString()), DateTime.Parse((rdr.GetValue(1).ToString())), DateTime.Parse((rdr.GetValue(2).ToString())), int.Parse(rdr.GetValue(3).ToString()), int.Parse(rdr.GetValue(4).ToString()));
         EmbedEmployeesToActivities.Add(eetar);
     }
 }