private void BindGrid() { string condition = " 1 = 1 "; condition += " ORDER BY PDT_Product.Code"; PDT_StandardPriceBLL bll = new PDT_StandardPriceBLL((int)ViewState["PriceID"]); gv_List.BindGrid(bll.GetDetail(condition)); }
private void BindGrid() { if (MCSTabControl1.SelectedIndex == 0) { tr1.Visible = false; tr_Product.Visible = true; string condition = " 1 = 1 "; if (ddl_Brand.SelectedValue != "0") { if (ddl_Classify.SelectedValue == "0") { condition = " Brand =" + ddl_Brand.SelectedValue; } else { condition = " Classify =" + ddl_Classify.SelectedValue; } } condition += " ORDER BY PDT_Product.Code"; PDT_StandardPriceBLL bll = new PDT_StandardPriceBLL((int)ViewState["PriceID"]); gv_List.BindGrid(bll.GetDetail(condition)); if (!Right_Assign_BLL.GetAccessRight((string)Session["UserName"], 1410, "ModifyFactoryPrice")) { foreach (GridViewRow row in gv_List.Rows) { TextBox tbx = (TextBox)row.FindControl("tbx_FactoryPrice"); if (tbx != null) { tbx.Enabled = false; } } } } else { tr1.Visible = true; tr_Product.Visible = false; //获取非价表产品列表 string condition = "State=1 AND ID NOT IN (SELECT Product FROM PDT_StandardPrice_Detail WHERE StandardPrice=" + ViewState["PriceID"].ToString() + ")"; if (ddl_Brand.SelectedValue == "0") { condition += " AND Brand in (SELECT ID FROM PDT_Brand WHERE IsOpponent in ('1'))"; } else { if (ddl_Classify.SelectedValue == "0") { condition += " AND Brand =" + ddl_Brand.SelectedValue; } else { condition += " AND Classify =" + ddl_Classify.SelectedValue; } } IList <PDT_Product> products = PDT_ProductBLL.GetModelList(condition); gv_List_FacProd.BindGrid <PDT_Product>(products); } }
private void BindGrid() { if (MCSTabControl1.SelectedIndex == 0) { tr1.Visible = false; tr_Product.Visible = true; string condition = " 1 = 1 "; if (ddl_Brand.SelectedValue != "0") { if (ddl_Classify.SelectedValue == "0") condition = " Brand =" + ddl_Brand.SelectedValue; else condition = " Classify =" + ddl_Classify.SelectedValue; } condition += " ORDER BY PDT_Product.Code"; PDT_StandardPriceBLL bll = new PDT_StandardPriceBLL((int)ViewState["PriceID"]); gv_List.BindGrid(bll.GetDetail(condition)); if (!Right_Assign_BLL.GetAccessRight((string)Session["UserName"], 1410, "ModifyFactoryPrice")) { foreach (GridViewRow row in gv_List.Rows) { TextBox tbx = (TextBox)row.FindControl("tbx_FactoryPrice"); if (tbx != null) tbx.Enabled = false; } } } else { tr1.Visible = true; tr_Product.Visible = false; //获取非价表产品列表 string condition = "State=1 AND ID NOT IN (SELECT Product FROM PDT_StandardPrice_Detail WHERE StandardPrice=" + ViewState["PriceID"].ToString() + ")"; if (ddl_Brand.SelectedValue == "0") condition += " AND Brand in (SELECT ID FROM PDT_Brand WHERE IsOpponent in ('1'))"; else { if (ddl_Classify.SelectedValue == "0") condition += " AND Brand =" + ddl_Brand.SelectedValue; else condition += " AND Classify =" + ddl_Classify.SelectedValue; } IList<PDT_Product> products = PDT_ProductBLL.GetModelList(condition); gv_List_FacProd.BindGrid<PDT_Product>(products); } }