2014. 12. 13. 14:06

RedMine API 를 이용 값불러오기.




Redmine.Net.Api.dll

래드마인 DLL 파일.




using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using Redmine.Net.Api;

using Redmine.Net.Api.Types;

using System.Collections.Specialized;


public partial class _Default : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {



        string host = "https://www.duck.pe.kr/redmine";

        string apiKey = "f89d097dfa603a16b173c6b6fa3bb8c751ef4a2a";


        var manager = new RedmineManager(host, apiKey);


        //parameter - get all issues

        //var parameters = new NameValueCollection { { "project_id", "*" } };

        var parameters = new NameValueCollection { { "status_id", "*" }};



        //parameter - fetch issues for a date range

        //parameters.Add("issue.Status", "1");

        //parameters.Add("due_date", "=2014-12-12");          

        //parameters.Add("author", "*");

        parameters.Add("status_id", "*");        

        //parameters.Add("Status", "=5, 완료");      

        //parameters.Add("created_on", "><2012-03-01|2012-03-07");



        foreach (var issue in manager.GetObjectList<Issue>(parameters))

        {            

            //Console.WriteLine("#{0}: {1}", issue.Id, issue.Subject);

           // Label1.Text += issue.Id +" , " + "제목 : "+issue.Subject+ "<br>";

            Label1.Text += issue.Id + " / <strong> " + issue.Status + "</strong>/   제목 : " + issue.Subject + "<font color=green> /  시작일 :  " + issue.StartDate + "</font> <font color=red>종료일 : " + issue.DueDate + "</font>  / <strong> 담당자 : " + issue.AssignedTo + "</strong></p>";



            if (issue.Status.ToString() == "1, 신규")

            {

                Label1.Text += issue.Id + " / <strong> " + issue.Status + "</strong>/   제목 : " + issue.Subject + "<font color=green> /  시작일 :  " + issue.StartDate + "</font> <font color=red>종료일 : " + issue.DueDate + "</font>  / <strong> 담당자 : " + issue.AssignedTo + "</strong></p>";

            }

            else

            {

                continue;

            }

            

        }

    }


}