/// <summary> /// 加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ClientInfo_Load(object sender, EventArgs e) { com_client_id.DisplayMember = "Client_name"; com_client_id.ValueMember = "Id"; com_client_id.DataSource = cb.FindAll(); com_client_id.SelectedItem = null; }
/// <summary> /// 下拉列表选择事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void com_find_type_SelectionChangeCommitted(object sender, EventArgs e) { com_find_type2.DataSource = null; switch (com_find_type.Text) //根据用户的选择变更第二个下拉框的内容 { case "根据仓库号查找": lab_find_type2.Text = "请选择仓库"; com_find_type2.DisplayMember = "Warehouse_name"; com_find_type2.ValueMember = "Id"; find_type = " w.id="; com_find_type2.DataSource = wnb.FindAll(); break; case "根据客户名查找": lab_find_type2.Text = "请选择客户"; com_find_type2.DisplayMember = "Client_name"; com_find_type2.ValueMember = "Id"; find_type = " c.id="; com_find_type2.DataSource = cb.FindAll(); break; case "根据物品名查找": lab_find_type2.Text = "请选择物品"; com_find_type2.DisplayMember = "Goods_name"; com_find_type2.ValueMember = "Id"; find_type = " g.id="; com_find_type2.DataSource = gb.FindAll(); break; } }
/// <summary> /// 窗体加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NewOutInventory_Load(object sender, EventArgs e) { com_warehouse_id.DisplayMember = "Warehouse_name"; //绑定仓库数据 com_warehouse_id.ValueMember = "Id"; com_warehouse_id.DataSource = wnb.FindAll(); com_type_id.DisplayMember = "Operation_type"; //绑定出库方式数据 com_type_id.ValueMember = "Id"; com_type_id.DataSource = ob.FindOutAll(); com_client_id.DisplayMember = "Client_name"; com_client_id.ValueMember = "Id"; com_client_id.DataSource = cb.FindAll(); }
/// <summary> /// 客户管理按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_manager_Click(object sender, EventArgs e) { Title.Text = "客户信息"; cb = new ClientBLL(); com_client_id.DisplayMember = "Client_name"; //绑定下拉列表 com_client_id.ValueMember = "Id"; com_client_id.DataSource = cb.FindAll(); com_client_id.SelectedItem = null; panel_manage.Visible = true; //显示客户管理 panel_new.Visible = false; ReSet(); }
/// <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"; }