示例#1
0
        private void AddProduct_Click(object sender, EventArgs e)
        {
            string  nume           = ProductNameTextBox.Text;
            decimal pret           = Decimal.Parse(pretTExtBox.Text);
            int     stocProduse    = int.Parse(stoc.Text);
            string  caracteristici = textBox1.Text;
            int     optiune        = checkedListBox1.SelectedIndex + 1;
            int     optiune1       = checkedListBox2.SelectedIndex + 1;

            byte[] imagine = imageToByteArray(pictureBox1.Image);


            Vanzatori vanzator   = VanzatorController.GetSellerById(getUserID_Vanzatordb());
            int       vanzatorId = Convert.ToInt32(vanzator.VanzatorId);


            try
            {
                AddProductController.AddProduct(nume, pret, stocProduse, caracteristici, imagine, optiune, optiune1, vanzatorId);
                deleteLabels();
            }
            catch
            {
                MessageBox.Show("A aparut o eroareeeeee", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        private void Laptopbutton_Click(object sender, EventArgs e)
        {
            panel3.Visible             = false;
            addProductLabel.Visible    = false;
            myProductsPanel.Visible    = true;
            dateFirma.Visible          = false;
            VizualizareComenzi.Visible = false;


            Vanzatori vanzator = VanzatorController.GetSellerById(getUserID_Vanzatordb());
            Button    button   = sender as Button;

            produses = CategorieController.getProduseBySeller(button.Text.ToString(), vanzator.VanzatorId);

            List <PictureBox> poze = new List <PictureBox> {
                pictureBox2, pictureBox3, pictureBox4, pictureBox5, pictureBox6, pictureBox7
            };
            List <Label> labels = new List <Label> {
                label5, label6, label7, label8, label9, label10
            };
            List <Button> buttons = new List <Button> {
                Laptopbutton, TableteButton, Pc_Periferice_button, haine_button,
                telefoaneBUtton, button6, carti_button, Auto_moto_button
            };

            for (int i = 0; i < produses.Count; i++)
            {
                labels[i].Text = null;
                string   numeProdus = produses[i].NumeProdus;
                string[] vs         = numeProdus.Split(' ');

                for (int j = 0; j < vs.Length; j++)
                {
                    labels[i].Text += vs[j] + " ";
                    if (j % 3 == 0 && j != 0)
                    {
                        labels[i].Text += "\n";
                    }
                }
                if (i == 0)
                {
                }
            }

            /*
             * for (int i = produses.Count; i < 8; i++)
             * {
             *  poze[i].Image = null;
             *  labels[i].Text = null;
             *  buttons[i].Hide();
             * }
             */
        }
示例#3
0
        private void AddProducts_Load(object sender, EventArgs e)
        {
            myProductsPanel.Visible    = false;
            addProductLabel.Visible    = false;
            panel3.Visible             = false;
            dateFirma.Visible          = true;
            VizualizareComenzi.Visible = false;

            Vanzatori vanzator = VanzatorController.GetSellerById(getUserID_Vanzatordb());
            User      user     = UserController.GetUserById(getUserID_Vanzatordb());

            cui.Text           = vanzator.CUI;
            nume_Companie.Text = vanzator.NumeCompanie;
            cont.Text          = vanzator.Cont;
            emailCompanie.Text = user.Email;//emailUser;


            emailActiv.Text         = user.Email;  // getinformation.Email;
            parolaContVanzator.Text = user.Parola; // getinformation.Parola;
        }
示例#4
0
 public AddProducts(Vanzatori vanzator)
 {
     this.vanzator = vanzator;
 }