コード例 #1
0
        public ActionResult ForgetPassword(ForgetPasswordModel forgetPasswordModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    MSMQModel result = bookBL.ForgetPassword(forgetPasswordModel);                   //getting the data from BusinessLayer
                    var       msmq   = new MSMQ(Configuration);
                    msmq.MSMQSender(result);
                    if (result != null)
                    {
                        return(this.Ok(new { Success = true, Message = "Your password has been forget sucessfully now you can reset your password" }));   //(smd format)    //this.Ok returns the data in json format
                    }

                    else
                    {
                        return(this.Ok(new { Success = true, Message = "Other User is trying to login from your account" }));   //(smd format)    //this.Ok returns the data in json format
                    }
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(new { Success = false, ex.Message }));
            }
        }