Example #1
0
        internal void load_info()
        {
            if (processing)
            {
                return;
            }
            processing = true;

            if (curtain2 == null)
            {
                return;
            }

            labelSystemType.Text          = curtain2.type;
            labelTypePrice.Text           = string.Join(" ", curtain2.type_price, "$");
            numericUpDownWidth.Value      = (decimal)curtain2.width;
            numericUpDownHeight.Value     = (decimal)curtain2.height;
            numericUpDownCount.Value      = curtain2.count;
            labelYardage.Text             = curtain2.yardage.ToString();
            labelCustomer_id.Text         = curtain2.customer_id;
            labelCustomer_id.Text         = curtain2.customer_id;
            dateTimePickerDateStart.Value = curtain2.start_order_time;
            dateTimePickerDateEnd.Value   = curtain2.end_order_time;

            if (File.Exists(Classes.PathCombiner.join_combine(curtain2.picture)))
            {
                using (FileStream stream = new FileStream(Classes.PathCombiner.join_combine(curtain2.picture), FileMode.Open))
                {
                    img = new Bitmap(stream);
                }

                pictureBoxImg.Image = img;
                label_img_id.Text   = curtain2.picture;
            }

            numericUpDownPrice.Value = (decimal)curtain2.price;


            CurtainDesigner.Controllers.Classes.MCControlerManager <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView> controler = new CurtainDesigner.Controllers.Classes.MCControlerManager <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView>();
            Task t3 = Task.Run(() => controler.load_data_once_comboboxes(comboBoxSystemColor, "Select * From System_color;", "Name", "Color_id", Convert.ToInt32(curtain2.system_color_id)));
            Task t4 = Task.Run(() => controler.load_data_once_comboboxes(comboBoxEquipment, $"Select * From MC_Additional_equipment;", "Equipment", "Equipment_id", Convert.ToInt32(curtain2.equipment_id)));
            Task t5 = Task.Run(() => controler.load_data_once_comboboxes(comboBoxInstallation, "Select * From Installation;", "Price", "Installation_id", Convert.ToInt32(curtain2.installation_id)));

            Thread load_done = new Thread(new ThreadStart(loaded));

            load_done.Start();
        }
Example #2
0
        async internal void fillDataBase()
        {
            if (bunifuCustomDataGrid1.Rows.Count != 0)
            {
                bunifuCustomDataGrid1.Invoke((MethodInvoker) delegate
                {
                    bunifuCustomDataGrid1.Rows.Clear();
                });
            }

            CurtainDesigner.Controllers.IControlerManage <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView> controler = new CurtainDesigner.Controllers.Classes.MCControlerManager <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView>();
            await Task.Run(() => controler.unpacking(Classes.MC_Container.curtains, this.bunifuCustomDataGrid1));
        }
Example #3
0
        private async void loadTypePriceFromBD(object sender, EventArgs e)
        {
            setToolTip((Control)sender, comboBoxCurtainType.SelectedItem.ToString().Split(new char[] { '[', ',', ']' }, StringSplitOptions.None)[1]);
            string boxCurtainType = "";

            if (comboBoxCurtainType.InvokeRequired)
            {
                comboBoxCurtainType.Invoke((MethodInvoker) delegate
                {
                    boxCurtainType = comboBoxCurtainType.SelectedValue.ToString();
                });
            }
            else
            {
                boxCurtainType = comboBoxCurtainType.SelectedValue.ToString();
            }

            CurtainDesigner.Controllers.Classes.MCControlerManager <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView> controler = new CurtainDesigner.Controllers.Classes.MCControlerManager <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView>();
            Task t1 = Task.Run(() => controler.load_TypePriceData(this, boxCurtainType));
            await Task.WhenAll(t1);
        }
Example #4
0
 private async void load_installations()
 {
     CurtainDesigner.Controllers.Classes.MCControlerManager <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView> controler = new CurtainDesigner.Controllers.Classes.MCControlerManager <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView>();
     await Task.Run(() => controler.load_installations(this));
 }
Example #5
0
        private void iconButtonNewOrder_Click(object sender, EventArgs e)
        {
            #region [Check information before create order]
            if (!File.Exists(Classes.PathCombiner.join_combine("\\draw_images\\mc\\draw.png")))
            {
                MessageBox.Show("Не вдалось знайти креслення, спробуйте ще раз.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (comboBoxCurtainType.DataSource == null || comboBoxCurtainType.Items.Count == 0 || comboBoxCurtainType.SelectedValue == null)
            {
                MessageBox.Show("Поле \"Тип системи\" не заповнено!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrEmpty(labelTypePrice.Text) || labelTypePrice.Text == "0$")
            {
                MessageBox.Show("Поле \"Цінова категорія тканини\" не заповнено!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (comboBoxSystemColor.DataSource == null || comboBoxSystemColor.Items.Count == 0 || comboBoxSystemColor.SelectedValue == null)
            {
                MessageBox.Show("Поле \"Колір системи\" не заповнено!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (comboBoxEquipment.DataSource == null || comboBoxEquipment.Items.Count == 0 || comboBoxEquipment.SelectedValue == null)
            {
                MessageBox.Show("Поле \"Додаткова комплектація\" не заповнено!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrEmpty(labelYardage.Text) || labelYardage.Text == "0")
            {
                MessageBox.Show("Поле \"Квадратура(площа)\" не заповнено!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (comboBoxInstallation.DataSource == null || comboBoxInstallation.Items.Count == 0 || comboBoxInstallation.SelectedValue == null)
            {
                MessageBox.Show("Поле \"Ціна встановлення\" не заповнено!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (numericUpDownCount.Value == 0)
            {
                MessageBox.Show("Поле \"Кількість\" не заповнено!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrEmpty(labelCustomer.Text) || string.IsNullOrWhiteSpace(labelCustomer.Text))
            {
                MessageBox.Show("Поле \"Замовник\" не заповнено!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrWhiteSpace(labelPrice.Text) || labelPrice.Text == "[ 0 $ ]")
            {
                MessageBox.Show("Поле \"Ціна\" не заповнено!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            #endregion

            create_img_id();
            CurtainDesigner.Controllers.IControlerManage <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView> controler = new CurtainDesigner.Controllers.Classes.MCControlerManager <Classes.MC, List <Classes.MC2>, OrderForms.FormMCOrder, DataGridView>();
            controler.packing(new Classes.MC(), new List <Classes.MC2>(), this);
            MessageBox.Show("Замовлення успішно створено.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }