Exemplo n.º 1
0
 public void SaveData()
 {
     using (var context = new MedicalDataManagerDataBaseContainer())
     {
         Device actDevice = new Device();
         actDevice.Id = this.DeviceId;
         actDevice.NbrOfCompartments = this.CompartmentNbr;
         context.Devices.Add(actDevice);
         context.SaveChanges();
     }
 }
Exemplo n.º 2
0
        public void SaveData()
        {
            MedicationPlan medPlan = new MedicationPlan();

            medPlan.TokenId        = SelectedToken.Id;
            medPlan.CompartmentNbr = Compartment;
            medPlan.Critical       = Critical;
            medPlan.DeviceId       = SelectedDevice.Id;
            medPlan.DosageId       = SelectedDosage.Id;
            medPlan.ValidFrom      = ValidFrom;
            medPlan.Validto        = ValidTo;
            using (var context = new MedicalDataManagerDataBaseContainer())
            {
                context.MedicationPlans.Add(medPlan);
                context.SaveChanges();
            }
        }