예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.Title = "Holiday Detection Demo";

            // Create a holiday collection with some default holidays, store it in the session, and bind it to
            // the data grid.
            if (!Page.IsPostBack)
            {
                HolidayCollection hc = (HolidayCollection)Session["Holidays"];

                // If we haven't been here before, create a new collection
                if (hc == null)
                {
                    hc = new HolidayCollection();
                    hc.AddStandardHolidays();
                    Session["Holidays"] = hc;
                }

                dgHolidays.DataSource = hc;
                dgHolidays.DataBind();

                txtFromYear.Text = (DateTime.Now.Year - 1).ToString();
                txtToYear.Text   = (DateTime.Now.Year + 6).ToString();
                txtTestDate.Text = DateTime.Today.ToString("d");
            }
        }
예제 #2
0
		protected void Page_Load(object sender, EventArgs e)
		{
            this.Page.Title = "Holiday Detection Demo";

            // Create a holiday collection with some default holidays, store it in the session, and bind it to
            // the data grid.
            if(!Page.IsPostBack)
            {
                HolidayCollection hc = (HolidayCollection)Session["Holidays"];

                // If we haven't been here before, create a new collection
                if(hc == null)
                {
                    hc = new HolidayCollection();
                    hc.AddStandardHolidays();
                    Session["Holidays"] = hc;
                }

                dgHolidays.DataSource = hc;
                dgHolidays.DataBind();

                txtFromYear.Text = (DateTime.Now.Year - 1).ToString();
                txtToYear.Text = (DateTime.Now.Year + 6).ToString();
                txtTestDate.Text = DateTime.Today.ToString("d");
            }
		}