Exemplo n.º 1
0
        public IHttpActionResult UserRegistration(UserModel model)
        {
            int    res = 0;
            string otp = null;

            if (model != null)
            {
                var checkUserName = _userRegistrationBs.CheckUserName(model.UserName);
                if (checkUserName)
                {
                    apiResponse.Message = "UserName alreay exsist!";
                    return(Ok(apiResponse));
                }
                otp = GetOTPPassword();
                model.OTPPassword      = otp;
                model.OTPGeneratedTime = DateTime.Now;
                model.IsOTPCheck       = false;
                res = _userRegistrationBs.Save(model);
                new SendSMS().Send(model.Contact, "OTP is " + otp + " for Registration");
            }
            if (res != 0)
            {
                apiResponse.IsSuccess = true;
                apiResponse.Message   = "User Registered Successfully";
            }
            else
            {
                apiResponse.IsSuccess = false;
                apiResponse.Message   = "Registration Failed";
            }

            return(Ok(apiResponse));
        }
Exemplo n.º 2
0
        public ActionResult Create(UserModel model)
        {
            int i = 0;

            if (model != null)
            {
                i = _userRegistrationBs.Save(model);
            }

            if (i > 0)
            {
                TempData["msg"] = "Registered Successfully";
            }
            else
            {
                TempData["msg"] = " Not Registered ";
            }

            return(RedirectToAction("Index", "Login", new { area = "User" }));
        }