Beispiel #1
0
    /// <summary>
    /// 发送站内短信

    /// </summary>
    private void SendLoginNameShort(string descript, DataTable dt)
    {
        Tz888.BLL.InnerInfo   infoBLL   = new Tz888.BLL.InnerInfo();
        Tz888.Model.InnerInfo infomodel = new Tz888.Model.InnerInfo();
        foreach (DataRow dataRow in dt.Rows)
        {
            infomodel.SendName    = loginname; //"020bluemax";//发件人
            infomodel.Topic       = "推广信息:" + title;
            infomodel.SendName    = loginname; //dataRow["loginname"].ToString().Trim();
            infomodel.Context     = descript;
            infomodel.InfoTime    = DateTime.Now;
            infomodel.ReceiveName = dataRow["loginname"].ToString().Trim(); //收件人"hellocindy";
            infomodel.ChangeBy    = loginname;                              //"020bluemax";//修改人

            bool statu = infoBLL.SendInfoBLL(infomodel, true);
            if (statu)
            {
                Tz888.BLL.SubscribeSet         bll   = new Tz888.BLL.SubscribeSet();
                Tz888.Model.SubscribeSetTabLog model = new Tz888.Model.SubscribeSetTabLog();
                model.LoginName = dataRow["loginname"].ToString().Trim();
                model.SubType   = "站内短信";
                model.Sid       = id;
                bll.Insert(model);
            }
        }
    }
Beispiel #2
0
    protected void BtnInfoResponse_Click(object sender, EventArgs e)
    {
        bool result = false;

        Tz888.BLL.InnerInfo   infoBLL   = new Tz888.BLL.InnerInfo();
        Tz888.Model.InnerInfo infoModel = new Tz888.Model.InnerInfo();
        //设置Model字段成员
        infoModel.Topic       = this.TBoxResponseTopic.Text;
        infoModel.Context     = this.TBoxResponseText.Text;
        infoModel.ReceiveName = this.TboxReceiveName.Text;

        infoModel.SendName = Page.User.Identity.Name;
        infoModel.ChangeBy = Page.User.Identity.Name;
        //infoModel.SendName = "sunray";
        //infoModel.ChangeBy = "sunray";
        infoModel.SendId = 0;
        result           = infoBLL.SendInfoBLL(infoModel, this.CheckBoxSaveOther.Checked);
        Response.Redirect("inbox2.aspx?");
    }
Beispiel #3
0
    protected void butSend_Click(object sender, EventArgs e)
    {//发送消息
        if (txtReceivedMan.Text.Trim() == "")
        {
            return;
        }
        if (txtTopic.Text.Trim() == "")
        {
            return;
        }
        if (txtContext.Text.Trim() == "")
        {
            return;
        }
        bool result = false;

        Tz888.Model.InnerInfo model   = new Tz888.Model.InnerInfo();
        Tz888.BLL.InnerInfo   infoBLL = new Tz888.BLL.InnerInfo();
        string[] s = this.txtReceivedMan.Text.Split(',');

        model.SendName = Page.User.Identity.Name;
        //model.SendName = "kiki";
        model.Topic    = this.txtTopic.Text;
        model.Context  = this.txtContext.Text;
        model.InfoTime = DateTime.Now;
        model.ChangeBy = Page.User.Identity.Name;

        for (int i = 0; i < s.Length; i++)
        {
            if (s[i].Trim() != "")
            {
                Tz888.BLL.Conn dal      = new Tz888.BLL.Conn();
                long           m        = 0;
                long           k        = 0;
                long           j        = 0;
                string         name     = s[i].Trim();
                string         strWhere = "nickName='" + name + "'";
                DataTable      dt       = dal.GetList("loginInfoTab", "loginName", "loginName", strWhere, "loginName", ref m, k, ref j);
                if (dt == null)
                {
                    Tz888.Common.MessageBox.Show(this.Page, "收件人用户[" + name + "]不存在!");
                    return;
                }
                else
                {
                    if (dt.Rows.Count == 0)
                    {
                        Tz888.Common.MessageBox.Show(this.Page, "收件人用户[" + name + "]不存在!");
                        return;
                    }
                }
                if (dt != null && dt.Rows.Count > 0)
                {
                    model.ReceiveName = dt.Rows[0][0].ToString().Trim();
                }
                //else
                //{
                //    Tz888.Common.MessageBox.Show(this.Page, "收件人用户[" + name + "]不存在!");
                //    return;
                //}
                //model.ReceiveName = s[i];

                //SendId 自动生成
                Tz888.BLL.GoodFriend friendBll = new Tz888.BLL.GoodFriend();
                bool bl = friendBll.IsSpecies(model.ReceiveName, Page.User.Identity.Name, 3);
                if (!bl)
                {
                    result = infoBLL.SendInfoBLL(model, this.cbIsSave.Checked);
                    Tz888.Common.MessageBox.ShowAndHref("短消息发送成功", "SendBox2.aspx");
                }
                else
                {
                    Response.Write("<script>alert('短消息发送失败!您被" + name + "加入黑名单')</script>");
                }
            }
        }
    }