Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserRole = (Role)Convert.ToInt32(Session["RoleID"]);

        lblMsg.Text = "";
        MakeKeyStatusBold();

        if (!IsPostBack)
        {
            if (UserRole != Role.FJCAdmin)
            {
                ddlProgram.Enabled = false;

                if (UserRole == Role.CampDirector)
                {
                    ddlProgram.Visible       = false;
                    chkAllCamps.Visible      = false;
                    ddlProgram.SelectedIndex = 1;
                }
            }

            txtOtherDate.Text = DateTime.Now.ToShortDateString();

            DataTable dt = CampYearDA.GetAllYearsWithoutCurrentYear();
            var       dv = new DataView(dt)
            {
                Sort = "CampYear desc"
            };
            cblYearsToday.DataSource = dv;
            cblYearsToday.DataBind();
        }

        // Delete old work files
        string workFileDir = Server.MapPath(@"~/Docs");

        // need to check and see if any old files are left behind
        DirectoryInfo myDir = new DirectoryInfo(workFileDir);

        foreach (FileSystemInfo myFile in myDir.GetFileSystemInfos("*.xls"))
        {
            // Delete any files that are 1 min old
            //if ((DateTime.Now - myFile.CreationTime).Minutes > 1)
            myFile.Delete();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            txtOtherDate.Text = DateTime.Now.ToShortDateString();

            DataTable dt = CampYearDA.GetAllYearsWithoutCurrentYear();
            var       dv = new DataView(dt)
            {
                Sort = "CampYear desc"
            };
            cblYearsToday.DataSource = dv;
            cblYearsToday.DataBind();

            DataTable ds = FederationsDA.GetAllFederationsByMultipleCampYearsAndUserRole(Application["CampYearID"].ToString(), (Role)Convert.ToInt32(Session["RoleID"]), Convert.ToInt32(Session["FedID"]));
            chklistFed.DataSource = ds;
            chklistFed.DataBind();
        }
        MakeKeyStatusBold();
    }