/// <summary> /// 绑定小类别 /// </summary> private void BindSmallType() { List <int[]> BigType = new List <int[]>(); BigType.Add(new int[] { 1, 2, 3, 4, 5, 6, 7, 9 }); BigType.Add(new int[] { 8, 10, 17 }); BigType.Add(new int[] { 11, 12, 13 }); BigType.Add(new int[] { 14, 15, 16 }); ddlSmallType.Items.Clear(); IList <ListItem> SmallTypes = EnumHandle.GetListEnumValue(typeof(EyouSoft.Model.CommunityStructure.TopicAreas)); foreach (ListItem item in SmallTypes) { for (int i = 0; i < BigType.Count; i++) { if (BigType[i].Contains(int.Parse(item.Value))) { item.Value += "_" + (i + 1).ToString(); break; } } if (item.Value != "0") { ddlSmallType.Items.Add(item); } } ddlSmallType.Items.Insert(0, new ListItem("请选择", "0")); }
/// <summary> /// 绑定大类别 /// </summary> private void BindBigType() { ddlBigType.Items.Clear(); ddlBigType.DataSource = EnumHandle.GetListEnumValue(typeof(EyouSoft.Model.CommunityStructure.TopicClass)); ddlBigType.DataTextField = "text"; ddlBigType.DataValueField = "value"; ddlBigType.DataBind(); ddlBigType.Items.Insert(0, new ListItem("请选择", "0")); }
/// <summary> /// 初始化供求信息的发布框 /// </summary> private void InitExchangeTag() { //发布联系信息初始化 if (IsLogin) { txtName.Value = SiteUserInfo.ContactInfo.ContactName; txtMQ.Value = SiteUserInfo.ContactInfo.MQ; txtTel.Value = string.IsNullOrEmpty(SiteUserInfo.ContactInfo.Tel) ? SiteUserInfo.ContactInfo.Mobile : SiteUserInfo.ContactInfo.Tel; } IList <ListItem> tmpList = null; //初始化标签 tmpList = new List <ListItem>(); tmpList = EnumHandle.GetListEnumValue(typeof(EyouSoft.Model.CommunityStructure.ExchangeTag)); rptExchangeTag.DataSource = tmpList; rptExchangeTag.DataBind(); ddlTag.DataSource = tmpList; ddlTag.DataTextField = "text"; ddlTag.DataValueField = "value"; ddlTag.DataBind(); ddlTag.Items.Insert(0, new ListItem("--标签--", "-1")); if (tmpList != null) { tmpList.Clear(); } tmpList = null; //初始化类别 tmpList = new List <ListItem>(); tmpList = EnumHandle.GetListEnumValue(typeof(EyouSoft.Model.CommunityStructure.ExchangeType)); rptExchangeType.DataSource = tmpList; rptExchangeType.DataBind(); ddlType.DataSource = tmpList; ddlType.DataTextField = "text"; ddlType.DataValueField = "value"; ddlType.DataBind(); ddlType.Items.Insert(0, new ListItem("--类别--", "-1")); if (tmpList != null) { tmpList.Clear(); } tmpList = null; //初始化发布到的省份 IList <EyouSoft.Model.SystemStructure.SysProvince> list = EyouSoft.BLL.SystemStructure.SysProvince.CreateInstance().GetEnabledList(); rptProvince.DataSource = list; rptProvince.DataBind(); ddlProvince.DataSource = list; ddlProvince.DataTextField = "ProvinceName"; ddlProvince.DataValueField = "ProvinceId"; ddlProvince.DataBind(); ddlProvince.Items.Insert(0, new ListItem("--省份--", "0")); if (list != null) { list.Clear(); } list = null; }
/// <summary> /// 初始化供求信息发布框 /// </summary> private void InitSDInfoRelease() { //发布联系信息初始化 if (IsLogin) { //求购 txtName.Value = SiteUserInfo.ContactInfo.ContactName; txtMQ.Value = SiteUserInfo.ContactInfo.MQ; txtTel.Value = string.IsNullOrEmpty(SiteUserInfo.ContactInfo.Tel) ? SiteUserInfo.ContactInfo.Mobile : SiteUserInfo.ContactInfo.Tel; //供应 stxtName.Value = SiteUserInfo.ContactInfo.ContactName; stxtMQ.Value = SiteUserInfo.ContactInfo.MQ; stxtTel.Value = string.IsNullOrEmpty(SiteUserInfo.ContactInfo.Tel) ? SiteUserInfo.ContactInfo.Mobile : SiteUserInfo.ContactInfo.Tel; } IList <ListItem> tmpList = null; //初始化类别 //IList<EnumObj> TypeList = new List<EnumObj>(); //TypeList = SupplierCom.GetExchangeTypeListByCat(EyouSoft.Model.CommunityStructure.ExchangeCategory.求); //StringBuilder sb = new StringBuilder(); //strSDType = "<option value=\"-1\">--无--</option>"; //if (TypeList != null && TypeList.Count > 0) //{ // for (int i = 0; i < TypeList.Count; i++) // { // sb.Append("<option value=\"" + TypeList[i].Value + "\">" + TypeList[i].Text + "</option>"); // } // strSDType = sb.ToString(); //} ////供应类别 //TypeList = new List<EnumObj>(); //TypeList = SupplierCom.GetExchangeTypeListByCat(EyouSoft.Model.CommunityStructure.ExchangeCategory.供); //sb = new StringBuilder(); //if (TypeList != null && TypeList.Count > 0) //{ // for (int i = 0; i < TypeList.Count; i++) // { // sb.Append("<option value=\"" + TypeList[i].Value + "\">" + TypeList[i].Text + "</option>"); // } // strSDTypeGY = sb.ToString(); //} //TypeList = null; //sb = null; //初始化标签 tmpList = new List <ListItem>(); tmpList = EnumHandle.GetListEnumValue(typeof(EyouSoft.Model.CommunityStructure.ExchangeTag)); rptExchangeTag.DataSource = tmpList; rptExchangeTag.DataBind(); //供应 srptExchangeTag.DataSource = tmpList; srptExchangeTag.DataBind(); //初始化发布到的省份 IList <EyouSoft.Model.SystemStructure.SysProvince> list = EyouSoft.BLL.SystemStructure.SysProvince.CreateInstance().GetEnabledList(); rptProvince.DataSource = list; rptProvince.DataBind(); //供应 srptProvince.DataSource = list; srptProvince.DataBind(); }