Example #1
0
        public bool Login(string username, string password)
        {
            dbConnect con  = new dbConnect();
            clsUsers  user = con.Login(username, password);

            con.Close();
            if (user.UserName != "")
            {
                _UserId       = user.UserId;
                _UserName     = user.UserName;
                _Password     = user.Password;
                _LoginType    = user.LoginType;
                _Enabled      = user.Enabled;
                _LogInAttempt = user.LogInAttempt;
                if (_Enabled)
                {
                    return(true);
                }
            }
            return(false);
        }
Example #2
0
        public static bool GetApproval(clsUsers m_user, UserAccess accesslevel = UserAccess.Cashier)
        {
            if (m_user.LoginType <= (int)accesslevel)
            {
                return(true);
            }
            else
            {
                frmApproval login = new frmApproval((int)accesslevel);
                if (login.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    clsUsers iuser = login.m_User;
                    if (iuser.LoginType <= (int)accesslevel)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }