public PatientsController(AppDb newDb) { Db = newDb; orgService = new OrganisationServices(Db); depService = new DepartmentServices(Db); patService = new PatientServices(Db); }
public AppInfoController(AppDb newDb) { Db = newDb; orgService = new OrganisationServices(Db); depService = new DepartmentServices(Db); patService = new PatientServices(Db); queueCalc = new QueuePositionCalculator(); }
public IActionResult LogIn([FromBody] LoginRequest request) { OrganisationServices orgService = new OrganisationServices(Db); try { var org = orgService.FindByRegNrAndPassKey(request.registrationNr, request.passKey); if (org != null) { return(Ok(orgService.RegisterNewLogin(org))); } } catch (MySqlException mySql) { System.Console.WriteLine("Developer Mode: " + mySql.Message); return(StatusCode(500, new GenericResponse("Error!", "Please contact the administration"))); } catch (QueryFailedException update) { System.Console.WriteLine("Developer Mode: " + update.Message); return(BadRequest(new GenericResponse("Error!", "Please contact the administration"))); } return(Unauthorized(new GenericResponse("Error!", "Invalid login credentials!"))); }