private void BindDropDown() { MCSTreeControl tr_OfficialCity = (MCSTreeControl)pl_detail.FindControl("CM_Client_OfficialCity"); if (tr_OfficialCity != null) { if ((int)Session["OwnerType"] == 2 && (int)Session["OwnerClient"] > 0) { CM_Client c = new CM_ClientBLL((int)Session["OwnerClient"]).Model; if (c != null) { int prov = TreeTableBLL.GetSuperIDByLevel("MCS_SYS.dbo.Addr_OfficialCity", c.OfficialCity, 1); tr_OfficialCity.RootValue = prov.ToString(); } } } if ((int)Session["OwnerType"] == 2 && (int)Session["OrganizeCity"] > 1) { DropDownList ddl_VisitRoute = (DropDownList)pl_detail.FindControl("CM_ClientManufactInfo_VisitRoute"); if (ddl_VisitRoute != null) { ddl_VisitRoute.DataValueField = "ID"; ddl_VisitRoute.DataTextField = "Name"; ddl_VisitRoute.DataSource = VST_RouteBLL.GetByOrganizeCity((int)Session["OrganizeCity"]); ddl_VisitRoute.DataBind(); ddl_VisitRoute.Items.Insert(0, new ListItem("请选择...", "0")); } } }
void BindVisitRoute(int city) { if (city > 0) { DropDownList ddl_VisitRoute = (DropDownList)pl_detail.FindControl("CM_ClientManufactInfo_VisitRoute"); if (ddl_VisitRoute != null) { ddl_VisitRoute.DataValueField = "ID"; ddl_VisitRoute.DataTextField = "Name"; ddl_VisitRoute.DataSource = VST_RouteBLL.GetByOrganizeCity(city); ddl_VisitRoute.DataBind(); ddl_VisitRoute.Items.Insert(0, new ListItem("请选择...", "0")); } } }
void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e) { if (tr_OrganizeCity == null) { return; } int city = 0; int.TryParse(tr_OrganizeCity.SelectValue, out city); if (city > 0) { DropDownList ddl_VisitRoute = (DropDownList)pl_detail.FindControl("CM_ClientManufactInfo_VisitRoute"); if (ddl_VisitRoute != null) { ddl_VisitRoute.DataValueField = "ID"; ddl_VisitRoute.DataTextField = "Name"; ddl_VisitRoute.DataSource = VST_RouteBLL.GetByOrganizeCity(city); ddl_VisitRoute.DataBind(); ddl_VisitRoute.Items.Insert(0, new ListItem("请选择...", "0")); } #region 设置营业所编码 Addr_OrganizeCity citymodel = new Addr_OrganizeCityBLL(city).Model; TextBox tbx_OUTLOC = (TextBox)pl_detail.FindControl("CM_ClientManufactInfo_OUTLOC"); if (citymodel != null && tbx_OUTLOC != null) { tbx_OUTLOC.Text = citymodel.Code; } citymodel = new Addr_OrganizeCityBLL(citymodel.SuperID).Model; TextBox tbx_SALGRP = (TextBox)pl_detail.FindControl("CM_ClientManufactInfo_SALGRP"); if (citymodel != null && tbx_SALGRP != null) { tbx_SALGRP.Text = citymodel.Code; } #endregion } }