Esempio n. 1
0
    private List <int> ProcessSM()
    {
        SM_MsgBLL smBLL = new SM_MsgBLL();

        smBLL.Model.Sender   = (string)Session["UserName"];
        smBLL.Model.SendTime = DateTime.Now;
        smBLL.Model.Content  = "您从" + (string)Session["UserName"] + "处收到了一封新的邮件";
        smBLL.Model.Type     = 1;
        smBLL.Model.IsDelete = "N";
        int id = smBLL.Add();

        string recipients = Request.Form["hdnTxtSendTo"].ToString() + Request.Form["hdnTxtCcTo"].ToString() + Request.Form["hdnTxtBccTo"].ToString();

        string[] separators = new string[] { "," };
        string[] senders;
        senders = recipients.Split(separators, StringSplitOptions.RemoveEmptyEntries);

        SM_ReceiverBLL _bll         = new SM_ReceiverBLL();
        List <int>     receiverList = new List <int>();

        foreach (string s in senders)
        {
            _bll.Model.MsgID    = id;
            _bll.Model.IsRead   = "N";
            _bll.Model.IsDelete = "N";
            _bll.Model.Receiver = s;
            receiverList.Add(_bll.Add());
        }
        return(receiverList);
    }
    /// <summary>
    /// 发送短讯
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSend_Click(object sender, EventArgs e)
    {
        SendTo = Request.Form["hdnTxtSendTo"].ToString();
        string recipients = this.SendTo;
        if (recipients.EndsWith(",")) recipients = recipients.Substring(0, recipients.Length - 1);
        recipients = recipients.Replace(",", ",");
        string[] separators = new string[] { "," };
        string[] senders;

        senders = recipients.Split(separators, StringSplitOptions.RemoveEmptyEntries);
        SM_MsgBLL bll = new SM_MsgBLL();
        bll.Model.Sender = (string)Session["UserName"];
        bll.Model.Content = this.ckedit_content.Text;
        bll.Model.SendTime = DateTime.Now;
        bll.Model.Type = 1;
        bll.Model.IsDelete = "N";

        int id = bll.Add();

        SM_ReceiverBLL _receiverbll = new SM_ReceiverBLL();
        foreach (string s in senders)
        {
            _receiverbll.Model.MsgID = id;
            _receiverbll.Model.IsRead = "N";
            _receiverbll.Model.IsDelete = "N";
            _receiverbll.Model.Receiver = s;
            int i = _receiverbll.Add();
        }

        MessageBox.ShowAndClose(this, "站内短讯发送成功!");
    }
    private void SendSM(string Receiver, string Content)
    {
        SM_MsgBLL bll = new SM_MsgBLL();

        bll.Model.Sender   = Session["UserName"].ToString();
        bll.Model.Content  = Content;
        bll.Model.SendTime = DateTime.Now;
        bll.Model.Type     = 1;
        bll.Model.IsDelete = "N";

        int id = bll.Add();

        SM_ReceiverBLL _receiverbll = new SM_ReceiverBLL();

        _receiverbll.Model.MsgID    = id;
        _receiverbll.Model.IsRead   = "N";
        _receiverbll.Model.IsDelete = "N";
        _receiverbll.Model.Receiver = Receiver;
        _receiverbll.Add();
    }
    /// <summary>
    /// 发送短讯
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSend_Click(object sender, EventArgs e)
    {
        SendTo = Request.Form["hdnTxtSendTo"].ToString();
        string recipients = this.SendTo;

        if (recipients.EndsWith(","))
        {
            recipients = recipients.Substring(0, recipients.Length - 1);
        }
        recipients = recipients.Replace(",", ",");
        string[] separators = new string[] { "," };
        string[] senders;

        senders = recipients.Split(separators, StringSplitOptions.RemoveEmptyEntries);
        SM_MsgBLL bll = new SM_MsgBLL();

        bll.Model.Sender   = (string)Session["UserName"];
        bll.Model.Content  = this.ckedit_content.Text;
        bll.Model.SendTime = DateTime.Now;
        bll.Model.Type     = 1;
        bll.Model.IsDelete = "N";

        int id = bll.Add();

        SM_ReceiverBLL _receiverbll = new SM_ReceiverBLL();

        foreach (string s in senders)
        {
            _receiverbll.Model.MsgID    = id;
            _receiverbll.Model.IsRead   = "N";
            _receiverbll.Model.IsDelete = "N";
            _receiverbll.Model.Receiver = s;
            int i = _receiverbll.Add();
        }

        MessageBox.ShowAndClose(this, "站内短讯发送成功!");
    }
    private List<int> ProcessSM()
    {
        SM_MsgBLL smBLL = new SM_MsgBLL();
        smBLL.Model.Sender = (string)Session["UserName"];
        smBLL.Model.SendTime = DateTime.Now;
        smBLL.Model.Content = "您从" + (string)Session["UserName"] + "处收到了一封新的邮件";
        smBLL.Model.Type = 1;
        smBLL.Model.IsDelete = "N";
        int id = smBLL.Add();

        string recipients = Request.Form["hdnTxtSendTo"].ToString() + Request.Form["hdnTxtCcTo"].ToString() + Request.Form["hdnTxtBccTo"].ToString();
        string[] separators = new string[] { "," };
        string[] senders;
        senders = recipients.Split(separators, StringSplitOptions.RemoveEmptyEntries);

        SM_ReceiverBLL _bll = new SM_ReceiverBLL();
        List<int> receiverList = new List<int>();
        foreach (string s in senders)
        {
            _bll.Model.MsgID = id;
            _bll.Model.IsRead = "N";
            _bll.Model.IsDelete = "N";
            _bll.Model.Receiver = s;
            receiverList.Add(_bll.Add());
        }
        return receiverList;
    }
    private void SendSM(string Receiver, string Content)
    {
        SM_MsgBLL bll = new SM_MsgBLL();
        bll.Model.Sender = Session["UserName"].ToString();
        bll.Model.Content = Content;
        bll.Model.SendTime = DateTime.Now;
        bll.Model.Type = 1;
        bll.Model.IsDelete = "N";

        int id = bll.Add();

        SM_ReceiverBLL _receiverbll = new SM_ReceiverBLL();
        _receiverbll.Model.MsgID = id;
        _receiverbll.Model.IsRead = "N";
        _receiverbll.Model.IsDelete = "N";
        _receiverbll.Model.Receiver = Receiver;
        _receiverbll.Add();
    }