コード例 #1
0
        private void ButtonLogin_Click(object sender, EventArgs e)
        {
            string login    = textBoxLogin.Text;
            string password = textBoxPassword.Text;

            if (XmlData.IsValidLogin(login, password))
            {
                switch (XmlData.WhatAFunction(login, password))
                {
                case "Użytkownik":
                    UserPackagesPanel frm1 = new UserPackagesPanel(login, password);
                    frm1.Show();
                    break;

                case "Administrator":
                    AdminMenuPanel frm2 = new AdminMenuPanel();
                    frm2.Show();
                    break;

                case "Kurier":
                    PackageManagementPanel frm3 = new PackageManagementPanel();
                    frm3.Show();
                    break;
                }
                this.Hide();
            }
            else
            {
                textBoxLogin.Text    = "";
                textBoxPassword.Text = "";
                MessageBox.Show("Błędne dane", "Info");
            }
        }
コード例 #2
0
        private void ButtonManagementPackagePanel_Click(object sender, EventArgs e)
        {
            PackageManagementPanel form2 = new PackageManagementPanel();

            form2.Show();
            this.Hide();
        }