예제 #1
0
        public async Task <APIEndpointResponseModels.GetEndpointsList> GetEndpointsWithWarningsList(APIEndpointRequestModels.GetEndpointsList rm)
        {
            string strResult = await HttpPost("/api/Endpoints/GetEndpointsWithWarningsList", JsonConvert.SerializeObject(rm));

            APIEndpointResponseModels.GetEndpointsList result = (APIEndpointResponseModels.GetEndpointsList)JsonConvert.DeserializeObject(strResult, typeof(APIEndpointResponseModels.GetEndpointsList));
            return(result);
        }
예제 #2
0
        public APIEndpointResponseModels.GetEndpointsList GetEndPointsWithWarnings(string searchFor, long?deviceID, long?thingID, long?locationID, long?viewID, bool loadDevice, bool loadThing, int pageNumber, int pageSize)
        {
            APIEndpointResponseModels.GetEndpointsList result = new APIEndpointResponseModels.GetEndpointsList();

            IPagedList <Endpoint> endpointsPL = uof_Repositories.repoEndpoints.GetEndpointsWithWarningsPagedList(searchFor, deviceID, thingID, locationID, viewID, pageNumber, pageSize);
            List <Endpoint>       endpoints   = endpointsPL.ToList();

            List <APIEndPoint> listAPIEndpoints = new List <APIEndPoint>();

            foreach (Endpoint end in endpoints)
            {
                APIEndPoint apiEnd = TypesMapper.APIEndPointAdapter.fromEndpoint(end, loadDevice, loadThing);
                listAPIEndpoints.Add(apiEnd);
            }
            result.Endpoints = listAPIEndpoints;


            PagingInfoResponseModel pagingInfo = new PagingInfoResponseModel();

            pagingInfo.CurrentPage  = endpointsPL.PageNumber;
            pagingInfo.ItemsPerPage = endpointsPL.PageSize;
            pagingInfo.ItemsCount   = endpointsPL.TotalItemCount;
            pagingInfo.PagesCount   = endpointsPL.PageCount;
            result.PagingInfo       = pagingInfo;
            return(result);
        }
예제 #3
0
        private async void btnGetEndPointsWarnings_Click(object sender, EventArgs e)
        {
            Initialize();
            APIEndpointResponseModels.GetEndpointsList ends = await uow.EndPointsService.GetEndpointsWithWarningsList(new APIEndpointRequestModels.GetEndpointsList {
                Token = Guid.Parse(conf.Token)
            });

            gv1.DataSource = ends.Endpoints;
        }
예제 #4
0
        private async void btnGetEndPoints_Click(object sender, EventArgs e)
        {
            Initialize();

            APIEndpointRequestModels.GetEndpointsList model = new APIEndpointRequestModels.GetEndpointsList();
            model.DeviceID = 0; model.PageNumber = 1; model.PageSize = 1; model.Token = Guid.Parse(txtToken.Text);

            APIEndpointResponseModels.GetEndpointsList ends = await uow.EndPointsService.GetEndpointsListAsync(model);

            gv1.DataSource = ends.Endpoints;
        }