Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string login    = textBox1.Text;
            string password = textBox2.Text;

            correctInput = new CorrectInputCheck();

            bd = new BD();

            if (correctInput.CheckLogPas(login, password))
            {
                if (correctInput.CorrectInputLogin(login))
                {
                    if (bd.AuthCheck(login, password))
                    {
                        switch (bd.AccessCheck(login))
                        {
                        case "Admin":
                        {
                            adm = new AdmWin(this);
                            adm.Show();
                            clearFields();
                            Hide();
                            break;
                        }

                        case "Consultant":
                        {
                            consult = new ConsultForm(this);
                            consult.Show();
                            clearFields();
                            Hide();
                            break;
                        }

                        case "Guest":
                        {
                            guest = new GuestForm(this, login, password);
                            guest.Show();
                            clearFields();
                            Hide();
                            break;
                        }

                        default:
                            errorList.ErrorMessage("Unknow access!!!");
                            break;
                        }
                    }
                    else
                    {
                        errorList.ErrorMessage(13);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            correctInput = new CorrectInputCheck();
            int idBucket = correctInput.BucketIdGen();

            guest = new GuestForm(this, idBucket);
            guest.Show();
            clearFields();
            Hide();
        }
Ejemplo n.º 3
0
 private void button3_Click(object sender, EventArgs e)
 {
     inputCheck = new CorrectInputCheck();
     if (inputCheck.BucketIsEmpty(id))
     {
         if (!String.IsNullOrEmpty(login))
         {
             bd = new BD();
             Order order = new Order(bd.GetBucketId(login));
             order.Show();
         }
         else
         {
             Order order = new Order(id);
             order.Show();
         }
     }
 }
Ejemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            inputCheck = new CorrectInputCheck();
            bd         = new BD();

            if (!String.IsNullOrEmpty(login))
            {
                if (inputCheck.BucketIsEmpty(bd.IdCheck(login)))
                {
                    ViewBucket viewBucket = new ViewBucket(bd.IdCheck(login));
                    viewBucket.Show();
                }
            }
            else
            {
                if (inputCheck.BucketIsEmpty(id))
                {
                    ViewBucket viewBucket = new ViewBucket(id);
                    viewBucket.Show();
                }
            }
        }
Ejemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            string title       = textBox1.Text;
            int    category    = comboBox1.SelectedIndex;
            string cost        = textBox2.Text;
            string discription = textBox3.Text;
            string quantity    = textBox4.Text;

            string categoryMess;
            int    costInt;
            int    quantityInt;

            if (correctInput == null)
            {
                correctInput = new CorrectInputCheck();
            }

            if (bd == null)
            {
                bd = new BD();
            }

            if (correctInput.CheckAddEdit(title, category, cost, discription, quantity))
            {
                categoryMess = comboBox1.SelectedItem.ToString();
                costInt      = Int32.Parse(cost);
                quantityInt  = Int32.Parse(quantity);

                bd.WorkWithBD(String.Format("INSERT INTO Products VALUES ('{0}','{1}',{2},'{3}',{4})", title, categoryMess, cost, discription, quantity));

                secces.SeccessMessage(1);

                textBox1.Text           = "";
                comboBox1.SelectedIndex = -1;
                textBox2.Text           = "";
                textBox3.Text           = "";
                textBox4.Text           = "";
            }
        }
Ejemplo n.º 6
0
        private void button4_Click(object sender, EventArgs e)
        {
            string login    = textBox1.Text;
            string password = textBox2.Text;


            correctInput = new CorrectInputCheck();

            bd = new BD();

            seccess = new SeccessList();

            if (correctInput.CheckLogPas(login, password))
            {
                if (correctInput.CorrectInputLogin(login))
                {
                    if (correctInput.LoginExist(login))
                    {
                        bd.WorkWithBD(String.Format("INSERT INTO Accounts VALUES('{0}','{1}','{2}',{3})", login, password, "Guest", correctInput.BucketIdGen()));
                        seccess.SeccessMessage(2);
                    }
                }
            }
        }