Example #1
0
        /// <summary>
        /// Checks if the specified user name and password are valid
        /// </summary>
        /// <param name="userName">User name</param>
        /// <param name="password"></param>
        /// <returns></returns>
        public static bool IsUserValid(string userName, string password)
        {
            try
            {
                //Lookup user in database
                CustomerBusinessObject customerBO = new CustomerBusinessObject();
                int customerId = customerBO.Logon(userName, password);

                if (customerId != 0)
                {
                    return(true);                    //The user is valid
                }
                else
                {
                    return(false);                    //The user isnĀ“t valid
                }
            }
            catch
            {
                throw;
            }
        }
Example #2
0
        /// <summary>
        /// Gets the customer info
        /// </summary>
        /// <param name="logon">customer logon</param>
        /// <returns>customer info</returns>
        public CustomerDS.Customer GetCustomerByLogon(string logon)
        {
            CustomerBusinessObject bo = new CustomerBusinessObject();

            return(bo.GetCustomerByLogon(logon).Customers[0]);
        }