Exemplo n.º 1
0
        private void btnConnection_Click(object sender, EventArgs e)
        {
            if (unTextBox.Text.Equals("") || pwTextBox.Text.Equals(""))
            {
                return;
            }
            User user = frmMain.Instance.User.GetUserByAuth(unTextBox.Text, pwTextBox.Text);

            if (user == null)
            {
                pwTextBox.Text  = "";
                pwTextBox.Style = MetroFramework.MetroColorStyle.Red;
                pwTextBox.Focus();
                return;
            }
            frmMain.Instance.Session = user;
            if (!frmMain.Instance.mainContainer.Controls.ContainsKey("ucDashboard"))
            {
                ucDashboard uc = new ucDashboard();
                uc.Dock = DockStyle.Fill;
                frmMain.Instance.mainContainer.Controls.Add(uc);
            }
            unTextBox.Clear();
            pwTextBox.Clear();
            pwTextBox.Style = MetroFramework.MetroColorStyle.Green;
            frmMain.Instance.Logout.Visible = true;
            frmMain.Instance.mainContainer.Controls["ucDashboard"].BringToFront();
        }
Exemplo n.º 2
0
 private void ucDashboard_Load(object sender, EventArgs e)
 {
     _instance = this;
     Actualiser();
 }