Пример #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Appointments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAppointments(Appointment appointment)
 {
     base.AddObject("Appointments", appointment);
 }
Пример #2
0
 /// <summary>
 /// Create a new Appointment object.
 /// </summary>
 /// <param name="appointmentId">Initial value of the AppointmentId property.</param>
 /// <param name="isExceptional">Initial value of the IsExceptional property.</param>
 public static Appointment CreateAppointment(global::System.Int32 appointmentId, global::System.Boolean isExceptional)
 {
     Appointment appointment = new Appointment();
     appointment.AppointmentId = appointmentId;
     appointment.IsExceptional = isExceptional;
     return appointment;
 }
Пример #3
0
        public static void Create_Appointments(AppointmentList appointmentList, Guid userId)
        {
            Appointment a = null;
            DateTime creationDate = System.DateTime.Now;

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {

                foreach (AppointmentBE abe in appointmentList)
                {
                    a = new Appointment();
                    a.ProfesionalAppointment = new ProfesionalAppointment();
                    a.CreationDate = creationDate;
                    
                    a.CreationUserId = userId;
                    a.Description = abe.Description;
                    a.Duration = abe.Duration;
                    a.Start = abe.Start;
                    a.End = abe.End;
                    
                    a.ResourceId = abe.ResourceId;
                    a.HealthInstitutionId = abe.HealthInstitutionId;
                    a.ProfesionalAppointment.PatientId = abe.ProfesionalAppointment.PatientId;
                    a.ProfesionalAppointment.PatientName = abe.ProfesionalAppointment.PatientName;
                    a.ProfesionalAppointment.IdMotivoConsulta = abe.ProfesionalAppointment.IdMotivoConsulta;
                    a.ProfesionalAppointment.RoomId = abe.ProfesionalAppointment.RoomId;
                    a.Location = abe.Location;
                    a.Status = abe.Status;
                    a.Label = abe.Label;
                    a.Subject = abe.Subject;


                    a.WeekDays = abe.WeekDays;
                    a.WeekOfMonth = abe.WeekOfMonth;
                    a.IsExceptional = abe.IsExceptional;
                    dc.Appointments.AddObject(a);
                }
                dc.SaveChanges();
            }
          
        }