示例#1
0
        public LocationSelectorForm()
        {
            InitializeComponent();

            mLocationSelectorForm = this;

            this.btnAdminPanel.Visible = Form1.mLoggedInUser.IsAdmin;

            this.label1.Text = "Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }
示例#2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string userName = this.tbxUserName.Text;
            string password = this.tbxPassword.Text;

            AppUser loggedInUser = (from user in mUsers
                                    where user != null && user.UserName == userName && user.Password == password
                                    select user).FirstOrDefault();

            if (loggedInUser == null)
            {
                MessageBox.Show(this, "Either username or password is incorrect.");
            }
            else
            {
                mLoggedInUser = loggedInUser;

                LocationSelectorForm lsf = new LocationSelectorForm();

                lsf.Show();

                this.Hide();
            }
        }