Exemple #1
0
        public IHttpActionResult AddNewCustomerToRedis([FromBody] Customer customer)
        {
            bool redisBool = false;

            redisBool = Redis.RedisSaveNewCustomer("localhost", customer.UserName, customer);
            FCS       = FlyingCenterSystem.GetInstance();
            IAnonymousUserFacade af = FCS.GetFacade(null) as AnonymousUserFacade;

            if (redisBool == false)
            {
                return(NotFound());
            }
            guideForAuth = Guid.NewGuid().ToString();
            NewUser customerUser = new NewUser {
                UserNAME = customer.UserName, Email = customer.Email, Guid = guideForAuth, Type = "customer"
            };

            af.AddNewUser(customerUser);
            SendEmail(customer.Email, customer.FirstName, guideForAuth);
            return(Ok(redisBool));
        }
Exemple #2
0
        public IHttpActionResult AddNewAirlineToRedis([FromBody] AirLineCompany airline)
        {
            bool redisBool = false;

            //var jsonStringAccount = Newtonsoft.Json.JsonConvert.SerializeObject(airline);
            redisBool = Redis.RedisSaveNewAirline("localhost", airline.UserName, airline);
            FCS       = FlyingCenterSystem.GetInstance();
            IAnonymousUserFacade af = FCS.GetFacade(null) as AnonymousUserFacade;

            if (redisBool == false)
            {
                return(NotFound());
            }
            guideForAuth = Guid.NewGuid().ToString();
            NewUser airlinerUser = new NewUser {
                UserNAME = airline.UserName, Email = airline.Email, Guid = guideForAuth, Type = "airline"
            };

            af.AddNewUser(airlinerUser);
            SendEmail(airline.Email, airline.AirLineName, guideForAuth);
            return(Ok(redisBool));
        }