예제 #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.FilteredView = false;
            base.OnLoad(e);
            EditCalendarItemHelper.ClearUserContextData(base.UserContext);
            this.CreateExpiringPasswordNotification();
            this.CreateOutOfOfficeNotification();
            int num = RequestParser.TryGetIntValueFromQueryString(base.Request, "slUsng", -1);

            if (num >= 0 && num <= 2)
            {
                this.selectedUsing = (SecondaryNavigationArea)num;
            }
            if (base.UserContext.IsWebPartRequest)
            {
                base.UserContext.LastClientViewState = new WebPartModuleViewState(base.FolderId, base.Folder.ClassName, base.PageNumber, NavigationModule.Mail, base.SortOrder, base.SortedColumn);
                return;
            }
            if (base.FilteredView)
            {
                base.UserContext.LastClientViewState = new MessageModuleSearchViewState(base.UserContext.LastClientViewState, base.FolderId, base.OwaContext.FormsRegistryContext.Type, this.selectedUsing, base.PageNumber, base.SearchString, base.SearchScope);
                return;
            }
            base.UserContext.LastClientViewState = new MessageModuleViewState(base.FolderId, base.OwaContext.FormsRegistryContext.Type, this.selectedUsing, base.PageNumber);
        }
예제 #2
0
        protected override void OnLoad(EventArgs e)
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "Basic.CalendarView.OnLoad");
            EditCalendarItemHelper.ClearUserContextData(base.UserContext);
            this.folderId = QueryStringUtilities.CreateFolderStoreObjectId(base.UserContext.MailboxSession, base.Request, false);
            if (this.folderId == null)
            {
                ExTraceGlobals.CalendarTracer.TraceDebug((long)this.GetHashCode(), "folderId is null, using default folder");
                this.folderId = base.UserContext.CalendarFolderId;
            }
            if (this.folderId == null)
            {
                throw new OwaInvalidRequestException("Invalid folder id");
            }
            StorePropertyDefinition displayName                 = StoreObjectSchema.DisplayName;
            PropertyDefinition      calendarViewType            = ViewStateProperties.CalendarViewType;
            PropertyDefinition      readingPanePosition         = ViewStateProperties.ReadingPanePosition;
            PropertyDefinition      readingPanePositionMultiDay = ViewStateProperties.ReadingPanePositionMultiDay;
            PropertyDefinition      viewWidth     = ViewStateProperties.ViewWidth;
            PropertyDefinition      dailyViewDays = ViewStateProperties.DailyViewDays;

            this.viewType = CalendarViewType.Min;
            string queryStringParameter  = Utilities.GetQueryStringParameter(base.Request, "dy", false);
            string queryStringParameter2 = Utilities.GetQueryStringParameter(base.Request, "mn", false);
            string queryStringParameter3 = Utilities.GetQueryStringParameter(base.Request, "yr", false);
            int    day;
            int    month;
            int    year;

            if (!string.IsNullOrEmpty(queryStringParameter) && int.TryParse(queryStringParameter, out day) && !string.IsNullOrEmpty(queryStringParameter2) && int.TryParse(queryStringParameter2, out month) && !string.IsNullOrEmpty(queryStringParameter3) && int.TryParse(queryStringParameter3, out year))
            {
                try
                {
                    ExDateTime exDateTime = new ExDateTime(base.UserContext.TimeZone, year, month, day);
                    this.days    = new ExDateTime[1];
                    this.days[0] = exDateTime.Date;
                }
                catch (ArgumentOutOfRangeException)
                {
                    base.Infobar.AddMessageLocalized(883484089, InfobarMessageType.Error);
                }
            }
            if (this.days == null)
            {
                this.days    = new ExDateTime[1];
                this.days[0] = DateTimeUtilities.GetLocalTime().Date;
            }
            this.calendarAdapter = new CalendarAdapter(base.UserContext, this.folderId);
            this.calendarAdapter.LoadData(DailyView.QueryProperties, this.days, false, true);
            this.dailyView = new DailyView(base.UserContext, this.calendarAdapter);
            base.OnLoad(e);
            if (base.IsPostFromMyself())
            {
                string formParameter = Utilities.GetFormParameter(base.Request, "hidcmdpst", false);
                if (string.CompareOrdinal(formParameter, "addjnkeml") == 0)
                {
                    if (!base.UserContext.IsJunkEmailEnabled)
                    {
                        throw new OwaInvalidRequestException(LocalizedStrings.GetNonEncoded(552277155));
                    }
                    InfobarMessage infobarMessage = JunkEmailHelper.AddEmailToSendersList(base.UserContext, base.Request);
                    if (infobarMessage != null)
                    {
                        base.Infobar.AddMessage(infobarMessage);
                    }
                }
            }
            base.UserContext.LastClientViewState = new CalendarModuleViewState(this.folderId, this.calendarAdapter.ClassName, this.days[0]);
        }