// Copyright Siemens 2019 using Camstar.WCF.ObjectStack; using Camstar.WebPortal.FormsFramework; using Camstar.WebPortal.FormsFramework.Utilities; using Camstar.WebPortal.WCFUtilities; using System; namespace Camstar.WebPortal.WebPortlets { public class MfgOrderMaint : MatrixWebPart { protected virtual Camstar.WebPortal.FormsFramework.WebControls.RevisionedObject rdoSpec { get { return Page.FindCamstarControl("rdoSpec") as Camstar.WebPortal.FormsFramework.WebControls.RevisionedObject; } } protected override void onl oad(EventArgs e) { base.OnLoad(e); LoadPickList(); } public void LoadPickList() { string _FilterText = rdoSpec.PickListPanelControl.FilterControl.FilterText; string sqltext = @" select sb.SpecName Name,s.SpecRevision Revision,s.IsFrozen,s.SpecId InstanceID,s.Description from spec s,specbase sb where s.SpecBaseId = sb.SpecBaseId "; if (!string.IsNullOrEmpty(_FilterText)) { sqltext += " and sb.SpecName like '%" + _FilterText + "%'"; } RecordSet objResult = AdHocRequestRecordSet(sqltext); if (objResult != null) { rdoSpec.PickListPanelControl.DataProvider = new Camstar.WebPortal.FormsFramework.WebControls.PickLists.StaticValuesDataProvider(objResult); CamstarWebControl.SetRenderToClient(rdoSpec); } } public RecordSet AdHocRequestRecordSet(string sqltext, int _RowSetSize = 100) { FrameworkSession currentSession = FrameworkManagerUtil.GetFrameworkSession(); QueryUtil QueryService = new QueryUtil(currentSession.CurrentUserProfile); RecordSet queryResult = new RecordSet(); ResultStatus resultStatus = new ResultStatus(); QueryOptions queryOption = new QueryOptions { QueryType = WCF.ObjectStack.QueryType.User, StartRow = 1, RowSetSize = _RowSetSize }; QueryService.ExecuteSQL(sqltext, queryOption, ref queryResult, ref resultStatus); if (queryResult != null) if (queryResult.Rows != null) return queryResult; return null; } } }
我这个是建模mfgOrder上弹出materialList编辑的Spec失效了,所以这个代码挂在目录C:\Program Files (x86)\Camstar\Camstar Portal\App_Code\WebPortlets\Modeling下的。
然后在vp上绑定代码:(如图)
标签:queryResult,FormsFramework,Camstar,CamstarVP,下拉选,using,失效,sqltext,WebPortal From: https://www.cnblogs.com/CarryYou-lky/p/17359288.html