Exemple #1
0
 public static int UpdatePatientDetails(PatientDetailsModel patientDetailsModel)
 {
     return(SqlDataAccess.Save <PatientDetailsModel>
            (
                @"UPDATE dbo.PatientDetails
             SET DateOfBirth = @DateOfBirth, Gender = @Gender, Ethnicity = @Ethnicity
             WHERE Id = @Id",
                patientDetailsModel
            ));
 }
Exemple #2
0
        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
                   ));
        }
Exemple #3
0
        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
                   ));
        }
Exemple #4
0
        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
                   ));
        }
Exemple #5
0
        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
                   ));
        }
Exemple #6
0
        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
            }
                   ));
        }
Exemple #7
0
        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
                   ));
        }