Пример #1
0
        private void BReady_Click(object sender, EventArgs e)
        {
            High_Alcholol.TFlavorin_additives flavorin_additives;
            High_Alcholol.TRaw_Materials      raw_materials;
            High_Alcholol.TType type;
            Bottle botle;
            double degree = Convert.ToDouble(TBGr.Text);
            int    year   = Convert.ToInt32(TBYear.Text);

            if (CMBMaterial.SelectedItem != null)
            {
                raw_materials = (High_Alcholol.TRaw_Materials)Enum.Parse(typeof(High_Alcholol.TRaw_Materials), CMBMaterial.SelectedItem.ToString());
            }
            else
            {
                MessageBox.Show("Выберите тип добавки");
                return;
            }
            if (CMBDob.SelectedItem != null)
            {
                flavorin_additives = (High_Alcholol.TFlavorin_additives)Enum.Parse(typeof(High_Alcholol.TFlavorin_additives), CMBDob.SelectedItem.ToString());
            }
            else
            {
                MessageBox.Show("Выберите тип добавки");
                return;
            }
            if (CMBType.SelectedItem != null)
            {
                type = (High_Alcholol.TType)Enum.Parse(typeof(High_Alcholol.TType), CMBType.SelectedItem.ToString());
            }
            else
            {
                MessageBox.Show("Выберите тип алкоголя");
                return;
            }
            if (CMBottle.SelectedItem != null)
            {
                botle = (Bottle)FMenu.Catalog.Find(x => x.Name == CMBottle.SelectedItem.ToString() && x.Category == Item.TCategories.Bottle);
            }
            else
            {
                MessageBox.Show("Выберите тип бутылки");
                return;
            }
            object[] value = FMenu.GetCommonData(TBName, TBPrice, TBCount, TBCountry);
            if (value != null)
            {
                High_Alcholol high_alcholol = new High_Alcholol(botle, flavorin_additives, raw_materials, type, degree, year, (string)value[0], (double)value[1], (int)value[2], (string)value[3]);
                Add_Display(high_alcholol, ObjectIndex);
                this.Close();
            }
        }
Пример #2
0
        private void BReady_Click(object sender, EventArgs e)
        {
            Low_Alcholol.TFlavorin_additives flavorin_additives;
            Low_Alcholol.TCooking_Method     cooking_method;
            string recipe = TBRecipe.Text;
            string ingr   = TBIngr.Text;
            bool   aroma  = CBAroma.Checked;
            bool   fruit  = CBFruit.Checked;
            Bottle botle;
            double degree = Convert.ToDouble(TBGr.Text);
            int    year   = Convert.ToInt32(TBYear.Text);

            if (CMBMethod.SelectedItem != null)
            {
                cooking_method = (Low_Alcholol.TCooking_Method)Enum.Parse(typeof(Low_Alcholol.TCooking_Method), CMBMethod.SelectedItem.ToString());
            }
            else
            {
                MessageBox.Show("Выберите тип приготовления");
                return;
            }
            if (CMBDob.SelectedItem != null)
            {
                flavorin_additives = (Low_Alcholol.TFlavorin_additives)Enum.Parse(typeof(Low_Alcholol.TFlavorin_additives), CMBDob.SelectedItem.ToString());
            }
            else
            {
                MessageBox.Show("Выберите тип добавки");
                return;
            }
            if (CMBottle.SelectedItem != null)
            {
                botle = (Bottle)FMenu.Catalog.Find(x => x.Name == CMBottle.SelectedItem.ToString() && x.Category == Item.TCategories.Bottle);
            }
            else
            {
                MessageBox.Show("Выберите тип бутылки");
                return;
            }

            object[] value = FMenu.GetCommonData(TBName, TBPrice, TBCount, TBCountry);
            if (value != null)
            {
                Low_Alcholol Low_alcholol = new Low_Alcholol(botle, flavorin_additives, cooking_method, ingr, recipe, aroma, fruit, degree, year, (string)value[0], (double)value[1], (int)value[2], (string)value[3]);
                Add_Display(Low_alcholol, ObjectIndex);
                this.Close();
            }
        }
Пример #3
0
        private void BReady_Click(object sender, EventArgs e)
        {
            double volume;

            Bottle.TType btype;
            if (TBPrice.Text != "" && CMBType.SelectedItem != null)
            {
                volume = Convert.ToDouble(TBPrice.Text);
                btype  = (Bottle.TType)Enum.Parse(typeof(Bottle.TType), CMBType.SelectedItem.ToString());
            }
            else
            {
                MessageBox.Show("Проверьте значения");
                return;
            }
            object[] value = FMenu.GetCommonData(TBName, TBPrice, TBCount, TBCountry);
            if (value != null)
            {
                Bottle bottle = new Bottle(volume, btype, (string)value[0], (double)value[1], (int)value[2], (string)value[3]);
                Add_Display(bottle, ObjectIndex);
                this.Close();
            }
        }
Пример #4
0
        private void BReady_Click(object sender, EventArgs e)
        {
            Medium_Alcholol.TCooking_Method cooking_method;
            Medium_Alcholol.TColor          color;
            Medium_Alcholol.TType           type;
            Medium_Alcholol.TShugar         shugar;
            Bottle botle;
            string recipe;
            double degree;
            int    year;

            try
            {
                degree         = Convert.ToDouble(TBGr.Text);
                year           = Convert.ToInt32(TBYear.Text);
                recipe         = TRecipe.Text;
                type           = (Medium_Alcholol.TType)Enum.Parse(typeof(Medium_Alcholol.TType), CMBType.SelectedItem.ToString());
                color          = (Medium_Alcholol.TColor)Enum.Parse(typeof(Medium_Alcholol.TColor), CMBColor.SelectedItem.ToString());
                shugar         = (Medium_Alcholol.TShugar)Enum.Parse(typeof(Medium_Alcholol.TShugar), CMBShugar.SelectedItem.ToString());
                cooking_method = (Medium_Alcholol.TCooking_Method)Enum.Parse(typeof(Medium_Alcholol.TCooking_Method), CMBMethod.SelectedItem.ToString());
                botle          = (Bottle)FMenu.Catalog.Find(x => x.Name == CMBottle.SelectedItem.ToString() && x.Category == Item.TCategories.Bottle);
            }
            catch
            {
                MessageBox.Show("Перепроверьте ваши данные");
                return;
            }

            object[] value = FMenu.GetCommonData(TBName, TBPrice, TBCount, TBCountry);
            if (value != null)
            {
                Medium_Alcholol medium_alcholol = new Medium_Alcholol(botle, type, recipe, cooking_method, color, shugar, degree, year, (string)value[0], (double)value[1], (int)value[2], (string)value[3]);
                Add_Display(medium_alcholol, ObjectIndex);
                this.Close();
            }
        }