/*private static void init_cust_apoint() { foreach (Costumer c in Costumerslist) { c.getAllAppointments(); } }*/ public static void init_treatment()//מילוי המערך מתוך בסיס הנתונים { Treatmentslist = new List<Treatment>(); SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.Get_all_ListTreatments"; SQL_CON SC = new SQL_CON(); SqlDataReader rdr = SC.execute_query(c); while (rdr.Read()) { TreatmentTypes T = (TreatmentTypes)Enum.Parse(typeof(TreatmentTypes), rdr.GetValue(0).ToString()); Treatment t = new Treatment(T, int.Parse(rdr.GetValue(1).ToString()), int.Parse(rdr.GetValue(2).ToString())); Treatmentslist.Add(t); } }
public static void init_costumer()//מילוי המערך מתוך בסיס הנתונים { Costumerslist = new List<Costumer>(); SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.Get_all_ListCostumers"; SQL_CON SC = new SQL_CON(); SqlDataReader rdr = SC.execute_query(c); while (rdr.Read()) { Costumer co = new Costumer(int.Parse(rdr.GetValue(0).ToString()), rdr.GetValue(1).ToString(), int.Parse(rdr.GetValue(2).ToString())); Costumerslist.Add(co); } }
public static void init_payment()//מילוי המערך מתוך בסיס הנתונים { paymentslist = new List<Payment>(); SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.Get_all_ListPayments"; SQL_CON SC = new SQL_CON(); SqlDataReader rdr = SC.execute_query(c); while (rdr.Read()) { Appointment app = seekAppointment(Convert.ToInt32(rdr.GetValue(1).ToString())); PaymentOpt pa = (PaymentOpt)Enum.Parse(typeof(PaymentOpt), rdr.GetValue(3).ToString()); Payment p = new Payment(int.Parse(rdr.GetValue(0).ToString()), app, int.Parse(rdr.GetValue(2).ToString()), pa); paymentslist.Add(p); } }
public static void init_appointment()//מילוי המערך מתוך בסיס הנתונים { Appointmentslist = new List<Appointment>(); SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.Get_all_ListAppointments"; SQL_CON SC = new SQL_CON(); SqlDataReader rdr = SC.execute_query(c); while (rdr.Read()) { Costumer cr = seekCostumer(Convert.ToInt32(rdr.GetValue(2).ToString())); TreatmentTypes paa = (TreatmentTypes)Enum.Parse(typeof(TreatmentTypes), rdr.GetValue(1).ToString()); Treatment T = new Treatment(paa, getTreatmentLength(paa), getTreatmentPrice(paa)); Appointment api = new Appointment(int.Parse(rdr.GetValue(0).ToString()), T, cr, int.Parse(rdr.GetValue(3).ToString()), DateTime.Parse(rdr.GetValue(4).ToString()), false, rdr.GetValue(6).ToString()); Appointmentslist.Add(api); } }