我正在从redmine timeentry
.
问题是我只得到最后 25 条记录。我的过滤器不工作
任何想法,为什么过滤器不起作用或我在做什么类型的错误?
我已经安装了redmine
fromNuget
这是代码:
string host = "redmine.xyz.net";
string apiKey = "e69e2243f4b357f34533322408d6339b7f5b2579e36";
var manager = new RedmineManager(host, apiKey);
List<EEmployeeTimeSheet> liEmpTimeSheet = new List<EEmployeeTimeSheet>();
var parameters = new NameValueCollection();
parameters.Add("per_page", "100");
parameters.Add("created_on", DateTime.Now.Date.ToString("yyyy-MM-dd"));
XmlWriterSettings settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = true;
settings.ConformanceLevel = ConformanceLevel.Fragment;
settings.CloseOutput = false;
XmlWriter xmlWriter = XmlWriter.Create(Path.Combine(HostingEnvironment.MapPath("~/test.xml")), settings);
var timeentry=manager.GetObjectList<TimeEntry>(parameters).Take(100);
foreach (var issue in timeentry)
{
issue.WriteXml(xmlWriter);
EEmployeeTimeSheet emp = new EEmployeeTimeSheet();
emp.strActivity = issue.Activity.ToString();
emp.strComments = issue.Comments;
emp.nHours = issue.Hours;
emp.dtCreatedOn = issue.CreatedOn;
emp.strProject = issue.Project.Name;
emp.strEmployeeName = issue.User.Name;
liEmpTimeSheet.Add(emp);
}
xmlWriter.Flush();
xmlWriter.Close();