Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Create_Account CA  = new Create_Account();
            float          qty = float.Parse(textBox3.Text);

            string[] product = ProdcomboBox.Text.Split(' ');
            string[] suppier = comboBox5.Text.Split(' ');
            int      prodID  = CA.getID("SELECT * FROM Product", product[0]);
            int      supID   = CA.getID("SELECT * FROM Supplier", suppier[0]);
            //MessageBox.Show((new Sales()).addOrder()+"");
            string add = "INSERT INTO SupplyProd VALUES(@Received, @Quantity, @Order_ID, @Product_ID, @Supplier_ID)";

            addPO(add, qty, (new Sales()).addOrder(), prodID, supID);
            readAll();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                AcerLogisics    AL = new AcerLogisics();
                Create_Account  CA = new Create_Account();
                Human_Resources HR = new Human_Resources();
                if (authenticate(txtID.Text, txtPassword.Text, ref UserID))
                {
                    //MessageBox.Show("User at " + CA.getID("SELECT * FROM Login", txtID.Text).ToString());
                    string[] tmp = getUserdet(readAEmpl, CA.getID("SELECT * FROM Login", txtID.Text)).Split(',');

                    if (tmp[2] == "Manager")
                    {
                        AL.lblUsername.Text = HR.lblUsername.Text = "Logged in as " + tmp[0] + " " + tmp[1];
                        AL.ShowDialog();
                        this.Close();
                    }
                    else if (tmp[2] == "HR")
                    {
                        HR.lblUsername.Text = "Logged in as " + tmp[0] + " " + tmp[1];
                        HR.ShowDialog();
                        this.Close();
                    }
                    else if (tmp[2] == "Administrator")
                    {
                        AL.lblUsername.Text = HR.lblUsername.Text = "Logged in as " + tmp[0] + " " + tmp[1];
                        AL.ShowDialog();
                        this.Close();
                    }
                    else if (tmp[2] == "Sales Manager")
                    {
                        (new Sales()).ShowDialog();
                    }
                }
                else
                {
                    if (txtID.Text == "Employee" || txtID.Text == "employee" && txtPassword.Text == "0000")
                    {
                        (new Graphical()).ShowDialog();
                    }
                    else
                    {
                        lblFP.Visible = true;
                        if (txtPassword.Text == string.Empty)
                        {
                            label5.Visible = true;
                        }
                        errorProvider1.SetError(txtPassword, "Invaid password");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                AcerLogisics   AL = new AcerLogisics();
                Create_Account CA = new Create_Account();

                if (authenticate(txtID.Text, txtPassword.Text, ref UserID))
                {
                    //MessageBox.Show("User at " + CA.getID("SELECT * FROM Login", txtID.Text).ToString());
                    string[] tmp = getUserdet(readAEmpl, CA.getID("SELECT * FROM Login", txtID.Text)).Split(',');
                    AL.label1.Text = "Logged in as " + tmp[0] + " " + tmp[1];



                    if (tmp[2] == "Manager")
                    {
                        AL.ShowDialog();
                        this.Close();
                    }
                    else if (tmp[2] == "HR")
                    {
                        (new Human_Resources()).ShowDialog();
                        this.Close();
                    }
                }
                else
                {
                    errorProvider1.SetError(txtPassword, "Invaid password");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }