Пример #1
0
        public static bool UpdateUsername(User user)
        {
            bool result      = false;
            bool checkout    = false;
            User usersvalues = new User();

            try
            {
                usersvalues = UserConnectionClass.SelectUserbyEmail(Program.userELoginQuery, user);

                checkout = usersvalues.DataV;
                if (checkout)
                {
                    result = UserConnectionClass.UpdateUserUsername(Program.userUpdateQueryUsername, user);
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                //Debug.Write(ex);
                result = false;
            }

            return(result);
        }
Пример #2
0
        public static bool InsertUser(User user)
        {
            bool result      = false;
            bool checkout    = true;
            User usersvalues = new User();

            try
            {
                usersvalues = UserConnectionClass.SelectUser(Program.userLoginQuery, user);

                checkout = (bool)usersvalues.DataV;
                if (!checkout)
                {
                    result = UserConnectionClass.CreateUser(Program.userInsertIntoQuery, user);
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex) {
                //Debug.Write(ex);
                result = false;
            }

            return(result);
        }
Пример #3
0
        public static bool UpdatePassword(User user, string newpassword)
        {
            bool result      = false;
            bool checkout    = false;
            User usersvalues = new User();

            try
            {
                usersvalues = UserConnectionClass.SelectUser(Program.userLoginQuery, user);

                checkout = usersvalues.DataV;
                if (checkout)
                {
                    user.Password = newpassword;

                    result = UserConnectionClass.UpdateUserPassword(Program.userUpdateQueryPassword, user);
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                //Debug.Write(ex);
                result = false;
            }

            return(result);
        }
Пример #4
0
        public static User SelectUserMail(User user)
        {
            User usersvalues = new User();

            try
            {
                usersvalues = UserConnectionClass.SelectUserbyEmail(Program.userELoginQuery, user);
            }
            catch (Exception ex)
            {
                //Debug.Write(ex);
            }

            return(usersvalues);
        }