public LocationSelectorForm() { InitializeComponent(); mLocationSelectorForm = this; this.btnAdminPanel.Visible = Form1.mLoggedInUser.IsAdmin; this.label1.Text = "Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
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(); } }