PageRenderTime 55ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/Disciples/Disciples/Verse/Chron.aspx.cs

https://bitbucket.org/rbhakser/bvcms
C# | 30 lines | 29 code | 1 blank | 0 comment | 0 complexity | 4364543d94f9d16792f3f64503614f14 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, Apache-2.0, BSD-3-Clause, AGPL-3.0, MPL-2.0-no-copyleft-exception
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Data.Linq;
  5. using System.Web;
  6. using System.Web.UI;
  7. using System.Web.UI.WebControls;
  8. using System.Xml.Linq;
  9. using UtilityExtensions;
  10. namespace Disciples.Verse
  11. {
  12. public partial class Chron : System.Web.UI.Page
  13. {
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. var dt = new DateTime(2008, 12, 31);
  17. var xdoc = XDocument.Parse(Resources.Resource1.Chron);
  18. var q = from p in xdoc.Descendants("read")
  19. orderby p.Attribute("day").Value.ToInt()
  20. select new
  21. {
  22. Date = dt.AddDays(p.Attribute("day").Value.ToInt()).ToShortDateString(),
  23. Verse = p.Attribute("verses").Value
  24. };
  25. GridView1.DataSource = q;
  26. GridView1.DataBind();
  27. }
  28. }
  29. }