コード例 #1
0
        /// <summary>
        /// Find labels according to the request values supplied (if just a blank request is sent all labels will be returned
        /// </summary>
        /// <param name="request">The request containing the filter criteria</param>
        /// <returns>a list of labels if any were found</returns>
        public ApptLabelsResponse Any(FindApptLabels request)
        {
            //return ExecuteFaultHandledMethod(() =>
            //{
            ApptLabelsResponse response = new ApptLabelsResponse();

            if (request != null)
            {
                var query = BuildQuery <ApptLabel>(request);

                var _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <ApptLabel, IDataContextNhJars> >();

                IList <ApptLabel> resList = _repository.Where(query).ToList();
                if (resList.Count == 0 && request.ViewType != "" && request.LabelName == null)
                {
                    CreateDefaultRecord(request, _repository);
                    response.Labels = _repository.Where(query).ConvertAllTo <ApptLabelDto>().ToList();
                }
                else
                {
                    response.Labels = resList.ConvertAllTo <ApptLabelDto>().ToList();
                }
            }
            return(response);
            //});
        }
コード例 #2
0
        public override async void OnRefreshDataAsync()
        {
            base.OnRefreshDataAsync();
            ApptLabelsResponse apptLabelsResponse = await ServiceClient.GetAsync(new FindApptLabels());

            defaultBindingSource.DataSource = apptLabelsResponse.Labels.ConvertAllTo <ApptLabel>();
            FormEditState = FormEditStates.Browsing;
        }
コード例 #3
0
        /// <summary>
        /// Update or create a list of apptLabels
        /// </summary>
        /// <param name="request">The request containing the apptLabels that needs to be created or updated</param>
        /// <returns>the apptLabels will be returned.</returns>
        public virtual ApptLabelsResponse Any(StoreApptLabels request)
        {
            //return ExecuteFaultHandledMethod(() =>
            //{
            ApptLabelsResponse response = new ApptLabelsResponse();
            //IApptLabelRepository _repository = _DataRepositoryFactory.GetDataRepository<IApptLabelRepository>();
            var _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <ApptLabel, IDataContextNhJars> >();

            response.Labels = StoreLabels(request.Labels, CurrentSessionUsername, _repository);

            return(response);
            //});
        }