protected void BtnConfirmMoible_Click(object sender, EventArgs e) { string name = Request.Cookies["RePwdName"].Value.ToString(); try { MemberInfoDAL obj = new MemberInfoDAL(); string phone = obj.GetMobileByName(Request.Cookies["RePwdName"].Value.ToString()); if (phone == this.TxtMobile.Text.Trim().ToString()) { string ProofPwd = obj.RndNum(6); //发送验证码 Tz888.BLL.SendNotice mob = new Tz888.BLL.SendNotice(); if (mob.SendMobileMsg(this.TxtMobile.Text.Trim().ToString(), ProofPwd)) { Session["Proofpwd"] = ProofPwd; Response.Redirect("succeedByMobile.aspx"); } else { Response.Write("<script>alert('服务器发送验证码失败,请重试!');</script>"); } } else { this.LblMessage.Text = "您输入的手机号码不是注册时的手机号!"; } } catch { Response.Write("<script>alert('发送验证码失败,请重试!');</script>"); } }
public void MacthingInfo() { Tz888.BLL.SendNotice notice = new SendNotice(); DataTable dt1 = dalSend.GetMachInfoList("");//所有订阅人列表 for (int i = 0; i < dt1.Rows.Count; i++) { string loginname = dt1.Rows[i]["LoginName"].ToString().Trim(); DataTable dtGetTool = obj.GetList("UserParametersTab", "NoticeEmail,NoticeMobile", "parID", 1, 1, 0, 1, "loginname='" + loginname + "'"); string email = dtGetTool.Rows[0]["NoticeEmail"].ToString().Trim(); string mobile = dtGetTool.Rows[0]["NoticeMobile"].ToString().Trim(); DataTable dt2 = dalSend.GetMachInfoList(loginname);//订阅ID string TempStr = DownUrl("http://member.topfo.com/helper/sendMachinfo.aspx?ID=" + dt2.Rows[0]["ID"].ToString(), "GB2312"); string title = GetCustomType("0"); string siteContent = "您有新的订阅信息,请进“拓富助手-我的订阅”中查看!"; notice.InfoMatching(loginname, siteContent, title + "信息订阅" + DateTime.Now.ToShortDateString(), siteContent, TempStr); } }
public void VipVali() { SubscribeSet dalSend = new SubscribeSet(); DataTable dt = dalSend.GetMemberExpiredList(); Tz888.BLL.SendNotice objSend = new SendNotice(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string loginname = dt.Rows[i]["LoginName"].ToString(); string expireddate = Convert.ToDateTime(dt.Rows[i]["VipInvalidDate"].ToString()).ToShortDateString(); string email = dt.Rows[i]["NoticeEmail"].ToString().Trim(); string mobile = dt.Rows[i]["NoticeMobile"].ToString().Trim(); string mobileContet = "您的拓富通会员资格即将在" + expireddate + "过期,为了保证您的特权,请及时续费!www.topfo.com[此条信息免费]"; objSend.Send(loginname, mobileContet, "您的拓富通即将到期", mobileContet, mobileContet, "VipExpiredNotice"); } } }
//添加好友 public void AddFriend(Tz888.Model.GoodFriend model) { dal.AddFriend(model); SendNotice obj = new SendNotice(); Conn con = new Conn(); DataTable dt1 = con.GetList("LoginInfoTab", "NickName", "LoginID", 1, 1, 0, 1, "LoginName='" + model.LoginName + "'"); DataTable dt2 = con.GetList("LoginInfoTab", "NickName", "LoginID", 1, 1, 0, 1, "LoginName='" + model.ContactName + "'"); if (dt1.Rows.Count > 0 && dt2.Rows.Count > 0) { string loginname1 = dt1.Rows[0]["NickName"].ToString().Trim(); //添加人 string loginname2 = dt2.Rows[0]["NickName"].ToString().Trim(); //被添加人 string MobileText = "您已被“" + loginname1 + "”添加为好友,[此条信息免费]"; string EmailText = "尊敬的" + loginname2 + ",您已被“" + loginname1 + "”添加为好友"; string Title = "好友添加通知"; string SiteText = "您已被“" + loginname1 + "”添加为好友,[此条信息免费]"; obj.SendSms(model.ContactName, MobileText, Title, SiteText, EmailText, "FriendAddNotice"); } }
protected void BtnConfirmMoible_Click(object sender, EventArgs e) { MemberInfoDAL obj = new MemberInfoDAL(); try { string phone = obj.GetMobileByName(Request.Cookies["RePwdName"].Value.ToString()); if (phone.Length == 11 && phone.IndexOf("-", 0) == -1) { if (phone == this.TxtMobile.Text.Trim().ToString()) { string ProofPwd = obj.RndNum(6); //发送验证码 Tz888.BLL.SendNotice mob = new Tz888.BLL.SendNotice(); if (mob.SendMobileMsg(this.TxtMobile.Text.Trim().ToString(), ProofPwd)) { Session["Proofpwd"] = ProofPwd; Response.Redirect("succeedByMobile.aspx"); } else { Response.Write("<script>alert('服务器发送验证码失败,请重试!');</script>"); } } else { Response.Redirect("RetrieveStep9.aspx"); } } else { Response.Redirect("Errortelephone.aspx"); } } catch { Response.Write("<script>alert('发送验证码失败,请重试!');</script>"); } }
public void SendSubscribe() { //推广接收人列表 DataTable dt1 = dalSend.GetReceivedList(""); if (dt1.Rows.Count > 0) { for (int i = 0; i < dt1.Rows.Count; i++) { string loginname = dt1.Rows[i]["ReceiveLoginName"].ToString().Trim(); //接收方式 DataTable dtGetType = obj.GetList("SubscribegetsetTab", "ReveiveType", "ID", 1, 1, 0, 1, "loginname='" + loginname + "'"); string ReveiveType = dtGetType.Rows[0]["ReveiveType"].ToString().Trim(); //接收手机和邮件 DataTable dtGetTool = obj.GetList("UserParametersTab", "NoticeEmail,NoticeMobile", "parID", 1, 1, 0, 1, "loginname='" + loginname + "'"); string email = dtGetTool.Rows[0]["NoticeEmail"].ToString().Trim(); string mobile = dtGetTool.Rows[0]["NoticeMobile"].ToString().Trim(); //接收内容 string fldName = "ID,InfoID,Title,HtmlFile,InfoTypeID,ReceiveLoginName,PublishT"; string strWhere = "ReceiveLoginName='" + loginname + "' and isSend<>1"; DataTable dt2 = obj.GetList("SubscribeRecViw", fldName, "InfoID", 2, 1, 0, 1, strWhere); if (dt2.Rows.Count > 0)//信息列表 { #region 手机和站内短信 文本中的标题 只取两条 string strTitle = ""; if (dt2.Rows.Count > 1) { for (int k = 0; k < dt2.Rows.Count; k++) { strTitle += "[" + dt2.Rows[k]["Title"].ToString() + "],"; if (k == 1) { break; } } } else { strTitle = "[" + dt2.Rows[0]["Title"].ToString() + "],"; } #endregion #region 发送站内短信 if (getType(ReveiveType, "1")) { string siteMsgStr = "尊敬的" + GetNickName(dt2.Rows[0]["ReceiveLoginName"].ToString().Trim()) + ":" + "今天又有" + dt2.Rows.Count.ToString() + "条资源推荐给您:" + strTitle + "…更多内容请到拓富中心“定向推广”处查阅。"; bool b = SendSiteMsg(loginname, "[好消息]" + DateTime.Now.ToShortDateString() + "优秀资源推荐", siteMsgStr); } #endregion #region 发送手机短信 if (getType(ReveiveType, "3")) { Tz888.BLL.SendNotice objSend = new SendNotice(); if (mobile != "") { bool ab = objSend.SendMobileMsg(mobile, "优秀资源推荐," + strTitle + "更多资源请登录拓富中心查询(本条信息免费)"); } } #endregion #region 发送邮件 if (getType(ReveiveType, "2")) { string url = System.Configuration.ConfigurationManager.AppSettings["EmailSubscribe"]; string TempStr = DownUrl(url, "GB2312"); string tempHtml = ""; for (int m = 0; m < dt2.Rows.Count; m++) { tempHtml += "<tr align='left'>" + "<td align='left' height='22px'>" + (m + 1).ToString() + "、<span class='orange2'>" + dt2.Rows[m]["Title"].ToString() + "</span></td>" + "</tr>" + "<tr>" + "<td align='left' style='font-size:12px'>" + GetAbout(dt2.Rows[m]["InfoID"].ToString().Trim(), dt2.Rows[m]["InfoTypeID"].ToString().Trim()) + "</td>" + "</tr>" + "<tr>" + "<td align='left' height='22px'>资源链接<a class='ablue01 f12' target='_blank' href='http://www.topfo.com/" + dt2.Rows[m]["HtmlFile"].ToString() + "'>http://www.topfo.com/" + dt2.Rows[m]["HtmlFile"].ToString() + "</a></td>" + "</tr>"; } TempStr = TempStr.Replace("#InfoCount#", dt2.Rows.Count.ToString()); TempStr = TempStr.Replace("#SendHtml#", tempHtml); TempStr = TempStr.Replace("#NickName#", GetNickName(dt2.Rows[0]["ReceiveLoginName"].ToString().Trim())); SendEmail(email, "中国招商投资网为您推荐", TempStr); } #endregion #region 修改发送状态 for (int j = 0; j < dt2.Rows.Count; j++) { bool issend = dalSend.isSend(loginname); } #endregion } } } }
protected void Page_Load(object sender, EventArgs e) { //--上行参数--- string srcmobile = Request.Params["srcmobile"].ToString(); string spmobile = Request.Params["spmobile"].ToString(); string msg = Request.Params["msg"].ToString(); string msgid = Request.Params["MsgID"].ToString(); string cpid = Request.Params["CPID"].ToString(); string linkid = Request.Params["linkid"].ToString(); string gateway = Request.Params["gateway"].ToString(); string svid = Request.Params["svid"].ToString(); LoginName = msg.Substring(2, msg.Length - 2).ToString(); if (spmobile == "106693891329") { string re = "http://www.jianzhentech.com/spback.aspx?CPID=0755029&srcmobile=" + srcmobile + "&spmobile=" + spmobile + "&linkID=" + linkid + "&MsgID=" + msgid + "&gateway=" + gateway + "&msg=" + GBK(msg).Replace("#", "%23") + "&svid=" + svid; wt(re); Response.Redirect(re); } else { Tz888.BLL.SendNotice bll = new Tz888.BLL.SendNotice(); string content = "";//下行消息 //业务处理 model.srcMobile = srcmobile; model.spMobile = spmobile; model.LoginName = LoginName; model.Msg = msg; model.CPID = cpid; model.MsgID = msgid; model.linkID = linkid; model.gateway = Convert.ToInt32(gateway); model.svid = svid; int i = dal.Add(model); if (i == 0) { content = "您的拓富通会员试用申请已成功,有效期:" + DateTime.Now.ToShortDateString() + "至" + DateTime.Now.AddDays(1).ToShortDateString() + "请登录网站体验.[拓富网topfo.com],此信息1元/条,不含通讯费"; feecode = "000100"; status = "0"; SendMsg_cp(srcmobile, GBK(content), svid, linkid, msgid, feecode, gateway); wt(DateTime.Now.ToString() + LoginName + "操作返回参数:" + i.ToString()); } else { if (i == 1) { content = "您已经超过拓富通会员的试用次数![中国招商投资网topfo.com],此条信息免费"; } else if (i == 2) { content = "您输入的帐号有误,申请尚未成功.[中国招商投资网topfo.com],此条信息免费"; } else { content = "试用申请失败.[中国招商投资网topfo.com],此条信息免费"; } bool b = bll.SendMobileMsg(srcmobile, content); //SendMsg_cp(srcmobile, GBK(content), svid, linkid, msgid, feecode, gateway); wt(LoginName + srcmobile + content); } } }
protected void Button1_Click(object sender, EventArgs e) { Tz888.BLL.SendNotice dal = new Tz888.BLL.SendNotice(); dal.InfoCheck("huanglelou", "水哦资源", "资源", "资源"); }