Exemplo n.º 1
0
        /// <summary>
        /// Update or create a list of EntityRules.
        /// </summary>
        /// <param name="request">The request containing the EntityRules that needs to be created or updated</param>
        /// <returns>the list of values updated or created will be returned.</returns>
        public virtual JarsRulesResponse Any(StoreJarsRules request)
        {
            //return ExecuteFaultHandledMethod(() =>
            //{
            JarsRulesResponse response = new JarsRulesResponse();
            IGenericEntityRepositoryBase <JarsRule, IDataContextNhJars> _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <JarsRule, IDataContextNhJars> >();

            response.Rules = _repository.CreateUpdateList(request.Rules, CurrentSessionUsername).ToList();
            return(response);
            // });
        }
Exemplo n.º 2
0
        public object Any(FindJarsRules request)
        {
            //return ExecuteFaultHandledMethod(() =>
            //{
            JarsRulesResponse response = new JarsRulesResponse();

            if (request != null)
            {
                var query       = BuildQuery <JarsRule>(request);
                var _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <JarsRule, IDataContextNhJars> >();
                //because the EntityRule is a core class and is used as is, there is no need for dtos or transformations. :-)
                response.Rules = _repository.Where(query, true).ToList();
            }
            return(response);
            //});
        }
Exemplo n.º 3
0
        public override async void OnRefreshDataAsync()
        {
            try
            {
                base.OnRefreshDataAsync();

                JarsRulesResponse entityRulesResponse = await ServiceClient.GetAsync(new FindJarsRules());

                ////    EntityRulesResponse conditionsResponse = await SSEventClient.ServiceClient.PostAsync(new FindEntityRules { EntityTypeNameLike = typeof(Resource).AssemblyQualifiedName });
                defaultBindingSource.DataSource = entityRulesResponse.Rules;
                defaultBindingSource.ResetBindings(false);
                UpdateLinkedBindingSources();
                FormEditState = FormEditStates.Browsing;
            }
            catch (Exception exR)
            {
                OnExceptionEvent(exR);
            }
        }
Exemplo n.º 4
0
        public override async void OnRefreshDataAsync()
        {
            try
            {
                base.OnRefreshDataAsync();
                ResourcesResponse operativeResponse = await Context.ServiceClient.GetAsync(new FindResources()
                {
                    FetchEagerly = true
                });

                JarsRulesResponse conditionsResponse = await Context.ServiceClient.GetAsync(new FindJarsRules { TargetEntityTypeName = typeof(JarsResource).Name });

                defaultBindingSource.DataSource = operativeResponse.Resources.ConvertAll(r => r.ConvertTo <JarsResource>());
                ResourceEntityRulesList         = conditionsResponse.Rules.ToList <IJarsRule>().Where(r => r.TargetCriteriaString.Contains("[Id] = ")).ToList();
                UpdateLinkedBindingSources();
                FormEditState = FormEditStates.Browsing;
            }
            catch (Exception exR)
            {
                OnExceptionEvent(exR);
            }
        }