private void fillData()
    {
        string id   = Request["id"].ToString();
        string act  = Request["act"].ToString();
        string type = Request["type"].ToString();

        DataSet ds;

        if (type == "send")
        {
            ds = MessageBLL.GetMessageByID(id);
        }
        else
        {
            ds = MessageBLL.GetReceivedMessageByID(id);
        }

        DataRow dr = ds.Tables[0].Rows[0];

        this.txtTitle.Text = "Re: " + dr["Title"].ToString();
        this.txtBody.Value = FillBody(dr);
        //this.txtBody.Value = dr["Body"].ToString();
        string sender  = dr["Sender"].ToString();
        string reciver = dr["Recipient"].ToString();

        if (act == "0")
        {
            txtRecipient.Text = sender;
        }
        if (act == "1")
        {
            txtRecipient.Text = sender + ";" + reciver;
        }
        if (act == "2")
        {
            this.txtAttachList.Text          = dr["Attachment"].ToString();
            this.divAttachmentList.InnerHtml = fillAttatchment(this.txtAttachList.Text);
        }
    }
Exemple #2
0
    private void fillData()
    {
        DataSet ds;

        if (type == "send")
        {
            ds = MessageBLL.GetMessageByID(Request["id"]);
        }
        else
        {
            ds = MessageBLL.GetReceivedMessageByID(Request["id"]);
        }
        if (ds.Tables[0].Rows.Count == 0)
        {
            Title      = "No Record";
            Attachment = "";
            Body       = "";
            Sender     = "";
            return;
        }
        DataRow dr = ds.Tables[0].Rows[0];

        Title = string.Format(titleFormat, dr["Title"].ToString());
        if (type == "inbox")
        {
            string sss = "From &nbsp" + dr["Sender"].ToString();

            Sender = string.Format(senderFormat, dr["Recipient"].ToString(), dr["SentOn"].ToString(), "To", sss);
        }
        else  //sent box
        {
            Sender = string.Format(senderFormat, dr["Recipient"].ToString(), dr["SentOn"].ToString(), "To", "");
        }

        Body       = dr["Body"].ToString();
        Attachment = fillAttatchment(dr["Attachment"].ToString());
    }