Example #1
0
    /// <summary>
    /// Initialize all the view state date for code camp viewstate stuff like
    /// which Date is Sat/Sun, lists of sessions, etc.
    /// </summary>
    private void InitializeViewStateForTimeLists()
    {
        // store in viewstate for convenience dates of cc
        SaturdayDate = Utils.GetCurrentCodeCampYearStartDate();
        SundayDate = SaturdayDate.AddDays(1);

        // Load up session times for both days
        var sessionTimesODS = new SessionTimesODS();
        var sessionTimesList = sessionTimesODS.GetAllSessionTimes();
        SaturdaySessionTimesList = new List<DateTime>();
        foreach (var rec in
            sessionTimesList.Where(
                rec =>
                rec.Starttime.Year == SaturdayDate.Year && rec.Starttime.Month == SaturdayDate.Month &&
                rec.Starttime.Day == SaturdayDate.Day))
        {
            SaturdaySessionTimesList.Add(rec.Starttime);
        }
        SundaySessionTimesList = new List<DateTime>();
        foreach (var rec in
            sessionTimesList.Where(
                rec =>
                rec.Starttime.Year == SundayDate.Year && rec.Starttime.Month == SundayDate.Month &&
                rec.Starttime.Day == SundayDate.Day))
        {
            SundaySessionTimesList.Add(rec.Starttime);
        }
    }
Example #2
0
    protected string GetAgendaDescriptionFromAgendaId(int agendaId)
    {
        string retString = "Agenda Not Made Yet";
        if (Utils.CurrentCodeCampYear != Utils.GetCurrentCodeCampYear())
        {
            retString = "Session Over";
        }
        else
        {

            if (Utils.CheckUserIsAdmin() ||
                ConfigurationManager.AppSettings["ShowAgendaOnSchedule"].ToLower().Equals("true")
                || Utils.CheckUserIsScheduler() ||
                (ConfigurationManager.AppSettings["ShowRoomOnScheduleForPresenter"].ToLower().Equals("true")) &&
                Utils.CheckUserIsPresenter())
            {
                var stODS = new SessionTimesODS();

                List<SessionTimesODS.DataObjectSessionTimes> stList = stODS.GetAllSessionTimes();
                foreach (SessionTimesODS.DataObjectSessionTimes st in stList)
                {
                    if (st.Id == agendaId)
                    {
                        retString = st.Starttimefriendly;
                        break;
                    }
                }
            }
        }
        return retString;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // load up the dictionaries from cache or other
        var stODS = new SessionTimesODS();
        List<SessionTimesODS.DataObjectSessionTimes> stList = stODS.GetAllSessionTimes();
        SessionTimesDictionary = new Dictionary<int, string>(stList.Count);
        foreach (SessionTimesODS.DataObjectSessionTimes st in stList)
        {
            SessionTimesDictionary.Add(st.Id, st.Description);
        }

        LabelCodeCampYearId.Text = Utils.CurrentCodeCampYear.ToString();

        _liAgendaUpdateInfo = CodeCampSV.Utils.GetListAgendaUpdateInfo();

        // need all three
        //string redirectString = "~/AgendaPicker.aspx?sessiontimeid=" +
        //    sessionTimeId.ToString() +
        //    "&roomid=" + roomId.ToString();

        if (!IsPostBack)
        {
            if (Request.QueryString["sessiontimeid"] != null &&
                Request.QueryString["roomid"] != null)
            {
                RoomIdFromPrevPage = Convert.ToInt32(Request.QueryString["roomid"]);
                SessionTimeIdFromPrevPage = Convert.ToInt32(Request.QueryString["sessiontimeid"]);

                SetRoomIdAndSessionTimesId();
            }
            else
            {
                throw new ApplicationException("AgendaPicker Needs 2 Request Params");
            }
            DropDownListSessionTimes.DataBind(); // not sure if need this but...
        }
    }