protected void Rcb_SalePlatform_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { RCB_SalePlatform.Items.Clear(); RCB_SalePlatform.Text = ""; var filialeId = !string.IsNullOrEmpty(RCB_SaleFiliale.SelectedValue)?RCB_SaleFiliale.SelectedValue.ToGuid():Guid.Empty; if (filialeId != Guid.Empty) { IList <SalePlatformInfo> salePlatformInfos = CacheCollection.SalePlatform.GetListByFilialeId(filialeId); if (salePlatformInfos.Count == 0) { var filialeInfos = new List <FilialeInfo>(); var filiale = CacheCollection.Filiale.GetChildShopList(filialeId).ToList(); filialeInfos.AddRange(filiale); foreach (var filialeInfo in filiale) { filialeInfos.AddRange(CacheCollection.Filiale.GetChildShopList(filialeInfo.ID).ToList()); } RCB_SalePlatform.DataSource = CB_ContainDisableSalePlatform.Checked ? filialeInfos : filialeInfos.Where(ent => ent.IsActive).ToList(); RCB_SalePlatform.DataBind(); } else { RCB_SalePlatform.DataSource = CB_ContainDisableSalePlatform.Checked ? salePlatformInfos : salePlatformInfos.Where(ent => ent.IsActive).ToList(); RCB_SalePlatform.DataBind(); } RCB_SalePlatform.Items.Insert(0, new RadComboBoxItem("全部平台", Guid.Empty.ToString())); } }
protected void OnCheckedChanged_ContainDisableSalePlatform(object sender, EventArgs e) { RCB_SalePlatform.Items.Clear(); var filialeId = RCB_SaleFiliale.SelectedValue.ToGuid(); if (filialeId == Guid.Empty) { return; } IList <SalePlatformInfo> salePlatformInfos = CB_ContainDisableSalePlatform.Checked ? CacheCollection.SalePlatform.GetListByFilialeId(filialeId) : CacheCollection.SalePlatform.GetListByFilialeId(filialeId).Where(ent => ent.IsActive).ToList(); if (salePlatformInfos.Count == 0) { var filialeInfos = new List <FilialeInfo>(); var filiale = CacheCollection.Filiale.GetChildShopList(filialeId).ToList(); filialeInfos.AddRange(filiale); foreach (var filialeInfo in filiale) { filialeInfos.AddRange(CacheCollection.Filiale.GetChildShopList(filialeInfo.ID).ToList()); } RCB_SalePlatform.DataSource = CB_ContainDisableSalePlatform.Checked ? filialeInfos : filialeInfos.Where(ent => ent.IsActive).ToList(); RCB_SalePlatform.DataBind(); } else { RCB_SalePlatform.DataSource = salePlatformInfos; RCB_SalePlatform.DataBind(); } RCB_SalePlatform.Items.Insert(0, new RadComboBoxItem("全部平台", Guid.Empty.ToString())); }
/// <summary> /// 销售平台 /// </summary> public void LoadSalePlatformData(Guid saleFilialeId) { RCB_SalePlatform.DataSource = CacheCollection.SalePlatform.GetListByFilialeId(saleFilialeId).ToList(); RCB_SalePlatform.DataTextField = "Name"; RCB_SalePlatform.DataValueField = "ID"; RCB_SalePlatform.DataBind(); RCB_SalePlatform.Items.Insert(0, new RadComboBoxItem(string.Empty, Guid.Empty.ToString())); }
protected void RCB_SaleFiliale_OnSelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { var radComboBox = o as RadComboBox; if (radComboBox == null) { return; } var rcbSaleFiliale = radComboBox.Parent.FindControl("RCB_SaleFiliale") as RadComboBox; var rcbSalePlatform = radComboBox.Parent.FindControl("RCB_SalePlatform") as RadComboBox; if (rcbSalePlatform != null) { rcbSalePlatform.Items.Clear(); } if (rcbSaleFiliale == null) { return; } var rcbSaleFilialeId = new Guid(rcbSaleFiliale.SelectedValue); if (rcbSaleFilialeId == Guid.Empty) { if (rcbSalePlatform != null) { rcbSalePlatform.Items.Clear(); } SalePlatformId = Guid.Empty; IsEnabledRTB_Member(); return; } RCB_SalePlatform.DataSource = rcbSaleFilialeId == Guid.Empty ? CacheCollection.SalePlatform.GetList() : CacheCollection.SalePlatform.GetListByFilialeId(rcbSaleFilialeId).ToList(); RCB_SalePlatform.DataTextField = "Name"; RCB_SalePlatform.DataValueField = "ID"; RCB_SalePlatform.DataBind(); RCB_SalePlatform.Items.Insert(0, new RadComboBoxItem("全部", Guid.Empty.ToString())); RCB_SalePlatform.SelectedIndex = 0; SaleFilialeId = new Guid(RCB_SaleFiliale.SelectedValue); SalePlatformId = new Guid(RCB_SalePlatform.SelectedValue); IsEnabledRTB_Member(); if (SaleFilialeId == new Guid("B6B39773-E76E-4A53-9AAC-634E7DF973EA"))//门店总公司 { RTB_UserName.Enabled = true; } }
private void LoadSaleFilialeAndSalePlatform() { RCB_SaleFiliale.DataSource = CacheCollection.Filiale.GetHeadList(); RCB_SaleFiliale.DataTextField = "Name"; RCB_SaleFiliale.DataValueField = "ID"; RCB_SaleFiliale.DataBind(); RCB_SaleFiliale.Items.Insert(0, new RadComboBoxItem("全部", Guid.Empty.ToString())); RCB_SaleFiliale.SelectedIndex = 0; RCB_SalePlatform.DataSource = CacheCollection.SalePlatform.GetList(); RCB_SalePlatform.DataTextField = "Name"; RCB_SalePlatform.DataValueField = "ID"; RCB_SalePlatform.DataBind(); RCB_SalePlatform.Items.Insert(0, new RadComboBoxItem("全部", Guid.Empty.ToString())); RCB_SalePlatform.SelectedIndex = 0; SaleFilialeID = new Guid(RCB_SaleFiliale.SelectedValue); SalePlatformID = new Guid(RCB_SalePlatform.SelectedValue); }
/// <summary> /// 绑定站点信息 /// </summary> protected void BindWebSiteInfo() { var list = CacheCollection.Filiale.GetHeadList(); RCB_SaleFiliale.DataSource = list; RCB_SaleFiliale.DataTextField = "Name"; RCB_SaleFiliale.DataValueField = "ID"; RCB_SaleFiliale.DataBind(); RCB_SalePlatform.DataSource = CacheCollection.SalePlatform.GetList(); RCB_SalePlatform.DataTextField = "Name"; RCB_SalePlatform.DataValueField = "ID"; RCB_SalePlatform.DataBind(); RCB_SalePlatform.Items.Insert(0, new RadComboBoxItem("全部", Guid.Empty.ToString())); RCB_SalePlatform.SelectedIndex = 0; SaleFilialeId = new Guid(RCB_SaleFiliale.SelectedValue); SalePlatformId = new Guid(RCB_SalePlatform.SelectedValue); }
protected void RCB_SaleFiliale_OnSelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { var radComboBox = o as RadComboBox; if (radComboBox == null) { return; } var rcbSaleFiliale = radComboBox.Parent.FindControl("RCB_SaleFiliale") as RadComboBox; var rcbSalePlatform = radComboBox.Parent.FindControl("RCB_SalePlatform") as RadComboBox; if (rcbSalePlatform != null) { rcbSalePlatform.Items.Clear(); } if (rcbSaleFiliale == null) { return; } var rcbSaleFilialeId = new Guid(rcbSaleFiliale.SelectedValue); RCB_SalePlatform.DataSource = rcbSaleFilialeId == Guid.Empty ? CacheCollection.SalePlatform.GetList() : CacheCollection.SalePlatform.GetList().Where(item => item.FilialeId == rcbSaleFilialeId).ToList(); RCB_SalePlatform.DataTextField = "Name"; RCB_SalePlatform.DataValueField = "ID"; RCB_SalePlatform.DataBind(); if (rcbSaleFilialeId != Guid.Empty) { var shopList = CacheCollection.Filiale.GetChildShopList(rcbSaleFilialeId); for (var i = 0; i < shopList.Count; i++) { RCB_SalePlatform.Items.Insert(i, new RadComboBoxItem(shopList[i].Name, shopList[i].ID.ToString())); } } RCB_SalePlatform.Items.Insert(0, new RadComboBoxItem("全部", Guid.Empty.ToString())); RCB_SalePlatform.SelectedIndex = 0; SaleFilialeID = new Guid(RCB_SaleFiliale.SelectedValue); SalePlatformID = new Guid(RCB_SalePlatform.SelectedValue); }