private void LoadList() { //拼接条件 Dictionary <string, string> dic = new Dictionary <string, string>(); if (txtTitleSearch.Text != "") { dic.Add("DTitle", txtTitleSearch.Text); } if (ddlTypeSearch.SelectedValue.ToString() != "0") { dic.Add("DTypeId", ddlTypeSearch.SelectedValue.ToString()); } dgvList.AutoGenerateColumns = false; dgvList.DataSource = diBll.Getlist(dic); }
private void LoadDishInfo() { //拼接查询条件 Dictionary <string, string> dic = new Dictionary <string, string>(); if (txtTitle.Text != "") { dic.Add("DChar", txtTitle.Text); } if (ddlType.SelectedValue.ToString() != "0") { dic.Add("DTypeId", ddlType.SelectedValue.ToString()); } //查询菜品显示到dgvAllDish中 DishInfoBll diBll = new DishInfoBll(); dgvAllDish.AutoGenerateColumns = false; dgvAllDish.DataSource = diBll.Getlist(dic); }