async internal void fillDataBase() { if (bunifuCustomDataGrid1.Rows.Count != 0) { bunifuCustomDataGrid1.Invoke((MethodInvoker) delegate { bunifuCustomDataGrid1.Rows.Clear(); }); } CurtainDesigner.Controllers.IControlerManage <Classes.PC, List <Classes.PC2>, OrderForms.FormPCOrder, DataGridView> controler = new CurtainDesigner.Controllers.Classes.PCControlerManager <Classes.PC, List <Classes.PC2>, OrderForms.FormPCOrder, DataGridView>(); await Task.Run(() => controler.unpacking(Classes.PC_Container.curtains, this.bunifuCustomDataGrid1)); }
private void iconButtonNewOrder_Click(object sender, EventArgs e) { #region [Check information before create order] if (!File.Exists(Classes.PathCombiner.join_combine("\\draw_images\\pc\\draw.png"))) { MessageBox.Show("Не вдалось знайти креслення, спробуйте ще раз.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (comboBoxCategory.DataSource == null || comboBoxCategory.Items.Count == 0 || comboBoxCategory.SelectedValue == null) { 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.PC, List <Classes.PC2>, OrderForms.FormPCOrder, DataGridView> controler = new CurtainDesigner.Controllers.Classes.PCControlerManager <Classes.PC, List <Classes.PC2>, OrderForms.FormPCOrder, DataGridView>(); controler.packing(new Classes.PC(), new List <Classes.PC2>(), this); MessageBox.Show("Замовлення успішно створено.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); }