public static void DeletePatientDrugModel(PatientDrugModel patientDrugModel) { using (SQLite.SQLiteConnection connection = new SQLite.SQLiteConnection(patientDrugModelDatabasePath)) { connection.CreateTable <PatientDrugModel>(); connection.Delete(patientDrugModel); } }
public static void AddPatientDrugModel(PatientModel patientModel, DrugModel drugModel, string desiredStrength) { // Explicitly setting the informationt that will be sent to the server PatientDrugModel patientDrugModel = new PatientDrugModel(); patientDrugModel.DrugName = drugModel.DrugName; patientDrugModel.GeneralPurpose = drugModel.GeneralUse; patientDrugModel.DateAddedToProfile = DateTime.Now.ToString("MMMM dd, yyyy"); patientDrugModel.LastUpdate = DateTime.Now.ToString("MMMM dd, yyyyy"); patientDrugModel.PatientId = patientModel.Id; patientDrugModel.DrugStrength = desiredStrength; using (SQLite.SQLiteConnection connection = new SQLite.SQLiteConnection(patientDrugModelDatabasePath)) { connection.CreateTable <PatientDrugModel>(); connection.Insert(patientDrugModel); } }