Пример #1
0
        void init()
        {
            CustomFieldCriteria = new CustomFieldCriteria();
            CustomFieldes = new PagedSortableCollectionView<CustomFieldDTOWithActions> { PageSize = 20 };
            CustomFieldEntities = new ObservableCollection<CustomFieldEntity>();
            CustomFieldes.OnRefresh += (s, args) => refresh();
            CustomFieldCommands = new List<DataGridCommandViewModel>
            {
                   CommandHelper.GetControlCommands(this, appController, new List<int>{ (int) ActionType.CreateCustomField }).FirstOrDefault()
            };
            

        }
Пример #2
0
 public static string GetFilterQueryString(CustomFieldCriteria criteria)
 {
     return("EntityId=" + criteria.EntityId);
 }
Пример #3
0
        public void GetAllCustomFieldes(Action <PageResultDTO <CustomFieldDTOWithActions>, Exception> action, int pageSize,
                                        int pageIndex, Dictionary <string, string> sortBy, CustomFieldCriteria criteria)
        {
            var url = string.Format(apiCustomFieldAddress + "?PageSize={0}&PageIndex={1}&EntityId={2}",
                                    pageSize, pageIndex, criteria.EntityId,
                                    UriKind.Absolute);

            if (criteria.EntityId != null && criteria.EntityId != 0)
            {
                url += "&Filter=" + GetFilterQueryString(criteria);
            }

            if (sortBy.Count > 0)
            {
                url += "&SortBy=" + QueryConditionHelper.GetSortByQueryString(sortBy);
            }

            WebClientHelper.Get(new Uri(url), action, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
        }