Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["SchoolId"] == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            if (!IsPostBack)
            {
                DayCareBAL.SchoolYearService proxySchoolYear = new DayCareBAL.SchoolYearService();
                Guid SchoolId = new Guid();
                if (Session["SchoolId"] != null)
                {
                    SchoolId = new Guid(Session["SchoolId"].ToString());
                }
                ddlSchoolYear.DataSource     = proxySchoolYear.LoadAllSchoolYear(SchoolId);
                ddlSchoolYear.DataTextField  = "Year";
                ddlSchoolYear.DataValueField = "Id";
                ddlSchoolYear.DataBind();

                if (ddlSchoolYear.Items != null && ddlSchoolYear.Items.Count > 0)
                {
                    ddlSchoolYear.SelectedValue = Convert.ToString(proxySchoolYear.GetCurrentSchoolYear(SchoolId));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["StaffFullName"] != null)
            {
                hlName.Text = Session["StaffFullName"].ToString();
            }
            if (!Page.IsPostBack)
            {
                DayCareBAL.SchoolYearService proxySchoolYear = new DayCareBAL.SchoolYearService();
                Guid SchoolId = new Guid();
                if (Session["SchoolId"] != null)
                {
                    SchoolId = new Guid(Session["SchoolId"].ToString());
                }
                ddlSchoolYear.DataSource     = proxySchoolYear.LoadAllSchoolYear(SchoolId);
                ddlSchoolYear.DataTextField  = "Year";
                ddlSchoolYear.DataValueField = "Id";
                ddlSchoolYear.DataBind();

                if (Session["CurrentSchoolYearId"] != null)
                {
                    ddlSchoolYear.SelectedValue = Session["CurrentSchoolYearId"].ToString();
                }
            }
        }