Example #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the PatientMedicaments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPatientMedicaments(PatientMedicament patientMedicament)
 {
     base.AddObject("PatientMedicaments", patientMedicament);
 }
Example #2
0
        public static void AddPatientMedicaments(PatientMedicament_ViewBE patientMedicament_View, Guid createdUserId)
        {
            
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {

                PatientMedicament patientMedicament_db = new PatientMedicament();

                patientMedicament_db.Status = patientMedicament_View.Status;
                
                patientMedicament_db.MedicalEventId = patientMedicament_View.MedicalEventId;
                patientMedicament_db.PatientId = patientMedicament_View.PatientId;
                if(patientMedicament_View.PatientMedicamentId_Parent >=0)
                    patientMedicament_db.PatientMedicamentId_Parent = patientMedicament_View.PatientMedicamentId_Parent;

                patientMedicament_db.MedicamentName = patientMedicament_View.MedicamentName;
                patientMedicament_db.MedicamentPresentation = patientMedicament_View.MedicamentPresentation;
                patientMedicament_db.Dosis = patientMedicament_View.Dosis;
                patientMedicament_db.Periodicity_hours = patientMedicament_View.Periodicity_hours;
                patientMedicament_db.CreatedDate = System.DateTime.Now;
                patientMedicament_db.CreatedUserId = createdUserId;
                patientMedicament_db.DaysCount = patientMedicament_View.DaysCount;
                patientMedicament_db.Enabled = true;
                dc.PatientMedicaments.AddObject(patientMedicament_db);
                dc.SaveChanges();
            }
            
        }
Example #3
0
 /// <summary>
 /// Create a new PatientMedicament object.
 /// </summary>
 /// <param name="patientMedicamentId">Initial value of the PatientMedicamentId property.</param>
 /// <param name="patientId">Initial value of the PatientId property.</param>
 /// <param name="createdDate">Initial value of the CreatedDate property.</param>
 /// <param name="createdUserId">Initial value of the CreatedUserId property.</param>
 /// <param name="medicamentName">Initial value of the MedicamentName property.</param>
 /// <param name="periodicity_hours">Initial value of the Periodicity_hours property.</param>
 /// <param name="daysCount">Initial value of the DaysCount property.</param>
 /// <param name="medicalEventId">Initial value of the MedicalEventId property.</param>
 /// <param name="medicamentPresentation">Initial value of the MedicamentPresentation property.</param>
 /// <param name="enabled">Initial value of the Enabled property.</param>
 /// <param name="dosis">Initial value of the Dosis property.</param>
 /// <param name="status">Initial value of the Status property.</param>
 public static PatientMedicament CreatePatientMedicament(global::System.Int32 patientMedicamentId, global::System.Int32 patientId, global::System.DateTime createdDate, global::System.Guid createdUserId, global::System.String medicamentName, global::System.Int16 periodicity_hours, global::System.Int16 daysCount, global::System.Int32 medicalEventId, global::System.String medicamentPresentation, global::System.Boolean enabled, global::System.String dosis, global::System.Int32 status)
 {
     PatientMedicament patientMedicament = new PatientMedicament();
     patientMedicament.PatientMedicamentId = patientMedicamentId;
     patientMedicament.PatientId = patientId;
     patientMedicament.CreatedDate = createdDate;
     patientMedicament.CreatedUserId = createdUserId;
     patientMedicament.MedicamentName = medicamentName;
     patientMedicament.Periodicity_hours = periodicity_hours;
     patientMedicament.DaysCount = daysCount;
     patientMedicament.MedicalEventId = medicalEventId;
     patientMedicament.MedicamentPresentation = medicamentPresentation;
     patientMedicament.Enabled = enabled;
     patientMedicament.Dosis = dosis;
     patientMedicament.Status = status;
     return patientMedicament;
 }