public int ResetPassword(ReqResetPassword objResetPassword)
 {
     objDBMethod = new DBMethod();
     int retValue = objDBMethod.ResetPassword(objResetPassword);
     return retValue;
 }
Exemplo n.º 2
0
        // To reset Password

        internal int ResetPassword(ReqResetPassword objResetPassword)
        {
            try
            {
                using (var db = new WizzDataContext())
                {
                    tblUser userData = new tblUser();
                    userData = db.tblUsers.Where(e => e.guid.ToString() == objResetPassword.userEmail).FirstOrDefault();
                    if (userData != null)
                    {
                        if (userData.isPasswordChanged == true)
                        {
                            userData.isPasswordChanged = false;
                            userData.password = objResetPassword.password.Trim();
                            db.SubmitChanges();
                            return 1;
                        }
                        else
                        {

                            return 0;
                        }

                    }
                    else
                    {
                        return 0;
                    }
                }
            }
            catch (Exception ex)
            {
                return -1;
            }
        }