public void ProcessRequest(HttpContext context) { string project_id = "6"; Redmine.Net.Api.RedmineManager redman = RedmineFactory.CreateInstance(); System.Collections.Specialized.NameValueCollection parameters = new System.Collections.Specialized.NameValueCollection { //{ "status_id", "*" } // , { Redmine.Net.Api.RedmineKeys.PROJECT_ID, project_id } }; /* * if (!string.IsNullOrEmpty(project_id)) * parameters[Redmine.Net.Api.RedmineKeys.PROJECT_ID] = project_id; */ // https://stackoverflow.com/questions/14839712/nginx-reverse-proxy-passthrough-basic-authenication // https://stackoverflow.com/questions/19751313/forward-request-headers-from-nginx-proxy-server System.Collections.Generic.List <Redmine.Net.Api.Types.Tracker> trackers = redman.GetObjects <Redmine.Net.Api.Types.Tracker>(parameters); foreach (Redmine.Net.Api.Types.Tracker thisTracker in trackers) { System.Console.WriteLine("#{0}: {1}", thisTracker.Id, thisTracker.Name); } // Next issue string json = Newtonsoft.Json.JsonConvert.SerializeObject(trackers, Newtonsoft.Json.Formatting.Indented); context.Response.ContentEncoding = System.Text.Encoding.UTF8; context.Response.ContentType = "application/json; charset=utf-8"; context.Response.Write(json); }
public void ProcessRequest(System.Web.HttpContext context) { Redmine.Net.Api.RedmineManager redman = RedmineFactory.CreateInstance(); System.Collections.Generic.List <Redmine.Net.Api.Types.Role> roles = redman.GetObjects <Redmine.Net.Api.Types.Role>(); string json = Newtonsoft.Json.JsonConvert.SerializeObject(roles, Newtonsoft.Json.Formatting.Indented); context.Response.ContentEncoding = System.Text.Encoding.UTF8; context.Response.ContentType = "application/json; charset=utf-8"; context.Response.Write(json); }
} // End Function GenerateVariableSlug public void ProcessRequest(System.Web.HttpContext context) { Redmine.Net.Api.RedmineManager redman = RedmineFactory.CreateInstance(); System.Collections.Generic.List <Redmine.Net.Api.Types.Project> projects = redman.GetObjects <Redmine.Net.Api.Types.Project>(100, 0); //foreach (Redmine.Net.Api.Types.Project thisProject in projects) //{ // string str = "public static Redmine.Net.Api.Types.IdentifiableName " + GenerateVariableSlug(thisProject.Identifier) + " = new Redmine.Net.Api.Types.IdentifiableName() { Id = " + thisProject.Id + " };"; // System.Console.WriteLine(str); //} // Next thisProject string json = Newtonsoft.Json.JsonConvert.SerializeObject(projects, Newtonsoft.Json.Formatting.Indented); context.Response.ContentEncoding = System.Text.Encoding.UTF8; context.Response.ContentType = "application/json; charset=utf-8"; context.Response.Write(json); }
// https://github.com/zapadi/redmine-net-api/blob/master/xUnitTest-redmine-net45-api/Tests/Sync/IssueTests.cs public static System.Collections.Generic.List <Redmine.Net.Api.Types.Issue> GetIssues(string project_id) { Redmine.Net.Api.RedmineManager redman = RedmineFactory.CreateInstance(); System.Collections.Specialized.NameValueCollection parameters = new System.Collections.Specialized.NameValueCollection { { "status_id", "*" } // ,{ Redmine.Net.Api.RedmineKeys.PROJECT_ID, project_id} }; if (!string.IsNullOrEmpty(project_id)) { parameters[Redmine.Net.Api.RedmineKeys.PROJECT_ID] = project_id; } // https://stackoverflow.com/questions/14839712/nginx-reverse-proxy-passthrough-basic-authenication // https://stackoverflow.com/questions/19751313/forward-request-headers-from-nginx-proxy-server return(redman.GetObjects <Redmine.Net.Api.Types.Issue>(parameters)); }