async Task SaveBehaviorAsync() { BehaviorModel Behavior_To_Add = new BehaviorModel { Id = Guid.NewGuid().ToString(), Name = Name, Active = true, Description = Description, Task = Type }; // adds patient to our patient collection PatientViewModel.StaticBehavior.Add(Behavior_To_Add); // gets our teacher id string patient_id = PatientViewModel.StaticPatient.Id; // creates new data base object to save our patient DatabaseCommunication DatabaseComm = new DatabaseCommunication(); await DatabaseComm.saveGenericModelUpdateRelationFinalTable <BehaviorModel, PatientBehaviorModel>(Behavior_To_Add, patient_id); // Clears the input so that user doesn't have to delete characters to add // another patient Name = ""; Description = ""; }
private async Task Initialize() { IsBusy = true; // Database communication object to interact with our database DatabaseCommunication database = new DatabaseCommunication(); if (Behavior.Task == "Duration") { await database.getGenericModelBatch <BehaviorDurationTaskModel, DurationTaskModel>(Behavior.Id); } if (Behavior.Task == "Frequency") { await database.getGenericModelBatch <BehaviorFrequencyTaskModel, FrequencyTaskModel>(Behavior.Id); } if (Behavior.Task == "PassFail") { await database.getGenericModelBatch <BehaviorPassFailTaskModel, PassFailTaskModel>(Behavior.Id); } //Tasks = await database.getGenericModelBatch<BehaviorSubcategoryModel, SubcategoryModel>(Behavior.Id); IsBusy = false; }
// Methods async Task SavePatientAsync() { PatientModel Patient_To_Add = new PatientModel { Id = Guid.NewGuid().ToString(), Name = Name, Age = Age, Gender = Gender.ToString() }; // adds patient to our patient collection TeacherViewModel.StaticPatients.Add(Patient_To_Add); // gets our teacher id string teacher_id = TeacherViewModel.StaticTeacher.Id; // save our patient model, and update relation table DatabaseCommunication DatabaseComm = new DatabaseCommunication(); await DatabaseComm.saveGenericModelUpdateRelation <PatientModel, TeacherPatientModel, PatientBehaviorModel>(Patient_To_Add, teacher_id); // Clears the input so that user doesn't have to delete characters to add // another patient Name = ""; Age = 0; //Gender = ""; }
// Methods async Task SaveTeacherAsync() { TeacherModel Therapist_To_Add = new TeacherModel { Id = Guid.NewGuid().ToString(), Name = Name, Age = Age, Gender = Gender }; /* * // adds patient to our patient collection * TeacherViewModel.StaticPatients.Add(Therapist_To_Add);*/ // save our patient model, and update relation table DatabaseCommunication DatabaseComm = new DatabaseCommunication(); await DatabaseComm.saveGenericModel <TeacherModel>(Therapist_To_Add); // Clears the input so that user doesn't have to delete characters to add // another patient Name = ""; Age = 0; Gender = ""; }
// constructor - sets up the initial state and servers/database repo without starting public GarageMediator() { DatabaseCommunication = GarageRepository.Instance; MicroCommunication = RS232ServerFactory.Instance.CreateServer() as RS232Server; RFIDCommunication = Parallax28140ServerFactory.Instance.CreateServer() as Parallax28140Server; MediatorListeningState.IDScanned += (sender, id) => IDScanned(sender, DatabaseCommunication.GetGarageAssignment(id), DatabaseCommunication.GetVehicleInformation(id)); State = new MediatorReadyState(); }
private async Task Initialize() { IsBusy = true; // Database communication object to interact with our database DatabaseCommunication database = new DatabaseCommunication(); Behavior = await database.getGenericModelBatch <PatientBehaviorModel, BehaviorModel>(Patient.Id); IsBusy = false; }
private async Task Initialize() { IsBusy = true; // Database communication object to interact with our database DatabaseCommunication database = new DatabaseCommunication(); Patients = await database.getGenericModelBatch <TeacherPatientModel, PatientModel>(Teacher.Id); IsBusy = false; }
private async Task Initialize() { IsBusy = true; // Database communication object to interact with our database DatabaseCommunication database = new DatabaseCommunication(); DurationTask = await database.getGenericModel <DurationTaskModel>(DurationTask.Id); Occurences.Add(DurationTask); IsBusy = false; }
private async Task Initialize() { IsBusy = true; // Database communication object to interact with our database DatabaseCommunication database = new DatabaseCommunication(); //foreach (var id in teacherIds) _teacher1 = await database.getGenericModel <TeacherModel>(Teacher1.Id); _teacher2 = await database.getGenericModel <TeacherModel>(Teacher2.Id); IsBusy = false; }
async Task SaveDurationTaskAsync() { DurationTaskModel DurationTask_To_Add = new DurationTaskModel { Id = Guid.NewGuid().ToString(), Name = "Occurence of Behavior", //Needs to be fixed with Occurence 1, Occurence 2, Occurence 3, etc. Time = Time }; DatabaseCommunication DatabaseComm = new DatabaseCommunication(); //Currently this is being manually seeded, however this needs to be fixed await DatabaseComm.saveGenericModelUpdateRelationFinalTable <DurationTaskModel, BehaviorDurationTaskModel>(DurationTask_To_Add, "5ae6bf42-0c11-468a-8176-e248850fd918"); // Clears the input so that user doesn't have to delete characters to add // another occurence of behavior Time = ""; }