예제 #1
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                api.Login(userName.Text, password.Text);
            }
            catch (Exception exep)
            {
                userName.Text = "";
                password.Text = "";
                this.Cursor   = Cursors.Default;
                MessageBox.Show(exep.Message);
                return;
            }

            //       this.Hide(); // не наддо скрывать а раскрыть для вывода таблицы wpf
            this.loginButton.Hide();
            this.userNameLabel.Hide();
            this.userName.Hide();
            this.password.Hide();
            this.userNameLabel.Hide();
            this.passwordLabel.Hide();
            this.ClientSize = new System.Drawing.Size(1320, 640);
            this.Text       = "sianODDS";


            //       MainWindow dashboard = new MainWindow(account);
            //      dashboard.Show();
            // запуск wpf user control
            ElementHost TableHost = new ElementHost();

            TableHost.Dock = DockStyle.Fill;

            UCTable ucobj = new UCTable(account);

            TableHost.BringToFront();
            TableHost.Child = ucobj;
            this.Controls.Add(TableHost);
            TableHost.Show();

            return;
        }
예제 #2
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                api.Login(userName.Text, password.Text);
            }
            catch (Exception exep)
            {
                userName.Text = "";
                password.Text = "";
                this.Cursor   = Cursors.Default;
                MessageBox.Show(exep.Message);
                return;
            }

            this.Hide();

            Dashboard dashboard = new Dashboard(account);

            dashboard.Show();
            return;
        }