Esempio n. 1
0
        public IHttpActionResult GetCustomerByUserName(string username = "")
        {
            IHttpActionResult result   = null;
            Customer          customer = null;

            GetLoginToken();
            if (airlineCompanyLoginToken == null)
            {
                return(Unauthorized());
            }
            FlyCenter = FlyingCenterSystem.GetInstance();
            ILoggedInAirlineFacade airlineFacade = FlyCenter.GetFacede(airlineCompanyLoginToken) as ILoggedInAirlineFacade;
            IList <Flight>         flights       = airlineFacade.GetAllFlightsByAirline(airlineCompanyLoginToken);

            if (username != "")
            {
                customer = airlineFacade.GetCustomerByUserName(airlineCompanyLoginToken, username);
                result   = Ok(customer);
            }
            else if ((username != "" && customer == null) || username == "")
            {
                result = NotFound();
            }
            return(result);
        }