private void buttonEditPro_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Book.UI.Invoices.ChooseProductForm f = new Book.UI.Invoices.ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { (sender as ButtonEdit).EditValue = f.SelectedItem; this.labelCusPro.Text = (f.SelectedItem as Model.Product).CustomerProductName; } f.Dispose(); GC.Collect(); }
private void buttonEditProduct_Properties_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Index == 1) { this.buttonEditProduct.EditValue = null; } else { Invoices.ChooseProductForm f = new Book.UI.Invoices.ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { this.buttonEditProduct.EditValue = f.SelectedItem as Model.Product; } f.Dispose(); GC.Collect(); } }
/// <summary> /// 选择货品 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonEditProduct_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Invoices.ChooseProductForm f = new Book.UI.Invoices.ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { Model.Product product = f.SelectedItem as Model.Product; if (product != null) { this.buttonEditProduct.Text = product.Id; this.textEditProductName.Text = string.IsNullOrEmpty(product.CustomerProductName) ? product.ProductName : product.ProductName + "{" + product.CustomerProductName + "}"; if (!string.IsNullOrEmpty(product.CustomerProductName)) { this.textEditCustomerPro.Text = product.CustomerProductName; } if (product.IsCustomerProduct == true && !string.IsNullOrEmpty(product.CustomerProductName)) { this._bomParentPartInfo = bomParentPartInfo.Get(this.productManager.Get(product.CustomerBeforeProductId)); // this.textEditCustomProduct.Text = product.CustomerProductName; this.newChooseContorlCustomer.EditValue = product.Customer; } else { this._bomParentPartInfo = bomParentPartInfo.Get(product); // this.textEditCustomProduct.Text = ""; this.newChooseContorlCustomer.EditValue = null; } this._manprocedure.Bom = this._bomParentPartInfo; if (this._bomParentPartInfo != null) { this.textEditBOMID.EditValue = this._bomParentPartInfo.Id; // this.textEditBOMType.EditValue = this._bomParentPartInfo.MaterialType; } } } f.Dispose(); GC.Collect(); }