public Keyword_UC2(SRRC_BiaoJiKeywordEntity category, IEnumerable <SRRC_BiaoJiKeywordEntity> list, bool isFilter = false) : this() { this.list = list; this.Category = category; if (isFilter) { //keyword 筛选 this.CategoryName.Text = category.Name; this.Name = category.Id.ToString(); foreach (var item in list) { item.CategoryName = category.Name; var v = new Keyword_UC4(item); v.Name = item.Id.ToString(); //v.Tag = item; this.flp_keyword.Controls.Add(v); } //多选 var add = new Keyword_UC7(); add.ParentKeyword_UC2 = this; this.flp_keyword.Controls.Add(add); } else { //keyword 设置 this.CategoryName.Text = category.Name; foreach (var item in list) { var v = new Keyword_UC1(item.Name); v.Name = item.Id.ToString(); v.Tag = item; this.flp_keyword.Controls.Add(v); } } }
public Keyword_UC2(SRRC_BiaoJiKeywordEntity category,IEnumerable<SRRC_BiaoJiKeywordEntity> list,bool isFilter = false) : this() { this.list = list; this.Category = category; if(isFilter) { //keyword 筛选 this.CategoryName.Text = category.Name; this.Name = category.Id.ToString(); foreach (var item in list) { item.CategoryName = category.Name; var v = new Keyword_UC4(item); v.Name = item.Id.ToString(); //v.Tag = item; this.flp_keyword.Controls.Add(v); } //多选 var add = new Keyword_UC7(); add.ParentKeyword_UC2 = this; this.flp_keyword.Controls.Add(add); } else { //keyword 设置 this.CategoryName.Text = category.Name; foreach (var item in list) { var v = new Keyword_UC1(item.Name); v.Name = item.Id.ToString(); v.Tag = item; this.flp_keyword.Controls.Add(v); } } }
public void Convert_UC4_To_UC1() { var controlsName = new List <string>(); foreach (UserControl item in this.flp_keyword.Controls) { if (!item.Visible) { continue; } controlsName.Add(item.Name); } this.flp_keyword.Controls.Clear(); foreach (var item in list) { item.CategoryName = Category.Name; var v = new Keyword_UC1(item); v.Name = item.Id.ToString(); // v.Tag = item; this.flp_keyword.Controls.Add(v); if (!controlsName.Contains(item.Id.ToString())) { v.Visible = false; } } var v1 = new Keyword_UC4("确定", true); v1.Tag = this; this.flp_keyword.Controls.Add(v1); var v2 = new Keyword_UC4("取消", false); v2.Tag = this; this.flp_keyword.Controls.Add(v2); (this.ParentForm as FrmMain).reCalcKeywordPanelHeight(); }
public void BindData() { //常驻关键字 this.flb_resident.Controls.Clear(); if(SROperation2.Instance.StudySelectedId > 0) { var sql = @" select tb.* from ( select distinct BiaoJiKeywordId from [dbo].[SRRC_ResourceBiaoJiRel_BiaoJiKeyword] where [ResourceBiaoJiRelId] in (select Id FROM [dbo].[SRRC_Resourcebiaojirel] WHERE Biaoji_id=[$biaoJiId$])) as ta inner join [dbo].[SRRC_BiaoJiKeyword] as tb on ta.BiaoJiKeywordId=tb.Id and tb.BiaoJiId=0"; var v = DataBaseHelper.Instance.Helper.ExecuteQuery(CommandType.Text, sql, new ORM.DataParameter("biaoJiId", SROperation2.Instance.StudySelectedId)); if (v.Rows.Count > 0) { var list = new List<SRRC_BiaoJiKeywordEntity>(); foreach (DataRow dr in v.Rows) { list.Add(DataBase.Instance.tSRRC_BiaoJiKeyword.Populate_Entity_FromDr(dr)); } foreach (var item in list) { var control = new Keyword_UC1(item.Name, true); control.Tag = item; this.flb_resident.Controls.Add(control); } } } //私有关键字 this.keyword_UC31.BindData(true); //筛选结果 //null this.flp_filter.Controls.Clear(); }
public void Convert_UC4_To_UC1() { var controlsName = new List<string>(); foreach (UserControl item in this.flp_keyword.Controls) { if (!item.Visible) continue; controlsName.Add(item.Name); } this.flp_keyword.Controls.Clear(); foreach (var item in list) { item.CategoryName = Category.Name; var v = new Keyword_UC1(item); v.Name = item.Id.ToString(); // v.Tag = item; this.flp_keyword.Controls.Add(v); if (!controlsName.Contains(item.Id.ToString())) { v.Visible = false; } } var v1 = new Keyword_UC4("确定",true); v1.Tag = this; this.flp_keyword.Controls.Add(v1); var v2 = new Keyword_UC4("取消", false); v2.Tag = this; this.flp_keyword.Controls.Add(v2); (this.ParentForm as FrmMain).reCalcKeywordPanelHeight(); }