public static int UpdatePatientDetails(PatientDetailsModel patientDetailsModel) { return(SqlDataAccess.Save <PatientDetailsModel> ( @"UPDATE dbo.PatientDetails SET DateOfBirth = @DateOfBirth, Gender = @Gender, Ethnicity = @Ethnicity WHERE Id = @Id", patientDetailsModel )); }
public static int SavePatient(string nhsNumber, string password) { PatientModel data = new PatientModel { NHSNumber = nhsNumber, Password = password, }; return(SqlDataAccess.Save <PatientModel> ( @"INSERT into dbo.Patient (NHSNumber, Password) values (@NHSNumber, @Password);", data )); }
public static int DeletePatient(int id) { PatientModel patientModel = LoadPatient(id); if (patientModel == null) { return(0); } return(SqlDataAccess.Save <PatientModel> ( @"DELETE FROM dbo.Patient WHERE Id = @Id", patientModel )); }
public static int SaveClinician(string hcpId, string password) { ClinicianModel data = new ClinicianModel { HCPId = hcpId, Password = password }; return(SqlDataAccess.Save <ClinicianModel> ( @"INSERT into dbo.Clinician (HCPId, Password) values (@HCPId, @Password)", data )); }
public static int UpdatePatientPassword(int id, string newpassword) { PatientModel patientModel = LoadPatient(id); if (patientModel == null) { return(0); } patientModel.NewPassword = newpassword; return(SqlDataAccess.Save <PatientModel> ( @"UPDATE dbo.Patient SET Password = @NewPassword WHERE Id = @Id", patientModel )); }
public static int SavePatientDetails(int patientId, PatientDetailsModel patientDetailsModel) { int resultId = SqlDataAccess.SaveReturnId <PatientDetailsModel> ( @"INSERT into dbo.PatientDetails (DateOfBirth, Gender, Ethnicity) VALUES (@DateOfBirth, @Gender, @Ethnicity)", patientDetailsModel ); return(SqlDataAccess.Save <PatientModel> ( @"UPDATE dbo.Patient SET FK_PatientDetails_Id = @Details WHERE Id = @Id", new PatientModel { Id = patientId, Details = resultId } )); }
public static int UpdateClinician(string previousHcpId, string hcpId, string password) { ClinicianModel clinicianModel = GetClinicianByHCP(previousHcpId); if (clinicianModel == null) { return(0); } clinicianModel.HCPId = hcpId; clinicianModel.Password = password; return(SqlDataAccess.Save <ClinicianModel> ( @"UPDATE dbo.Clinician SET HCPId = @HCPId, Password = @Password WHERE Id = @Id", clinicianModel )); }