Exemplo n.º 1
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(username, password);

                StoreSystems LoggedIn = new StoreSystems();

                LoggedIn.loggedUser = loggedIn;

                Welcomepage = new WelcomePage(LoggedIn);
                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();

                Welcomepage.MainForm = this;

                Welcomepage.Show();

                //Time to purge loggin
                this.UsernameBox.Text = "";
                this.PasswordBox.Text = "";
                loggedIn = null;
                this.Hide();
            }
        }
Exemplo n.º 2
0
    public void ShowWelcomePage()
    {
        if (State == UIState.WelcomePage)
        {
            return;
        }
        SetState(UIState.BlockInput);

        RectTransform welcomePage =
            Instantiate(UIRes.GetResource(UIRes.WelcomePageSource)).GetComponent <RectTransform>();

        welcomePage.SetParent(_baseCanvas.transform);
        welcomePage.sizeDelta        = Vector2.zero;
        welcomePage.anchoredPosition = Vector2.zero;

        _welcomePage = welcomePage.GetComponent <WelcomePage>();
        _welcomePage.Show(() => SetState(UIState.WelcomePage));
    }
Exemplo n.º 3
0
    public static void Init()
    {
        WelcomePage myWindow = (WelcomePage)GetWindow(typeof(WelcomePage));

        myWindow.Show();
    }