private void SelectDimensionValue(string formid, BeforeF7SelectEventArgs e, DimentionScopeType scopetype) { ListShowParameter parameter2 = new ListShowParameter { FormId = formid, ParentPageId = this.View.PageId, MultiSelect = true, SyncCallBackAction = true, IsShowQuickFilter = false, IsLookUp = true }; ListShowParameter param = parameter2; long iD = base.Context.CurrentOrganizationInfo.ID; if (this.GetBaseDataType("FCtrlDimensionEntry", e.Row, "Dimension") == "10") { param.FormId = "BOS_ASSISTANTDATA_SELECT"; string str2 = string.Format("FID='{0}'", formid); if (str2.IsNullOrEmptyOrWhiteSpace()) { param.ListFilterParameter.Filter = str2; } else { param.ListFilterParameter.Filter = param.ListFilterParameter.Filter.JoinFilterString(str2, "AND"); } param.IsIsolationOrg = true; param.UseOrgId = base.Context.CurrentOrganizationInfo.ID; } else if (OrganizationServiceHelper.GetBaseDataType(base.Context, formid) == 2) { FormMetadata cachedFormMetaData = FormMetaDataCache.GetCachedFormMetaData(base.Context, formid); string pkFieldName = cachedFormMetaData.BusinessInfo.GetForm().PkFieldName; string masterPKFieldName = cachedFormMetaData.BusinessInfo.GetForm().MasterPKFieldName; string tableName = cachedFormMetaData.BusinessInfo.Entrys[0].TableName; string useOrgFieldKey = cachedFormMetaData.BusinessInfo.GetForm().UseOrgFieldKey; param.ListFilterParameter.Filter = param.ListFilterParameter.Filter.JoinFilterString(string.Format(" {0}={1} and {1} in (select distinct {1} from {2} where FDOCUMENTSTATUS='C' AND FFORBIDSTATUS='A' AND {3} ={4}) ", new object[] { pkFieldName, masterPKFieldName, tableName, useOrgFieldKey, iD }), "AND"); param.IsIsolationOrg = false; } else { param.IsIsolationOrg = true; param.UseOrgId = base.Context.CurrentOrganizationInfo.ID; } param.OpenStyle.ShowType = ShowType.Modal; this.View.ShowForm(param, delegate(Kingdee.BOS.Core.DynamicForm.FormResult formResult) { if (formResult != null) { this.FillSelectedDatas(formResult, e, scopetype); } }); }
private void FillSelectedDatas(Kingdee.BOS.Core.DynamicForm.FormResult fre, BeforeF7SelectEventArgs e, DimentionScopeType scopetype) { if ((fre != null) && (fre.ReturnData != null)) { ListSelectedRowCollection returnData = (ListSelectedRowCollection)fre.ReturnData; if ((returnData != null) && (returnData.Count != 0)) { StringBuilder builder = new StringBuilder(); StringBuilder builder2 = new StringBuilder(); bool flag = false; foreach (ListSelectedRow row in returnData) { if (flag) { builder.Append(","); builder2.Append(","); } flag = true; builder.Append(row.PrimaryKeyValue); builder2.Append(row.Name); } switch (scopetype) { case DimentionScopeType.Dimension: this.View.Model.SetValue("FFilterKey", builder.ToString(), e.Row); this.View.Model.SetValue("FFilterName", builder2.ToString(), e.Row); this.View.Model.SetValue("FFilterKeyDesc", builder2.ToString(), e.Row); return; case DimentionScopeType.BillDimension: this.View.Model.SetValue("FBillFilterKey", builder.ToString(), e.Row); this.View.Model.SetValue("FBillFilterName", builder2.ToString(), e.Row); this.View.Model.SetValue("FBillFilterKeyDesc", builder2.ToString(), e.Row); return; } } } }