Example #1
0
 public static PatientModel LoadPatient(int patientId)
 {
     return(SqlDataAccess.LoadSingle <PatientModel>
            (
                @"SELECT Id, NHSNumber, Password, FK_PatientDetails_Id as Details FROM dbo.Patient
             WHERE Id = @Id",
                new PatientModel {
         Id = patientId
     }
            ));
 }
Example #2
0
 public static PatientDetailsModel LoadPatientDetails(int id)
 {
     return(SqlDataAccess.LoadSingle <PatientDetailsModel>
            (
                @"SELECT * FROM dbo.PatientDetails
             WHERE Id = @Id",
                new PatientDetailsModel {
         Id = id
     }
            ));
 }
Example #3
0
        public static ClinicianModel GetClinicianByHCP(string hcpId)
        {
            ClinicianModel data = new ClinicianModel
            {
                HCPId = hcpId
            };

            return(SqlDataAccess.LoadSingle <ClinicianModel>
                   (
                       @"SELECT * FROM dbo.Clinician
                    WHERE HCPId = @HCPId",
                       data
                   ));
        }
Example #4
0
        public static AdminModel AuthoriseAdmin(string username, string password)
        {
            AdminModel data = new AdminModel
            {
                Username = username,
                Password = password
            };

            AdminModel adminModel = SqlDataAccess.LoadSingle <AdminModel>
                                    (
                @"SELECT Id, Username, Password FROM dbo.Admin
                    WHERE Username = @Username AND Password = @Password",
                data
                                    );

            return(adminModel);
        }
Example #5
0
        public static ClinicianModel AuthoriseClinician(string hcpId, string password)
        {
            ClinicianModel data = new ClinicianModel
            {
                HCPId    = hcpId,
                Password = password
            };

            ClinicianModel clinicianModel = SqlDataAccess.LoadSingle <ClinicianModel>
                                            (
                @"SELECT Id, HCPId, Password FROM dbo.Clinician
                    WHERE HCPId = @HCPId AND Password = @Password",
                data
                                            );

            return(clinicianModel);
        }