Esempio n. 1
0
        void NodeActions_InvokeCommand(object Sender, InvokeCommandArgs e)
        {
            SqlForumProvider fp       = new Mediachase.Ibn.Forum.SqlForumProvider();
            HttpResponse     Response = ((Control)Sender).Page.Response;

            int iObjTypeId = -1;
            int iObjId     = -1;

            if (HttpContext.Current.Items["ObjectTypeId"] != null)
            {
                iObjTypeId = (int)HttpContext.Current.Items["ObjectTypeId"];
            }
            if (HttpContext.Current.Items["ObjectId"] != null)
            {
                iObjId = (int)HttpContext.Current.Items["ObjectId"];
            }

            // TODO: (OR) У Олега Ж. пока не реализовано. Должно вытаскиваться из атрибутов.
            int emailMessageId = -1;

            switch (e.CommandUid)
            {
                #region Reply
            case "Reply":
//					((Control)Sender).Page.Response.Write("Test reply event (TestCommandManager.dll : class TestReplyHandler )<br>");
                break;

                #endregion
                #region ReplyOutlook
            case "ReplyOutlook":
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", String.Format("attachment; filename=\"{0}\"", "mail.msg"));
                Response.ContentType = "application/msoutlook";

                MsgMessage.Open(iObjId, emailMessageId, Response.OutputStream);
                Response.End();
                break;

                #endregion
                #region ReplyEML
            case "ReplyEML":
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", String.Format("attachment; filename=\"{0}\"", "mail.eml"));
                Response.ContentType = "message/rfc822";
                MsgMessage.OpenEml(iObjId, emailMessageId, Response.OutputStream);
                Response.End();
                break;

                #endregion
                #region ReSend
            case "ReSend":
                EMailRouterOutputMessage.Send(iObjId, emailMessageId);
                break;

                #endregion
                #region ReSendOut
            case "ReSendOut":
                EMailRouterOutputMessage.Send(iObjId, emailMessageId);
                break;

                #endregion
                #region Resolution
            case "Resolution":
                e.Node.SetAttribute("Resolution", "1");
                fp.SaveNode(e.Node);
                break;

                #endregion
                #region UnResolution
            case "UnResolution":
                if (e.Node.Attributes.ContainsKey("Resolution"))
                {
                    e.Node.Attributes.Remove("Resolution");
                    fp.SaveNode(e.Node);
                }
                break;

                #endregion
                #region Workaround
            case "Workaround":
                e.Node.SetAttribute("Workaround", "1");
                fp.SaveNode(e.Node);
                break;

                #endregion
                #region UnWorkaround
            case "UnWorkaround":
                if (e.Node.Attributes.ContainsKey("Workaround"))
                {
                    e.Node.Attributes.Remove("Workaround");
                    fp.SaveNode(e.Node);
                }
                break;

                #endregion
                #region OnTop
            case "OnTop":
                e.Node.SetAttribute(Node.ONTOP_ATTRIBUTE, "1");
                fp.SaveNode(e.Node);
                break;

                #endregion
                #region UnOnTop
            case "UnOnTop":
                if (e.Node.Attributes.ContainsKey(Node.ONTOP_ATTRIBUTE))
                {
                    e.Node.Attributes.Remove(Node.ONTOP_ATTRIBUTE);
                    fp.SaveNode(e.Node);
                }
                break;

                #endregion
                #region Delete
            case "Delete":
                fp.DeleteNode(e.Node.Uid);
                break;

                #endregion
            default:
                break;
            }
        }
Esempio n. 2
0
        void NodeActions_InvokeCommand(object Sender, InvokeCommandArgs e)
        {
            SqlForumProvider fp = new Mediachase.Ibn.Forum.SqlForumProvider();
            HttpResponse Response = ((Control)Sender).Page.Response;

            int iObjTypeId = -1;
            int iObjId = -1;
            if (HttpContext.Current.Items["ObjectTypeId"] != null)
                iObjTypeId = (int)HttpContext.Current.Items["ObjectTypeId"];
            if (HttpContext.Current.Items["ObjectId"] != null)
                iObjId = (int)HttpContext.Current.Items["ObjectId"];

            // TODO: (OR) У Олега Ж. пока не реализовано. Должно вытаскиваться из атрибутов.
            int emailMessageId = -1;

            switch (e.CommandUid)
            {
                #region Reply
                case "Reply":
            //					((Control)Sender).Page.Response.Write("Test reply event (TestCommandManager.dll : class TestReplyHandler )<br>");
                    break;
                #endregion
                #region ReplyOutlook
                case "ReplyOutlook":
                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.AddHeader("content-disposition", String.Format("attachment; filename=\"{0}\"", "mail.msg"));
                    Response.ContentType = "application/msoutlook";

                    MsgMessage.Open(iObjId, emailMessageId, Response.OutputStream);
                    Response.End();
                    break;
                #endregion
                #region ReplyEML
                case "ReplyEML":
                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.AddHeader("content-disposition", String.Format("attachment; filename=\"{0}\"", "mail.eml"));
                    Response.ContentType = "message/rfc822";
                    MsgMessage.OpenEml(iObjId, emailMessageId, Response.OutputStream);
                    Response.End();
                    break;
                #endregion
                #region ReSend
                case "ReSend":
                    EMailRouterOutputMessage.Send(iObjId, emailMessageId);
                    break;
                #endregion
                #region ReSendOut
                case "ReSendOut":
                    EMailRouterOutputMessage.Send(iObjId, emailMessageId);
                    break;
                    #endregion
                #region Resolution
                case "Resolution":
                    e.Node.SetAttribute("Resolution", "1");
                    fp.SaveNode(e.Node);
                    break;
                #endregion
                #region UnResolution
                case "UnResolution":
                    if (e.Node.Attributes.ContainsKey("Resolution"))
                    {
                        e.Node.Attributes.Remove("Resolution");
                        fp.SaveNode(e.Node);
                    }
                    break;
                #endregion
                #region Workaround
                case "Workaround":
                    e.Node.SetAttribute("Workaround", "1");
                    fp.SaveNode(e.Node);
                    break;
                #endregion
                #region UnWorkaround
                case "UnWorkaround":
                    if (e.Node.Attributes.ContainsKey("Workaround"))
                    {
                        e.Node.Attributes.Remove("Workaround");
                        fp.SaveNode(e.Node);
                    }
                    break;
                #endregion
                #region OnTop
                case "OnTop":
                    e.Node.SetAttribute(Node.ONTOP_ATTRIBUTE, "1");
                    fp.SaveNode(e.Node);
                    break;
                #endregion
                #region UnOnTop
                case "UnOnTop":
                    if (e.Node.Attributes.ContainsKey(Node.ONTOP_ATTRIBUTE))
                    {
                        e.Node.Attributes.Remove(Node.ONTOP_ATTRIBUTE);
                        fp.SaveNode(e.Node);
                    }
                    break;
                #endregion
                #region Delete
                case "Delete":
                    fp.DeleteNode(e.Node.Uid);
                    break;
                #endregion
                default:
                    break;
            }
        }