/// <summary> /// 关键字跟随 /// </summary> /// <param name="StudyId"></param> public void BindData(int StudyId) { this.Controls.Clear(); //常驻关键字 var list = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection <SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order <SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Asc) }, " biaojiid=0"); if (list != null && list.Count > 0) { var category = list.Find(l => l.Pid == 0); var control = new Keyword_UC2(category, list.Where(l => l.Pid == category.Id).OrderBy(l => l.OrderBy)); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } //私有关键字 list = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection <SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order <SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Asc) }, " biaojiid=[$biaojiid$]", new ORM.DataParameter("biaojiid", StudyId)); rbList = DataBase.Instance.tSRRC_Resourcebiaojirel.Get_EntityCollection(null, " biaoji_id=[$biaojiid$]", new ORM.DataParameter("biaojiid", StudyId)); if (list != null && list.Count > 0) { var categories = list.Where(l => l.Pid == 0).OrderByDescending(l => l.OrderBy); foreach (var item in categories) { var control = new Keyword_UC2(item, list.Where(l => l.Pid == item.Id).OrderBy(l => l.OrderBy)); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } } }
public void BindData(bool isFilter = false) { this.Controls.Clear(); if (SROperation2.Instance.StudySelectedId == 0) { return; } if (isFilter) { //私有关键字 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)); } var categories = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection <SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order <SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Desc) }, " biaojiid=[$biaojiid$] and Pid=0", new ORM.DataParameter("biaojiid", SROperation2.Instance.StudySelectedId)); foreach (var item in categories) { var control = new Keyword_UC2(item, list.Where(l => l.Pid == item.Id).OrderBy(l => l.OrderBy), true); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } } rbList = DataBase.Instance.tSRRC_Resourcebiaojirel.Get_EntityCollection(null, " biaoji_id=[$biaojiid$]", new ORM.DataParameter("biaojiid", SROperation2.Instance.StudySelectedId)); } else { //常驻关键字 var list = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection <SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order <SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Asc) }, " biaojiid=0"); if (list != null && list.Count > 0) { var category = list.Find(l => l.Pid == 0); var control = new Keyword_UC2(category, list.Where(l => l.Pid == category.Id).OrderBy(l => l.OrderBy)); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } //私有关键字 list = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection <SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order <SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Asc) }, " biaojiid=[$biaojiid$]", new ORM.DataParameter("biaojiid", SROperation2.Instance.StudySelectedId)); rbList = DataBase.Instance.tSRRC_Resourcebiaojirel.Get_EntityCollection(null, " biaoji_id=[$biaojiid$]", new ORM.DataParameter("biaojiid", SROperation2.Instance.StudySelectedId)); if (list != null && list.Count > 0) { var categories = list.Where(l => l.Pid == 0).OrderByDescending(l => l.OrderBy); foreach (var item in categories) { var control = new Keyword_UC2(item, list.Where(l => l.Pid == item.Id).OrderBy(l => l.OrderBy)); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } } } }
public void BindData(bool isFilter=false) { this.Controls.Clear(); if (SROperation2.Instance.StudySelectedId == 0) return; if(isFilter) { //私有关键字 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)); } var categories = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection<SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order<SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Desc) }, " biaojiid=[$biaojiid$] and Pid=0", new ORM.DataParameter("biaojiid", SROperation2.Instance.StudySelectedId)); foreach (var item in categories) { var control = new Keyword_UC2(item, list.Where(l => l.Pid == item.Id), true); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } } rbList = DataBase.Instance.tSRRC_Resourcebiaojirel.Get_EntityCollection(null, " biaoji_id=[$biaojiid$]", new ORM.DataParameter("biaojiid", SROperation2.Instance.StudySelectedId)); } else { //常驻关键字 var list = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection<SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order<SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Asc) }, " biaojiid=0"); if (list != null && list.Count > 0) { var category = list.Find(l => l.Pid == 0); var control = new Keyword_UC2(category, list.Where(l => l.Pid == category.Id)); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } //私有关键字 list = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection<SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order<SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Asc) }, " biaojiid=[$biaojiid$]", new ORM.DataParameter("biaojiid", SROperation2.Instance.StudySelectedId)); rbList = DataBase.Instance.tSRRC_Resourcebiaojirel.Get_EntityCollection(null, " biaoji_id=[$biaojiid$]", new ORM.DataParameter("biaojiid", SROperation2.Instance.StudySelectedId)); if (list != null && list.Count > 0) { var categories = list.Where(l => l.Pid == 0).OrderByDescending(l => l.OrderBy); foreach (var item in categories) { var control = new Keyword_UC2(item, list.Where(l => l.Pid == item.Id)); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } } } }
/// <summary> /// 关键字跟随 /// </summary> /// <param name="StudyId"></param> public void BindData(int StudyId) { this.Controls.Clear(); //常驻关键字 var list = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection<SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order<SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Asc) }, " biaojiid=0"); if (list != null && list.Count > 0) { var category = list.Find(l => l.Pid == 0); var control = new Keyword_UC2(category, list.Where(l => l.Pid == category.Id)); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } //私有关键字 list = DataBase.Instance.tSRRC_BiaoJiKeyword.Get_EntityCollection( new ORM.OrderCollection<SRRC_BiaoJiKeywordEntity.FiledType>() { new ORM.Order<SRRC_BiaoJiKeywordEntity.FiledType>(SRRC_BiaoJiKeywordEntity.FiledType.OrderBy, ORM.OrderType.Asc) }, " biaojiid=[$biaojiid$]", new ORM.DataParameter("biaojiid", StudyId)); rbList = DataBase.Instance.tSRRC_Resourcebiaojirel.Get_EntityCollection(null, " biaoji_id=[$biaojiid$]", new ORM.DataParameter("biaojiid", StudyId)); if (list != null && list.Count > 0) { var categories = list.Where(l => l.Pid == 0).OrderByDescending(l => l.OrderBy); foreach (var item in categories) { var control = new Keyword_UC2(item, list.Where(l => l.Pid == item.Id)); control.Margin = new Padding(1); control.Dock = DockStyle.Top; this.Controls.Add(control); } } }