/// <summary> /// 窗体加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NewPutInventory_Load(object sender, EventArgs e) { listgtm = gtb.FindAll(); SetTree.Settree(Goodstypetree, (TreeNode)null, listgtm, 0); //递归创建TREE Goodstypetree.ExpandAll(); //展开所有节点 comb_goods_name.Leave += new EventHandler(comb_goods_name_Leave); //注册comb_goods_name的焦点失去事件 Goodstypetree.Leave += new EventHandler(Goodstypetree_Leave); //注册treeview的焦点失去事件 com_type_id.DataSource = ob.FindPutAll(); //绑定数据到操作类型 com_type_id.ValueMember = "Id"; com_type_id.DisplayMember = "Operation_type"; com_client_id.DataSource = cb.FindAll(); //绑定数据到选择客户 com_client_id.DisplayMember = "Client_name"; com_client_id.ValueMember = "Id"; com_warehouse_id.DataSource = wnb.FindAll(); //绑定数据到选择仓库 com_warehouse_id.DisplayMember = "Warehouse_name"; com_warehouse_id.ValueMember = "Id"; }
/// <summary> /// 加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GoodsType_Load(object sender, EventArgs e) { listgtm = gtb.FindAll(); SetTree.Settree(Goodstypetree, (TreeNode)null, listgtm, 0); //递归创建TREE Goodstypetree.ExpandAll(); //展开所有节点 }