예제 #1
0
 internal void setLoggedIn(User logged)
 {
     LoggedIn = logged;
     FAM.FromGameFile(FAM.FindUserLocation(LoggedIn.UserName) + "\\uGameLibrary.txt", LoggedIn.gameLibrary);
     this.WelcomeLabel.Text = "Welcome back, " + LoggedIn.IGName;
     this.UserFunds.Text    = string.Format("{0:C}", (LoggedIn.Funds));
 }
예제 #2
0
        public void loggingIn()
        {
            string           username = this.UsernameBox.Text;
            string           password = this.PasswordBox.Text;
            FileAccessModule FAM      = new FileAccessModule();

            if (!FAM.checkUser(username, password))
            {
                this.LogInWarning.Text    = "Invalid Login Credentials";
                this.LogInWarning.Visible = true;
                wait(1500);
                this.LogInWarning.Visible = false;
            }
            else
            {
                //Check user came positive
                //we can search it now
                this.LogInWarning.Text    = "Successful Login. Please Wait.";
                this.LogInWarning.Visible = true;
                wait(2000);
                this.LogInWarning.Visible = false;
                Console.WriteLine();
                loggedIn = FAM.readUserFile(FAM.FindUserLocation(username) + "\\User.txt");

                Welcomepage = new WelcomePage(this);
                Welcomepage.StartPosition = FormStartPosition.Manual;
                Welcomepage.Left          = this.Location.X;
                Welcomepage.Top           = this.Location.Y;
                Welcomepage.Location      = this.Location;
                Welcomepage.SetDesktopLocation(this.Location.X, this.Location.Y);

                Welcomepage.setLoggedIn(loggedIn);
                Welcomepage.Show();

                //Time to purge loggin
                this.UsernameBox.Text = "";
                this.PasswordBox.Text = "";
                loggedIn = null;
                this.Hide();
            }
        }