Ejemplo 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));
                }
            }
        }
Ejemplo n.º 2
0
        public static bool IsCurrentYear(Guid CurrentYearId, Guid SchoolId)
        {
            try
            {
                DayCareBAL.SchoolYearService proxySchoolYear = new DayCareBAL.SchoolYearService();

                if (CurrentYearId.Equals(proxySchoolYear.GetCurrentSchoolYear(SchoolId)))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }