示例#1
0
        /// <summary>
        /// Crea Patient y persona
        /// </summary>
        /// <param name="PatientBE"></param>
        public static void Create(PatientBE PatientBE)
        {

            PersonasDAC.Create(PatientBE.Persona);

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

                Patient p = new Patient();
                p.IdPersona = PatientBE.Persona.IdPersona;
                p.FechaAlta = PatientBE.Persona.FechaAlta;
                p.LastAccessTime = p.FechaAlta;
                p.LastAccessUserId = PatientBE.LastAccessUserId;

                dc.Patients.AddObject(p);
                dc.SaveChanges();
                PatientBE.PatientId = p.PatientId;
                PatientBE.IdPersona = p.IdPersona;
            }
            Create_PlanVacunacion(PatientBE);
        }
示例#2
0
 /// <summary>
 /// Create a new Patient object.
 /// </summary>
 /// <param name="patientId">Initial value of the PatientId property.</param>
 /// <param name="idPersona">Initial value of the IdPersona property.</param>
 /// <param name="fechaAlta">Initial value of the FechaAlta property.</param>
 public static Patient CreatePatient(global::System.Int32 patientId, global::System.Int32 idPersona, global::System.DateTime fechaAlta)
 {
     Patient patient = new Patient();
     patient.PatientId = patientId;
     patient.IdPersona = idPersona;
     patient.FechaAlta = fechaAlta;
     return patient;
 }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Patients EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPatients(Patient patient)
 {
     base.AddObject("Patients", patient);
 }
示例#4
0
        /// <summary>
        /// crea un Patient asociandolo a una persona existente
        /// </summary>
        /// <param name="PatientBE"></param>
        public static void Asociar(PatientBE PatientBE)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                Patient p = new Patient();
                p.IdPersona = PatientBE.Persona.IdPersona;
                p.FechaAlta = System.DateTime.Now;
                p.LastAccessTime = p.FechaAlta;
                p.LastAccessUserId = PatientBE.LastAccessUserId;

                dc.Patients.AddObject(p);
                dc.SaveChanges();
                PatientBE.PatientId = p.PatientId;
            }
            
        }