Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Admin admin = new Admin();
            admin.Show();


        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            // login 
            DataTable dt = BusinessLogicLayer.BLL.Login.LoginSystem(textBox1.Text, textBox2.Text);
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0][7].ToString() == "Admin")
                {
                    Admin ad = new Admin();
                    ad.Show();
                    this.Hide();

                }
                else { MessageBox.Show("Login certo"); this.Hide(); }
            }
            else { MessageBox.Show("Login errado"); }
      
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            // login
            DataTable dt = BusinessLogicLayer.BLL.Login.LoginSystem(textBox1.Text, textBox2.Text);

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0][7].ToString() == "Admin")
                {
                    Admin ad = new Admin();
                    ad.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Login certo"); this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Login errado");
            }
        }
Ejemplo n.º 4
0
        private void metroButton4_Click(object sender, EventArgs e)
        {
            string username = lusernamebox.Text;
            string password = lpassbox.Text;
            string type     = loginasCombobox.Text;

            // -------------------------  Login --------------------------//
            if (username == "" || password == "" || type == "")
            {
                MessageBox.Show(this, "Fill up every blank.", "Message", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
            }
            else if (type == "Admin")
            {
                int t = bo.admin_login(username, password);
                if (t == 0)
                {
                    MessageBox.Show(this, "Wrong Combination", "Message", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                }
                else if (t == 1)
                {
                    bo.mainname = username;
                    Admin admin = new Admin(bo);
                    admin.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show(this, "Wrong Combination", "Message", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                }
            }
            else if (type == "Accountant")
            {
                int t = bo.accountant_login(username, password);
                if (t == 0)
                {
                    MessageBox.Show(this, "Wrong Combination", "Message", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                }
                else if (t == 1)
                {
                    bo.mainname = username;
                    Accountant_Main_Page acc = new Accountant_Main_Page(bo);
                    acc.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show(this, "Wrong Combination", "Message", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                }
            }
            else if (type == "Client")
            {
                int t = bo.client_login(username, password);
                if (t == 0)
                {
                    MessageBox.Show(this, "Wrong Combination", "Message", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                }
                else if (t == 1)
                {
                    bo.mainname = username;
                    Client client = new Client(bo);
                    client.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show(this, "Wrong Combination", "Message", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            Admin admin = new Admin();

            admin.Show();
        }