Пример #1
0
 // Token: 0x060004CB RID: 1227 RVA: 0x00027C85 File Offset: 0x00025E85
 protected override void OnUnload(EventArgs e)
 {
     if (this.CalendarItemBase != null)
     {
         EditCalendarItemHelper.CreateUserContextData(base.UserContext, this.CalendarItemBase);
     }
     base.OnUnload(e);
 }
Пример #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "ctx");
            int    num;

            if (!int.TryParse(queryStringParameter, out num))
            {
                throw new OwaInvalidRequestException("Context parameter is having invalid format");
            }
            if (num < 0 || num > 4)
            {
                throw new OwaInvalidRequestException("Invalid context value in the querystring parameter");
            }
            this.viewMode = (AddressBook.Mode)num;
            if (this.viewMode == AddressBook.Mode.None)
            {
                this.viewMode = AddressBook.Mode.Lookup;
            }
            if (base.IsPostFromMyself())
            {
                this.action              = Utilities.GetFormParameter(base.Request, "hidcmdpst", false);
                this.searchString        = Utilities.GetFormParameter(base.Request, "hidss", false);
                this.pageNumber          = RequestParser.TryGetIntValueFromForm(base.Request, "hidpg", 1);
                this.sortColumn          = (ColumnId)RequestParser.TryGetIntValueFromForm(base.Request, "hidcid", 11);
                this.sortOrder           = (SortOrder)RequestParser.TryGetIntValueFromForm(base.Request, "hidso", 1);
                this.addressBookToSearch = Utilities.GetFormParameter(base.Request, "hidAB", false);
                if (string.IsNullOrEmpty(this.addressBookToSearch))
                {
                    throw new OwaInvalidRequestException("addressbookGuid can't be null");
                }
                this.recipientWell = (RecipientItemType)RequestParser.TryGetIntValueFromForm(base.Request, "hidrw", 1);
            }
            else
            {
                this.searchString = Utilities.GetQueryStringParameter(base.Request, "sch", false);
                if (!string.IsNullOrEmpty(this.searchString))
                {
                    Utilities.VerifySearchCanaryInGetRequest(base.Request);
                }
                this.pageNumber          = RequestParser.TryGetIntValueFromQueryString(base.Request, "pg", 1);
                this.sortColumn          = (ColumnId)RequestParser.TryGetIntValueFromQueryString(base.Request, "cid", 11);
                this.sortOrder           = (SortOrder)RequestParser.TryGetIntValueFromQueryString(base.Request, "so", 1);
                this.addressBookToSearch = Utilities.GetQueryStringParameter(base.Request, "ab", false);
                this.recipientWell       = (RecipientItemType)RequestParser.TryGetIntValueFromQueryString(base.Request, "rw", 1);
            }
            this.GetSearchLocation();
            if (AddressBook.IsEditingMode(this.viewMode))
            {
                if (!base.IsPostFromMyself())
                {
                    bool          required = this.viewMode != AddressBook.Mode.EditCalendar;
                    StoreObjectId itemId   = QueryStringUtilities.CreateItemStoreObjectId(base.UserContext.MailboxSession, base.Request, required);
                    base.Item = AddressBookHelper.GetItem(base.UserContext, this.viewMode, itemId, null);
                }
                else
                {
                    StoreObjectId itemId2       = null;
                    string        formParameter = Utilities.GetFormParameter(base.Request, "hidid", true);
                    if (!string.IsNullOrEmpty(formParameter))
                    {
                        itemId2 = Utilities.CreateStoreObjectId(base.UserContext.MailboxSession, formParameter);
                    }
                    string formParameter2 = Utilities.GetFormParameter(base.Request, "hidchk", true);
                    base.Item = AddressBookHelper.GetItem(base.UserContext, this.viewMode, itemId2, formParameter2);
                    string a;
                    if ((a = this.action) != null)
                    {
                        if (!(a == "addrcp"))
                        {
                            if (a == "rmrcp")
                            {
                                int intValueFromForm = RequestParser.GetIntValueFromForm(base.Request, "hidri");
                                if (this.viewMode == AddressBook.Mode.EditMessage || this.viewMode == AddressBook.Mode.EditMeetingResponse)
                                {
                                    if (intValueFromForm >= 0 && intValueFromForm < this.Message.Recipients.Count)
                                    {
                                        this.Message.Recipients.RemoveAt(intValueFromForm);
                                        AddressBookHelper.SaveItem(base.Item);
                                    }
                                }
                                else if (this.viewMode == AddressBook.Mode.EditCalendar)
                                {
                                    CalendarUtilities.RemoveAttendeeAt(this.CalendarItemBase, intValueFromForm);
                                    EditCalendarItemHelper.CreateUserContextData(base.UserContext, this.CalendarItemBase);
                                }
                            }
                        }
                        else
                        {
                            int num2 = RequestParser.TryGetIntValueFromQueryString(base.Request, "rt", 1);
                            if (num2 == 1)
                            {
                                this.type = RecipientItemType.To;
                            }
                            else if (num2 == 2)
                            {
                                this.type = RecipientItemType.Cc;
                            }
                            else if (num2 == 3)
                            {
                                this.type = RecipientItemType.Bcc;
                            }
                            string text = base.Request.Form["chkRcpt"];
                            if (!string.IsNullOrEmpty(text))
                            {
                                this.ids = text.Split(new char[]
                                {
                                    ','
                                });
                                if (this.searchLocation == AddressBook.SearchLocation.AddressBook)
                                {
                                    AddressBookHelper.AddRecipientsToDraft(this.ids, base.Item, this.type, base.UserContext);
                                }
                                else
                                {
                                    AddressBookHelper.AddContactsToDraft(base.Item, this.type, base.UserContext, this.ids);
                                }
                            }
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(this.searchString))
            {
                this.searchString = this.searchString.Trim();
                if (this.searchString.Length > Globals.MaxSearchStringLength)
                {
                    throw new OwaInvalidRequestException("Search string length is more than 256 characters");
                }
            }
            if (this.pageNumber == 0)
            {
                this.pageNumber = 1;
            }
            this.firstItemOnPage = (this.pageNumber - 1) * base.UserContext.UserOptions.BasicViewRowCount + 1;
            this.lastItemOnPage  = this.firstItemOnPage + base.UserContext.UserOptions.BasicViewRowCount - 1;
            this.CreateListView();
            if (AddressBook.IsEditingMode(this.viewMode) || !string.IsNullOrEmpty(this.searchString))
            {
                base.UserContext.LastClientViewState = new AddressBookSearchViewState(base.UserContext.LastClientViewState, this.viewMode, this.addressBookToSearch, this.searchString, this.pageNumber, (base.Item == null || base.Item.Id == null) ? null : base.Item.Id.ObjectId, (base.Item == null || base.Item.Id == null) ? null : base.Item.Id.ChangeKeyAsBase64String(), this.recipientWell, this.sortColumn, this.sortOrder);
                return;
            }
            base.UserContext.LastClientViewState = new AddressBookViewState(base.UserContext.LastClientViewState, this.viewMode, this.pageNumber, (base.Item == null || base.Item.Id == null) ? null : base.Item.Id.ObjectId, (base.Item == null || base.Item.Id == null) ? null : base.Item.Id.ChangeKeyAsBase64String(), this.recipientWell, this.sortColumn, this.sortOrder);
        }