private void add_actions()
        {
            numericUpDownWidth.ValueChanged  += (s, e) => { setTooltipsyardage(); update_draw(numericUpDownWidth.Value.ToString() + "м.", numericUpDownHeight.Value.ToString() + "м.", labelYardage.Text + "м."); labelYardage.Text = string.Join(",", Convert.ToString((float)Math.Round(Convert.ToDouble(numericUpDownWidth.Value * numericUpDownHeight.Value), 2, MidpointRounding.AwayFromZero)).Split(',')); };
            numericUpDownHeight.ValueChanged += (s, e) => { update_draw(numericUpDownWidth.Value.ToString() + "м.", numericUpDownHeight.Value.ToString() + "м.", labelYardage.Text + "м."); labelYardage.Text = string.Join(",", Convert.ToString((float)Math.Round(Convert.ToDouble(numericUpDownWidth.Value * numericUpDownHeight.Value), 2, MidpointRounding.AwayFromZero)).Split(',')); setTooltipsyardage(); };

            comboBoxSide.SelectionChangeCommitted        += (s, e) => { setToolTip((Control)s, comboBoxSide.SelectedItem.ToString().Split(new char[] { '[', ',', ']' }, StringSplitOptions.None)[1]); update_draw(numericUpDownWidth.Value.ToString() + "м.", numericUpDownHeight.Value.ToString() + "м.", labelYardage.Text + "м."); };
            comboBoxSystemColor.SelectionChangeCommitted += (s, e) => { setToolTip((Control)s, comboBoxSystemColor.SelectedItem.ToString().Split(new char[] { '[', ',', ']' }, StringSplitOptions.None)[1]); };
            comboBoxEquipment.SelectionChangeCommitted   += (s, e) => { setToolTip((Control)s, comboBoxEquipment.SelectedItem.ToString().Split(new char[] { '[', ',', ']' }, StringSplitOptions.None)[1]); };

            comboBoxEquipment.SelectedValueChanged += (s, e) => { updatePrice(); };
            labelYardage.TextChanged += (s, e) => { updatePrice(); };
            comboBoxInstallation.SelectedValueChanged += (s, e) => { updatePrice(); };
            numericUpDownCount.ValueChanged           += (s, e) => { updatePrice(); };

            pictureBoxImg.MouseClick += (s, e) =>
            {
                if (img_processing)
                {
                    MessageBox.Show("Зачекайте, будь ласка, програма створює креслення.", "Please, wait..", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                FormOpenDraw openDraw = new FormOpenDraw((Bitmap)pictureBoxImg.Image);
                openDraw.ShowDialog();
            };
        }
Beispiel #2
0
        private void add_actions()
        {
            comboBoxFabric.SelectionChangeCommitted += (s, e) => {
                curtain2.fabric_id = comboBoxFabric.SelectedValue.ToString();
                CurtainDesigner.Controllers.Classes.FabricCurtainControlerManager <Classes.FabricCurtain, List <Classes.FabricCurtain2>, FormFabricCurtainOrder, DataGridView> controler = new CurtainDesigner.Controllers.Classes.FabricCurtainControlerManager <Classes.FabricCurtain, List <Classes.FabricCurtain2>, FormFabricCurtainOrder, DataGridView>();
                Task t1 = Task.Run(() => controler.load_data_once_label(labelCategory, labelFabricCategoryId, $"Select * From [DNC_category] fcc Where [fcc].[Category_id] IN (Select Category_id From [DNC_Fabric] ffc Where [ffc].[Fabric_id] = {curtain2.fabric_id}) and [fcc].[Type_id] = {curtain2.type_id} and [fcc].[Subtype_id] = {curtain2.subtype_id};", "Category_id", "Price"));
            };

            numericUpDownWidth.ValueChanged  += (s, e) => { setTooltipsyardage(); update_draw(numericUpDownWidth.Value.ToString() + "м.", numericUpDownHeight.Value.ToString() + "м.", labelYardage.Text + "м."); labelYardage.Text = string.Join(",", Convert.ToString((float)Math.Round(Convert.ToDouble(numericUpDownWidth.Value * numericUpDownHeight.Value), 2, MidpointRounding.AwayFromZero)).Split(',')); };
            numericUpDownHeight.ValueChanged += (s, e) => { update_draw(numericUpDownWidth.Value.ToString() + "м.", numericUpDownHeight.Value.ToString() + "м.", labelYardage.Text + "м."); labelYardage.Text = string.Join(",", Convert.ToString((float)Math.Round(Convert.ToDouble(numericUpDownWidth.Value * numericUpDownHeight.Value), 2, MidpointRounding.AwayFromZero)).Split(',')); setTooltipsyardage(); };

            comboBoxSide.SelectionChangeCommitted        += (s, e) => { setToolTip((Control)s, comboBoxSide.SelectedItem.ToString().Split(new char[] { '[', ',', ']' }, StringSplitOptions.None)[1]); update_draw(numericUpDownWidth.Value.ToString() + "м.", numericUpDownHeight.Value.ToString() + "м.", labelYardage.Text + "м."); };
            comboBoxSystemColor.SelectionChangeCommitted += (s, e) => { setToolTip((Control)s, comboBoxSystemColor.SelectedItem.ToString().Split(new char[] { '[', ',', ']' }, StringSplitOptions.None)[1]); };
            comboBoxEquipment.SelectionChangeCommitted   += (s, e) => { setToolTip((Control)s, comboBoxEquipment.SelectedItem.ToString().Split(new char[] { '[', ',', ']' }, StringSplitOptions.None)[1]); };
            comboBoxFabric.SelectionChangeCommitted      += (s, e) => { setToolTip((Control)s, comboBoxFabric.SelectedItem.ToString().Split(new char[] { '[', ',', ']' }, StringSplitOptions.None)[1]); };


            labelCategory.TextChanged += (s, e) => { updatePrice(); };
            comboBoxEquipment.SelectedValueChanged += (s, e) => { updatePrice(); };
            labelYardage.TextChanged += (s, e) => { updatePrice(); };
            comboBoxInstallation.SelectedValueChanged += (s, e) => { updatePrice(); };
            numericUpDownCount.ValueChanged           += (s, e) => { updatePrice(); };

            pictureBoxImg.MouseClick += (s, e) =>
            {
                if (img_processing)
                {
                    MessageBox.Show("Зачекайте, будь ласка, програма створює креслення.", "Please, wait..", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                FormOpenDraw openDraw = new FormOpenDraw((Bitmap)pictureBoxImg.Image);
                openDraw.ShowDialog();
            };
        }