当前位置: 首页>>代码示例>>C#>>正文


C# MessageHandler.GetMessageDetails方法代码示例

本文整理汇总了C#中MessageHandler.GetMessageDetails方法的典型用法代码示例。如果您正苦于以下问题:C# MessageHandler.GetMessageDetails方法的具体用法?C# MessageHandler.GetMessageDetails怎么用?C# MessageHandler.GetMessageDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessageHandler的用法示例。


在下文中一共展示了MessageHandler.GetMessageDetails方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //Check whether the proper message is being passed or not
        if (Request.QueryString["id"] == null)
        {
            Response.Redirect("Default.aspx");
        }

        MessageHandler msgHandler = new MessageHandler();

        Message msg = msgHandler.GetMessageDetails(CookiesWrapper.thisUserID.ToString(), Convert.ToInt32(Request.QueryString["id"]));

        //Some one is trying to access a mail that is not supposed to see so kick him out
        if (msg == null)
        {
            Response.Redirect("Default.aspx");
        }
        lblSender.Text = msg.SenderId;
        lblReciever.Text = msg.RecieverId;
        lblSubject.Text = msg.Subject;
        lblBody.Text = Server.HtmlDecode(msg.Body);
        lblDate.Text = msg.Date.ToString();
        Session["Message"] = msg;
    }
开发者ID:CliveCK,项目名称:WebSysME,代码行数:24,代码来源:ReadMail.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!(HttpContext.Current.User.Identity.IsAuthenticated))
        {

            FormsAuthentication.SignOut();
            Session.Clear();
            Response.Redirect("~/Default");
        }

        messageList = new List<Message>();
        String currentlyLoggedUserName = HttpContext.Current.User.Identity.Name;
        currentlyLoggedUserID = Membership.GetUser(currentlyLoggedUserName).ProviderUserKey.ToString();

        if (currentlyLoggedUserID == null)
        {
            Response.Redirect("~/Default");
        }

        //Check whether the proper message is being passed or not
        //the id here is the messageId

        if (Request.QueryString["id"] == null)
        {
            Response.Redirect("Default.aspx");
        }
        MessageID = Convert.ToInt32(Request.QueryString["id"]);

        MessageHandler msgHandler = new MessageHandler();
        Message msg = msgHandler.GetMessageDetails(MessageID);

        //Some one is trying to access a mail that is not supposed to see so kick him out
        if (msg == null)
        {
            Response.Redirect("Default.aspx");
        }

        //give me a list of all messages where the SenderId=him and RecieverId=me or SenderId=me and RecieverId=him order by datentime ASC

        recieverID = msg.RecieverId;
        senderID = msg.SenderId;

        //get all conversations between the reciever(currentlyLoggedUserID) and the sender
        //the sender is gotten from the messageID that is gotten when ther clicks on the message in Inbox
        DataTable dt = msgHandler.getConversation(recieverID, senderID);
        if (dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {

                int msgID = Convert.ToInt32(dr["MessageID"].ToString());
                System.Diagnostics.Debug.WriteLine("MessageID is = " + msgID);

                Message msgTemp = msgHandler.GetMessageDetails(msgID);
                System.Diagnostics.Debug.WriteLine("msgTemp is = " + msgTemp);

                this.messageList.Add(msgTemp);

            }
        }
        else
        {
            Console.WriteLine("No rows found.");
        }

        createTable();
    }
开发者ID:howleg,项目名称:up,代码行数:67,代码来源:ReadMail.aspx.cs


注:本文中的MessageHandler.GetMessageDetails方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。