public static Clinician Convert(ClinicianModel clinicianModel) { return(new Clinician { HCPId = clinicianModel.HCPId, ClinicianPassword = clinicianModel.Password }); }
public static ClinicianModel GetClinicianByHCP(string hcpId) { ClinicianModel data = new ClinicianModel { HCPId = hcpId }; return(SqlDataAccess.LoadSingle <ClinicianModel> ( @"SELECT * FROM dbo.Clinician WHERE HCPId = @HCPId", data )); }
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 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); }
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 )); }
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)); }