public static int CreateMedicalEvent(MedicalEventBE medicalEvent, Guid createdUserId) { using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { MedicalEvent medicalEvent_db = new MedicalEvent(); medicalEvent_db.MedicalEventId_Parent = medicalEvent.MedicalEventId_Parent; medicalEvent_db.ProfesionalId = medicalEvent.ProfesionalId; medicalEvent_db.PatientId = medicalEvent.PatientId; medicalEvent_db.IdEspesialidad = medicalEvent.IdEspesialidad; medicalEvent_db.IdTipoConsulta = medicalEvent.IdTipoConsulta; medicalEvent_db.Motivo = medicalEvent.Motivo; medicalEvent_db.MetodoComplementario = medicalEvent.MetodoComplementario; medicalEvent_db.Evolucion = medicalEvent.Evolucion; medicalEvent_db.AppointmentId = medicalEvent.AppointmentId; medicalEvent_db.CreatedDate = System.DateTime.Now; medicalEvent_db.CreatedUserId = createdUserId; medicalEvent_db.HealthInstitutionId = medicalEvent.HealthInstitutionId; dc.MedicalEvents.AddObject(medicalEvent_db); dc.SaveChanges(); return medicalEvent_db.MedicalEventId; } }
/// <summary> /// Deprecated Method for adding a new object to the MedicalEvents EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToMedicalEvents(MedicalEvent medicalEvent) { base.AddObject("MedicalEvents", medicalEvent); }
/// <summary> /// Create a new MedicalEvent object. /// </summary> /// <param name="medicalEventId">Initial value of the MedicalEventId property.</param> /// <param name="patientId">Initial value of the PatientId property.</param> /// <param name="profesionalId">Initial value of the ProfesionalId property.</param> /// <param name="createdDate">Initial value of the CreatedDate property.</param> /// <param name="idEspesialidad">Initial value of the IdEspesialidad property.</param> /// <param name="isDefinitive">Initial value of the IsDefinitive property.</param> public static MedicalEvent CreateMedicalEvent(global::System.Int32 medicalEventId, global::System.Int32 patientId, global::System.Int32 profesionalId, global::System.DateTime createdDate, global::System.Int32 idEspesialidad, global::System.Boolean isDefinitive) { MedicalEvent medicalEvent = new MedicalEvent(); medicalEvent.MedicalEventId = medicalEventId; medicalEvent.PatientId = patientId; medicalEvent.ProfesionalId = profesionalId; medicalEvent.CreatedDate = createdDate; medicalEvent.IdEspesialidad = idEspesialidad; medicalEvent.IsDefinitive = isDefinitive; return medicalEvent; }