Ejemplo n.º 1
0
        public HttpResponseMessage SendConfirmCode(SendConfirmCodeQuery query)
        {
            var codeVM = service.SendConfirmCode(query);

            if (codeVM.Messages.Count == 0)
            {
                HttpContext.Current.Session.Add("ConfirmCode", codeVM.Code);
            }
            codeVM.Code = "";
            return(Request.CreateResponse(HttpStatusCode.OK, codeVM));
        }
Ejemplo n.º 2
0
        public ConfirmCodeViewModel SendConfirmCode(SendConfirmCodeQuery query)
        {
            ConfirmCodeViewModel vm = new ConfirmCodeViewModel();

            if (!validator.UserExists(query.UserName, vm))
            {
                string code = System.IO.Path.GetRandomFileName().Replace(".", "").Substring(0, 8);
                vm.Code = code;
                EmailHandler emailHandler = new EmailHandler(true);
                emailHandler.Send(new List <string> {
                    query.Email
                }, "Cherries - User Confirmation", GetConfirmationCodeMail(code, query.UserName));
            }

            return(vm);
        }
Ejemplo n.º 3
0
        public ConfirmCodeViewModel SendConfirmCode(SendConfirmCodeQuery query)
        {
            ConfirmCodeViewModel code = userBL.SendConfirmCode(query);

            return(code);
        }