示例#1
0
        public static async Task <List <string> > Getappendixnames(string url)
        {
            try
            {
                string result = await Task.Run(() =>
                                               WebApiCaller.HttpGet(url, true));

                JObject obj  = JObject.Parse(result);
                string  data = obj["data"].ToString();
                return(JsonConvert.DeserializeObject <List <string> >(data));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
示例#2
0
        public static async Task <List <DataSourceType> > GetDataSourceTypes()
        {
            try
            {
                string result = await Task.Run(() =>
                                               WebApiCaller.HttpGet(ServiceConfig.BaseURL + ServiceConfig.datasourcetypeURL, true));

                JObject obj  = JObject.Parse(result);
                string  data = obj["data"].ToString();
                return(JsonConvert.DeserializeObject <List <DataSourceType> >(data));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
示例#3
0
        //获取工程列表信息
        //
        public static async Task <List <ProjectList> > GetProjectList()
        {
            try
            {
                //网络请求
                string result = await Task.Run(() =>
                                               WebApiCaller.HttpGet(ServiceConfig.BaseURL + ServiceConfig.projectlistURL, true));

                JObject obj  = JObject.Parse(result);
                string  data = obj["data"].ToString();
                return(JsonConvert.DeserializeObject <List <ProjectList> >(data));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
示例#4
0
        public static async Task <List <EngineeringMap> > GetEMaps(string project)
        {
            try
            {
                //网络请求
                string result = await Task.Run(() =>
                                               WebApiCaller.HttpGet(ServiceConfig.BaseURL + string.Format(ServiceConfig.projectemapFormat, project), true));

                JObject obj  = JObject.Parse(result);
                string  data = obj["data"].ToString();
                return(JsonConvert.DeserializeObject <List <EngineeringMap> >(data));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
示例#5
0
        //获取对象树信息
        //
        public static async Task <List <TreeDefinition> > GetProjectTree(string project, string domain)
        {
            try
            {
                //网络请求
                string result = await Task.Run(() =>
                                               WebApiCaller.HttpGet(ServiceConfig.BaseURL + string.Format(ServiceConfig.projecttreeFormat, project, domain), true));

                JObject obj  = JObject.Parse(result);
                string  data = obj["data"].ToString();
                return(JsonConvert.DeserializeObject <List <TreeDefinition> >(data));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }