public Payment(int paymentnum, Appointment p, int sum, PaymentOpt payopt) { this.paymentnum = paymentnum; this.appointments_Payments = p; this.sum = sum; this.payopt = payopt; }
/// <summary> /// Add a new Appointment in the collection /// </summary> /// <pdGenerated>Default Add</pdGenerated> public void AddAppointments_costumer(Appointment newAppointment) { if (newAppointment == null) return; if (this.appointments_costumer == null) this.appointments_costumer = new List<Appointment>(); if (!this.appointments_costumer.Contains(newAppointment)) { this.appointments_costumer.Add(newAppointment); newAppointment.Costumers_Appointments = this; } }
/// <summary> /// Remove an existing Appointment from the collection /// </summary> /// <pdGenerated>Default Remove</pdGenerated> public void RemoveAppointments_costumer(Appointment oldAppointment) { if (oldAppointment == null) return; if (this.appointments_costumer != null) if (this.appointments_costumer.Contains(oldAppointment)) { this.appointments_costumer.Remove(oldAppointment); oldAppointment.Costumers_Appointments = null; } }
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); } }