Exemplo n.º 1
0
        public IHttpActionResult ConfirmEmail([FromUri] string guid)
        {
            ConfirmedUser user = null;

            FCS = FlyingCenterSystem.GetInstance();
            IAnonymousUserFacade af = FCS.GetFacade(null) as AnonymousUserFacade;

            user = af.ConfirmMyEmail(guid);

            if (user.UserName == null)
            {
                return(NotFound());
            }
            if (user.EmailCon == "was already confirmed")
            {
                return(Ok(user.EmailCon));
            }
            if (user.Type == "customer")
            {
                Customer newCustomer = Redis.RedisGetCustomer("localhost", user.UserName);
                newCustomer.ID = af.AddCustomerToData(newCustomer);

                return(Ok($"{user.UserName} was confirmed"));
            }

            AirLineCompany airline = Redis.RedisGetAirline("localhost", user.UserName);

            return(Ok($"{user.UserName} was confirmed one of our admins will get back to you. thank you!"));
        }