public HttpResponseMessage SignUpByEmail(SignUpByEmailRequestModel requestModel)
        {
            requestModel = new SignUpByEmailRequestModel
            {
                Email = "*****@*****.**",
                Password = "******",
                ConfirmPassword = "******",
                Profession = "Doctor",
                FirstName = "Hammad",
                LastName = "Shabbir"
            };


            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Invalid SignUp request");
            }

            AuthenActions authenActions = new AuthenActions();
            SignUpByEmailResponseModel responseModel = authenActions.SignUpByEmail(requestModel);

            if (responseModel.Error != null)
            {
                return Request.CreateErrorResponse(HttpStatusCode.OK, responseModel.Error);
            }

            return Request.CreateResponse(HttpStatusCode.OK, responseModel, "application/json");
        }
Esempio n. 2
0
        /// <summary>
        /// Validatiing Data and Add user
        /// </summary>
        /// <param name="requestModel"></param>
        /// <returns></returns>
        #region SingUpByEmail
        public SignUpByEmailResponseModel SignUpByEmail(SignUpByEmailRequestModel requestModel)
        {
            SignUpByEmailResponseModel responseModel = new SignUpByEmailResponseModel();
            
            //InputValidator validator = new InputValidator();
            //if (!validator.ValidateEmail(requestModel.Email) ||
            //    !validator.ValidatePassword(requestModel.Password, requestModel.ConfirmPassword) ||
            //    !validator.ValidateProfession(requestModel.Profession))
            //{
            //    responseModel.IsValid = false;
            //    return responseModel;
            //}


            //PharmaGuide.Repository.UserProfileRepo userRepo = new PharmaGuide.Repository.UserProfileRepo();
            //EnumTypes.AddUserBYEmailResponse AddUserResponse = userRepo.AddUserByEmail(requestModel.Email, requestModel.Password, requestModel.Profession, requestModel.FirstName , requestModel.LastName);

            //if (AddUserResponse == EnumTypes.AddUserBYEmailResponse.EmailAlreadyExist)
            //{
            //    responseModel.IsValid = true;
            //    responseModel.Error = "A user with the given Email Address is already signed up.";
            //    return responseModel;
            //}

            //else if(AddUserResponse == EnumTypes.AddUserBYEmailResponse.UnableToAddEmail)
            //{
            //    responseModel.IsValid = true;
            //    responseModel.Error = "Unable to add User";
            //    return responseModel;
            //}

            //else if(AddUserResponse == EnumTypes.AddUserBYEmailResponse.DataAddedSuccessfully)
            //{
            //    responseModel.IsValid = true;
            //    responseModel.Error = null;
            //    return responseModel;
            //}

            responseModel.IsValid = true;
            responseModel.Error = "Something Wrong";
            return responseModel;
        }
 public SignUpByEmailResponseModel SignUpByEmail(SignUpByEmailRequestModel requestModel)
 {
     AuthenCase authenCase = new AuthenCase();
     return authenCase.SignUpByEmail(requestModel);
 }