Example #1
0
 public static Clinician Convert(ClinicianModel clinicianModel)
 {
     return(new Clinician
     {
         HCPId = clinicianModel.HCPId,
         ClinicianPassword = clinicianModel.Password
     });
 }
Example #2
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 #3
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
                   ));
        }
Example #4
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);
        }
Example #5
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
                   ));
        }
Example #6
0
 public static void Login(ISession session, ClinicianModel clinician)
 {
     session.Set(LOGIN_STATUS, new byte[] { (byte)UserType.Clinician });
     session.Set(LOGIN_ID, BitConverter.GetBytes(clinician.Id));
 }