private void buttonAdd_Click(object sender, EventArgs e)
        {
            infoAboutProduct[0] = comboBoxTypeProduct.Text;
            infoAboutProduct[1] = comboBoxNameProduct.Text;
            infoAboutProduct[2] = textBoxWeightProduct.Text;
            infoAboutProduct[3] = textBoxProteins.Text;
            infoAboutProduct[4] = textBoxFats.Text;
            infoAboutProduct[5] = textBoxCarbohydrates.Text;

            (this.Owner as FormWorkWithSalad).salad.ProductSalad.Add(SavingData.CreateProduct(infoAboutProduct));
        }
Exemple #2
0
        private void buttonChooseCreatedBeforeSalads_Click(object sender, EventArgs e)
        {
            if (openFileDialogForChooseSalad.ShowDialog() == DialogResult.OK)
            {
                string nameSalad = openFileDialogForChooseSalad.FileName;
                Salad  salad     = SavingData.DeSerializationSalad(nameSalad);

                FormWorkWithSalad formWorkWithSalad = new FormWorkWithSalad(salad);
                this.Visible = false;
                formWorkWithSalad.ShowDialog();
                this.Visible = true;
            }
        }
        private void buttonSaveSalad_Click(object sender, EventArgs e)
        {
            buttonFindProducts.Enabled = true;

            SavingData.SerializationSalad(salad);
        }