public List <ProjectFindResult> CollectProjects(string filter) { ProjectApi api = new ProjectApi(site, company, username, password, cookie); List <ProjectFindResult> results = api.FindProjects(filter, "Id", null, null, null, returnFields); logger.Info("Found " + results.Count + " projects"); return(results); }
/// <summary> /// 根据爬取楼盘名称获取对应的库名称 /// </summary> /// <param name="projectNames"></param> /// <param name="cityName"></param> /// <returns></returns> public static Dictionary <string, string> GetNowProjectNameJoinFxtProjectName(string[] projectNames, string cityName) { Dictionary <string, string> dic = null; if (projectNames != null && projectNames.Length > 0) { List <string> strList = new List <string>(); foreach (string str in projectNames) { if (!string.IsNullOrEmpty(str)) { string str2 = strList.Where(p => p == str).FirstOrDefault(); if (string.IsNullOrEmpty(str2)) { strList.Add(str); } } } projectNames = strList.ToArray(); } if (projectNames == null || projectNames.Length < 1) { return(dic); } dic = new Dictionary <string, string>(); foreach (string str in projectNames) { if (!dic.ContainsKey(str)) { dic.Add(str, ""); } } if (string.IsNullOrEmpty(cityName)) { return(dic); } FxtApi_SYSCity city = CityApi.GetCityByCityName(cityName); if (city == null) { return(dic); } foreach (string str in projectNames) { string value = ""; List <FxtApi_DATProject> projectList = ProjectApi.GetProjectJoinProjectMatchByProjectNameCityId(str, city.CityId); if (projectList != null && projectList.Count > 0) { value = projectList[0].ProjectName; } dic[str] = value; } return(dic); }
private GitLabClient(Uri uri, string privateToken) { var clientFactory = new ClientFactory(uri, new PrivateTokenAuthenticator(privateToken)); var requestFactory = new RequestFactory(clientFactory); Branches = new BranchesApi(requestFactory); Commits = new CommitsApi(requestFactory); Files = new FileApi(requestFactory); Issues = new IssueApi(requestFactory); Projects = new ProjectApi(requestFactory); Users = new UserApi(requestFactory); }
/// <summary> /// 根据名称+城市名称 模糊获取 /// </summary> /// <param name="likeName"></param> /// <param name="cityName"></param> /// <param name="count"></param> /// <returns>FxtApi_DATProject实体json字符串数组</returns> public static string[] GetProjectInfoStringsByLikeNameAndCityName(string likeName, string cityName, int count) { string[] strings = null; List <FxtApi_DATProjectView> list = ProjectApi.GetProjectViewByCityNameAndLikeProjectName(likeName, cityName, count); if (list != null && list.Count > 0) { List <string> strList = new List <string>(); foreach (FxtApi_DATProjectView project in list) { strList.Add(project.EncodeField().ToJSONjss()); } strings = strList.ToArray(); } return(strings); }
private RtcClient(Uri uri, BasicAuthentication basicAuthentication = null) { ClientFactory clientFactory; if (basicAuthentication != null) { clientFactory = new ClientFactory(uri, new HttpBasicAuthenticator( basicAuthentication.Username, basicAuthentication.Password)); } else { clientFactory = new ClientFactory(uri, null); } var requestFactory = new RequestFactory(clientFactory); Auth = new AuthApi(requestFactory); Issues = new IssueApi(requestFactory); Projects = new ProjectApi(requestFactory); }
public ActionResult AddProject_FancyboxSubmit_Api(string projectName, int cityId, int areaId, int purposeCode, string address) { //FxtApi_SYSCode en = new FxtApi_SYSCode(); //en.Code = 1; //en.CodeName = ""; //en.CodeType = ""; //en.ID = 11; //en.Remark = ""; string json = ""; projectName = projectName.DecodeField().TrimBlank(); address = address.DecodeField(); if (string.IsNullOrEmpty(projectName)) { Response.Write(json.MvcResponseJson(result: 0, message: "请填写楼盘名")); Response.End(); return(null); } if (cityId < 1 || areaId < 1) { Response.Write(json.MvcResponseJson(result: 0, message: "请选择城市和行政区")); Response.End(); return(null); } if (purposeCode < 1) { Response.Write(json.MvcResponseJson(result: 0, message: "请选择用途")); Response.End(); return(null); } string message = ""; bool result = ProjectApi.InsertProjectApi(projectName, cityId, areaId, purposeCode, address, out message); json = WebJsonHelp.MvcResponseJson("", result: result ? 1 : 0, message: message); Response.Write(json); Response.End(); return(null); }
public static bool InsertProjectMatchByCaseListAndProjectNameAndCityName(List <VIEW_案例信息_城市表_网站表> vlist, string projectName, string cityName, out string message) { message = ""; if (vlist == null || vlist.Count < 1) { return(true); } FxtApi_DATProject project = ProjectApi.GetProjectByProjectNameAndCityName(projectName, cityName); if (project == null) { message = "楼盘名不存在"; return(false); } List <FxtApi_SYSProjectMatch> List2 = new List <FxtApi_SYSProjectMatch>(); foreach (VIEW_案例信息_城市表_网站表 _case in vlist) { string _projectname = string.IsNullOrEmpty(_case.ProjectName) ? _case.楼盘名 : _case.ProjectName; if (!string.IsNullOrEmpty(_projectname)) { string name = _projectname.Trim(); FxtApi_SYSProjectMatch obj = List2.Where(p => p.NetName.Equals(name)).FirstOrDefault(); if (obj == null) { obj = new FxtApi_SYSProjectMatch(); obj.NetName = name; obj.ProjectName = project.ProjectName; obj.ProjectNameId = project.ProjectId; obj.CityId = project.CityID; List2.Add(obj); } } } bool result = ProjectMatchApi.InsertProjectMatch(List2, out message); return(result); }
public ProjectController() { projectApi = new ProjectApi(); }
public void Init() { instance = new ProjectApi(); }
public void Init() { instance = new ProjectApi(new TestConfig()); }
public List<ProjectFindResult> CollectProjects(string filter) { ProjectApi api = new ProjectApi(site, company, username, password, cookie); List<ProjectFindResult> results = api.FindProjects(filter, "Id", null, null, null, returnFields); logger.Info("Found " + results.Count + " projects"); return results; }