Example #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.LoadMessage();
            bool flag = true;

            if (Utilities.GetQueryStringParameter(base.Request, "id", false) != null)
            {
                flag = false;
            }
            string formParameter = Utilities.GetFormParameter(base.Request, "hidcmdpst", false);

            if (flag && Utilities.IsPostRequest(base.Request) && !string.IsNullOrEmpty(formParameter))
            {
                if (base.Item == null)
                {
                    base.Item = EditMessageHelper.CreateDraft(base.UserContext);
                }
                if (!string.IsNullOrEmpty(formParameter))
                {
                    string text = EditMessageHelper.ExecutePostCommand(formParameter, base.Request, this.messageItem, base.UserContext);
                    if (!string.IsNullOrEmpty(text))
                    {
                        base.Infobar.AddMessageText(text, InfobarMessageType.Error);
                    }
                }
            }
            this.RenderMessage();
        }
Example #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "aserr", false);

            if (!string.IsNullOrEmpty(queryStringParameter))
            {
                this.hasAutosaveErr = true;
            }
            bool flag = this.LoadMessage();

            if (this.message != null && Utilities.IsSMime(this.message))
            {
                throw new OwaNeedsSMimeControlToEditDraftException(LocalizedStrings.GetNonEncoded(-1507367759));
            }
            string formParameter = Utilities.GetFormParameter(base.Request, "hidcmdpst", false);

            if (flag && Utilities.IsPostRequest(base.Request) && !string.IsNullOrEmpty(formParameter))
            {
                if (this.message == null)
                {
                    base.Item = (this.message = EditMessageHelper.CreateDraft(base.UserContext));
                }
                if (!string.IsNullOrEmpty(formParameter))
                {
                    string text = EditMessageHelper.ExecutePostCommand(formParameter, base.Request, this.message, base.UserContext);
                    if (!string.IsNullOrEmpty(text))
                    {
                        base.Infobar.AddMessageText(text, InfobarMessageType.Error);
                    }
                }
            }
            if (this.message == null && !Utilities.IsPostRequest(base.Request))
            {
                base.Item = (this.message = Utilities.CreateDraftMessageFromQueryString(base.UserContext, base.Request));
            }
            this.RenderMessage();
        }