Ejemplo n.º 1
0
        public async Task GetSingleResourceAsync(ResourceList container, string resourceString = null)
        {
            IsLoading = true;
            _lastClientCall = DateTime.Now;
            String strContent = await ViewModelLocator.Client.MakeOperationAsync(container.GetSupportedModule(),
                                                                              SupportedMethods.GetSingleResource,
                                                                              container.Cours.sysCode,
                                                                              resourceString);
            if (strContent != "")
            {

                ResourceModel resource = (ResourceModel)JsonConvert.DeserializeObject(strContent, container.ressourceType);
                AddResource(resource, container.Id);
            }
            IsLoading = false;
        }
Ejemplo n.º 2
0
        public async Task GetResourcesForThisListAsync(ResourceList container)
        {
            IsLoading = true;
            _lastClientCall = DateTime.Now;
            String strContent = await ViewModelLocator.Client.MakeOperationAsync(container.GetSupportedModule(),
                                                                              SupportedMethods.GetResourcesList,
                                                                              syscode: container.Cours.sysCode,
                                                                              genMod: container.label);

            if (strContent != "")
            {
                IList resources = (IList)JsonConvert.DeserializeObject(strContent, container.ressourceListType);

                foreach (ResourceModel item in resources)
                {
                    AddResource(item, container.Id);
                }
                container.loaded = DateTime.Now;
            }
            IsLoading = false;
        }