Esempio n. 1
0
 public HttpResponseMessage SignUp(UserLoginVM _userLogin)
 {
     try
     {
         _userLogin.Password = Common.EncryptedPassword(_userLogin.Password);
         UserLoginVM _UserLoginVM = _userBLL.SignUp(_userLogin);
         if (_UserLoginVM != null && _UserLoginVM.UserName == "UserInvalid")
         {
             String _FailureCode = String.Empty;
             _Message        = "\"message\":\"Username already exists.\",";
             _strJSONContent = Common.FailureResponseRequest(_FailureCode, _Message);
         }
         else if (_UserLoginVM != null && _UserLoginVM.Email == "EmailInvalid")
         {
             String _FailureCode = String.Empty;
             _Message        = "\"message\":\"Email Address already exists.\",";
             _strJSONContent = Common.FailureResponseRequest(_FailureCode, _Message);
         }
         else
         {
             String _SuccessCode = "103";
             _Message = "\"message\":\"Successfully Registered.\",";
             JSONSuccessResult(_UserLoginVM, _SuccessCode, _UserLoginVM.HeaderToken);
         }
     }
     catch (Exception ex)
     {
         _Message = ex.Message;
         _strJSONContent.Append("{\"status\":\"Failed\"}");
     }
     return(Common.ResponseOutput(_strJSONContent));
 }
Esempio n. 2
0
        public HttpResponseMessage SignUp(UserLoginVM _userLogin)
        {
            UserLoginVM _UserVM = _userBLL.SignUp(_userLogin);

            if (_UserVM != null && _UserVM.UserName == "UserInvalid")
            {
                String _FailureCode = "";
                String _Message     = "\"message\":\"Username already exists.\",";
                _success        = false;
                _strJSONContent = User_BLL.FailureResponseRequest(_FailureCode, _Message);
            }
            else if (_UserVM != null && _UserVM.Email == "EmailInvalid")
            {
                String _FailureCode = "";
                String _Message     = "\"message\":\"Email Address already exists.\",";
                _success        = false;
                _strJSONContent = User_BLL.FailureResponseRequest(_FailureCode, _Message);
            }
            else
            {
                String _JSONData    = new JavaScriptSerializer().Serialize(_UserVM);
                String _SuccessCode = "103";
                String _Message     = "\"message\":\"Successfully Registered.\",";
                _strJSONContent = User_BLL.GenerateReturnJSONData(_UserVM.HeaderToken, _JSONData, _SuccessCode, _Message);
            }
            return(ResponseOutput());
        }