protected override void LoadData() { this.bindingSource1.DataSource = null; // BL.ProductCategoryManager manager = this.manager as BL.ProductCategoryManager; //this.productCategoryBindingSource.DataSource = (this.manager as BL.ProductCategoryManager).Select(); //this.bindingSource1.DataSource = productManager.GetProduct();//productManager.GetProductReader(); //this.gridControl1.RefreshDataSource(); if (this._customer != null) { this.bindingSource1.DataSource = productManager.Select(this._customer); this.gridControl1.RefreshDataSource(); } if (this._productCategory != null) { this.simpleButtonNew.Visible = false; //this.productCategoryBindingSource.DataSource = this._productCategory; this.bindingSource1.DataSource = productManager.Select(this._productCategory); this.gridControl1.RefreshDataSource(); } //else //{ // this.simpleButtonNew.Visible = true; //} }
/// <summary> /// 窗体加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ConditionDChooseForm_Load(object sender, EventArgs e) { System.Collections.Generic.IList <Model.Product> products = productManager.Select(); foreach (Model.Product product in products) { this.comboBoxEditStartId.Properties.Items.Add(string.Format("{0} {1}", product.ProductId, product.ProductName)); this.comboBoxEditEndId.Properties.Items.Add(string.Format("{0} {1}", product.ProductId, product.ProductName)); } }
//加载 private void BOMManagerForm_Load(object sender, EventArgs e) { this.bindingSourceProduct.DataSource = new BL.ProductManager().Select(); foreach (Model.ProductCategory cate in productCategoryManager.Select()) { DevExpress.XtraTreeList.Nodes.TreeListNode treeNode = treeList1.AppendNode(new object[] { cate.ProductCategoryName }, null, cate.ProductCategoryId); _productCategory.ProductCategoryId = cate.ProductCategoryId; foreach (Model.Product prodcut in productManager.Select(_productCategory)) { treeList1.AppendNode(new object[] { prodcut.ProductName }, treeNode, prodcut.ProductId); } } }