Example #1
0
        private void resetDataAssistant(IClientRuleQueryBase clientQueryRule, ColumnEditCfgInfo columnEditCfgInfo, object currentEditObject,
                                        IInvokeDataAssistantHoster hoster, IGetObjectDataAssistant dataAssistant)
        {
            dataAssistant.HideFilterPane       = columnEditCfgInfo.HideFilterPane;
            dataAssistant.FilterClientRule     = clientQueryRule;
            dataAssistant.MultiSelect          = columnEditCfgInfo.DefaultBatchAdd;
            dataAssistant.InvokeDataSourceDesc = columnEditCfgInfo.InvokeDataSourceDesc;
            dataAssistant.QueryObject          = null;
            dataAssistant.ClumnEditCfgInfo     = columnEditCfgInfo;
            dataAssistant.InvokeParentControl  = this;

            dataAssistant.CurrentEditObject = currentEditObject;

            if (hoster != null)
            {
                dataAssistant.InvokeFilterParentFormHoster = hoster;
            }
        }
Example #2
0
        public void BeforeShowDataAssistant(object sender, InvokeDataAssistantHosterEventArgs args)
        {
            IInvokeDataAssistantHoster hoster = this.ClientRuleObject as IInvokeDataAssistantHoster;

            if (hoster != null)
            {
                if (tabCtlFilterMain.SelectedTabPage.Equals(tPageAdvanceFilter))
                {
                    args.PreFilterParameters = GetAdvanceQueryParameters(); //modify by aifang 2012-07-30 args.PreFilterParameters = _AdvanceFilter.GetQueryParameters();
                }
                else
                {
                    IPreFilterConditionCtl preFilter = _SimpleFilterControl as IPreFilterConditionCtl;
                    args.PreFilterParameters = preFilter.GetPreQueryParameters();
                }

                //校验当前列的限制列是否已有值
                var param = _DataElementCfgs[args.ClumnEditCfgInfo.Name].FilterLimits;
                if (param != null && param.Count > 0)
                {
                    foreach (var filter in param)
                    {
                        if (filter.Nullable)
                        {
                            continue;
                        }
                        if (args.PreFilterParameters != null && args.PreFilterParameters.Length > 0)
                        {
                            var limit = args.PreFilterParameters.Where(o => o.PropertyName.Equals(filter.Name)).ToList();
                            if (limit != null && limit.Count > 0)
                            {
                                continue;
                            }
                        }

                        string description = _Columns[filter.Name].Description;
                        throw new MB.Util.APPException(string.Format("请先选择{0}", description), APPMessageType.DisplayToUser);
                    }
                }

                hoster.BeforeShowDataAssistant(sender, args);
            }
        }
Example #3
0
        public void BeforeGetFilterData(object sender, InvokeDataAssistantHosterEventArgs args)
        {
            IInvokeDataAssistantHoster hoster = this.ClientRuleObject as IInvokeDataAssistantHoster;

            if (hoster != null)
            {
                if (tabCtlFilterMain.SelectedTabPage.Equals(tPageAdvanceFilter))
                {
                    args.PreFilterParameters = GetAdvanceQueryParameters(); //modify by aifang 2012-07-30 args.PreFilterParameters = _AdvanceFilter.GetQueryParameters();
                }
                else
                {
                    IPreFilterConditionCtl preFilter = _SimpleFilterControl as IPreFilterConditionCtl;
                    args.PreFilterParameters = preFilter.GetPreQueryParameters();
                }

                //校验当前列的限制列是否已有值
                var param = _DataElementCfgs[args.ClumnEditCfgInfo.Name].FilterLimits;
                if (param != null && param.Count > 0)
                {
                    foreach (var filter in param)
                    {
                        if (!filter.AllowFilterValue)
                        {
                            continue;
                        }
                        if (args.PreFilterParameters != null && args.PreFilterParameters.Length > 0)
                        {
                            var limit = args.PreFilterParameters.Where(o => o.PropertyName.Equals(filter.Name)).ToList();
                            if (limit != null && limit.Count > 0)
                            {
                                args.FilterParameters.Add(new Util.Model.QueryParameterInfo(filter.SourceName, limit[0].Value, filter.FilterCondition));
                            }
                        }
                    }
                }

                hoster.BeforeGetFilterData(sender, args);
            }
        }