protected void btn_Sub_Out_Click(object sender, EventArgs e) { ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.ToUserList = this.TextBox3.Text; MyModel.ContentStr = this.TextBox4.Text; MyModel.FaSongUser = ZWL.Common.PublicMethod.GetSessionValue("UserName"); //Mobile.SendSMS2(MyModel.FaSongUser, MyModel.ToUserList, MyModel.ContentStr); string WrongUser = Mobile.send(TextBox3.Text.Trim(), MyModel.ContentStr); //发送人和发送内容 MyModel.ToUserList = "外部人员:" + this.TextBox3.Text; MyModel.Add(); if(WrongUser.Trim() == "发送成功") { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); } else if(WrongUser.Trim() == "号码过多") { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送失败!失败原因:号码过多。", "MobileSms.aspx"); } else if(WrongUser.Trim() == "号码不正确") { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送失败!失败原因:号码不正确。", "MobileSms.aspx"); } else { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送失败!失败原因:" + WrongUser + "。", "MobileSms.aspx"); } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加新外部手机短信(" + this.TextBox4.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); Response.Write("<script>alert('手机短信发送成功!');window.location.href='MobileSms.aspx'</script>"); //ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.ToUserList = this.TextBox1.Text.Trim(); MyModel.ContentStr = this.TextBox2.Text.Trim(); MyModel.FaSongUser = ZWL.Common.PublicMethod.GetSessionValue("UserName"); //Mobile.SendSMS(MyModel.FaSongUser, MyModel.ToUserList, MyModel.ContentStr); string WrongUser = Mobile.UserToTel(MyModel.ToUserList, MyModel.ContentStr); //发送人名,发送内容 MyModel.ToUserList = "内部人员:" + this.TextBox1.Text; MyModel.Add(); if (WrongUser.Trim() == "0") { } else if (WrongUser.Trim() == "1") { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); } else { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功,其中" + WrongUser.Trim() + "手机号码有误!", "MobileSms.aspx"); } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加新内部手机短信(" + this.TextBox2.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); //ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); }
protected void btn_Sub_In_Click(object sender, EventArgs e) { ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.ToUserList = this.TextBox1.Text.Trim(); MyModel.ContentStr = this.TextBox2.Text.Trim(); MyModel.FaSongUser = ZWL.Common.PublicMethod.GetSessionValue("UserName"); //Mobile.SendSMS(MyModel.FaSongUser, MyModel.ToUserList, MyModel.ContentStr); string WrongUser = Mobile.UserToTel(MyModel.ToUserList, MyModel.ContentStr); //发送人名,发送内容 MyModel.ToUserList = "内部人员:" + this.TextBox1.Text; MyModel.Add(); if(WrongUser.Trim() == "0") { } else if(WrongUser.Trim() == "1") { Response.Write("<script>alert('手机短信发送成功!');window.location.href='MobileSms.aspx'</script>"); //ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); } else { Response.Write("<script>alert('手机短信发送成功,其中" + WrongUser.Trim() + "手机号码有误!');window.location.href='MobileSms.aspx'</script>"); //ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功,其中" + WrongUser.Trim() + "手机号码有误!", "MobileSms.aspx"); } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加新内部手机短信(" + this.TextBox2.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); Response.Write("<script>alert('手机短信发送成功!');window.location.href='MobileSms.aspx'</script>"); //ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); }
protected void ImageButton5_Click(object sender, ImageClickEventArgs e) { string IDlist = ZWL.Common.PublicMethod.CheckCbx(this.GVData, "CheckSelect", "LabVisible"); string[] IDArray = IDlist.Split(','); for (int jk = 0; jk < IDArray.Length; jk++) { if (IDArray[jk].Trim().Length > 0 && IDArray[jk].Trim() != "0") { ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.GetModel(int.Parse(IDArray[jk].Trim())); if (ZWL.Common.PublicMethod.StrIFIn("内部人员:", MyModel.ToUserList) == true) { //内部 //Mobile.SendSMS(MyModel.FaSongUser, MyModel.ToUserList.Replace("内部人员:", ""), MyModel.ContentStr); string WrongUser = Mobile.UserToTel(MyModel.ToUserList.Replace("内部人员:", ""), MyModel.ContentStr); } else { //外部 //Mobile.SendSMS2(MyModel.FaSongUser, MyModel.ToUserList.Replace("外部人员:", ""), MyModel.ContentStr); string WrongUser = Mobile.send(MyModel.ToUserList.Replace("外部人员:", ""), MyModel.ContentStr); //发送人和发送内容 } } } DataBindToGridview(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户发送已发送手机短信中的信息"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); Response.Write("<script>alert(手机短信发送完毕!');</script>"); }
protected void Send(int id) { if (id != 0) { ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.GetModel(id); if (ZWL.Common.PublicMethod.StrIFIn("内部人员:", MyModel.ToUserList) == true) { //内部 Mobile.SendSMS(MyModel.FaSongUser, MyModel.ToUserList.Replace("内部人员:", ""), MyModel.ContentStr); } else { //外部 Mobile.SendSMS2(MyModel.FaSongUser, MyModel.ToUserList.Replace("外部人员:", ""), MyModel.ContentStr); } } DataBindToGridview(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户发送已发送手机短信中的信息"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); Response.Write("<script>alert(手机短信发送完毕!');</script>"); }
public void DataBindToGridview() { DataEntityDataContext context = new DataEntityDataContext(); ZWL.BLL.ERPMobile MyLanEmail = new ZWL.BLL.ERPMobile(); var T = context.ERPMobile.Where(p => p.FaSongUser == ZWL.Common.PublicMethod.GetSessionValue("UserName")).OrderByDescending(p => p.ID); MobileList = T.ToList(); }
protected void btn_Send_Click(object sender, EventArgs e) { string IDlist = ZWL.Common.PublicMethod.CheckCbx(this.GVData, "CheckSelect", "LabVisible"); string[] IDArray = IDlist.Split(','); for(int jk = 0; jk < IDArray.Length; jk++) { if(IDArray[jk].Trim().Length > 0 && IDArray[jk].Trim() != "0") { ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.GetModel(int.Parse(IDArray[jk].Trim())); if(ZWL.Common.PublicMethod.StrIFIn("内部人员:", MyModel.ToUserList) == true) { //内部 //Mobile.SendSMS(MyModel.FaSongUser, MyModel.ToUserList.Replace("内部人员:", ""), MyModel.ContentStr); string WrongUser = Mobile.UserToTel(MyModel.ToUserList.Replace("内部人员:", ""), MyModel.ContentStr); } else { //外部 //Mobile.SendSMS2(MyModel.FaSongUser, MyModel.ToUserList.Replace("外部人员:", ""), MyModel.ContentStr); string WrongUser = Mobile.send(MyModel.ToUserList.Replace("外部人员:", ""), MyModel.ContentStr); //发送人和发送内容 } } } DataBindToGridview(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户发送已发送手机短信中的信息"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); Response.Write("<script>alert(手机短信发送完毕!');</script>"); }
public void DataBindToGridview() { ZWL.BLL.ERPMobile MyLanEmail = new ZWL.BLL.ERPMobile(); GVData.DataSource = MyLanEmail.GetList("ContentStr like '%" + this.TextBox1.Text.Trim() + "%' and FaSongUser='******' order by ID desc"); GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
public void DataBindToGridview() { GVData.PageSize = AspNetPager1.PageSize; GVData.PageIndex = AspNetPager1.CurrentPageIndex - 1; ZWL.BLL.ERPMobile MyLanEmail = new ZWL.BLL.ERPMobile(); DataSet ds = MyLanEmail.GetList("ContentStr like '%" + this.TextBox1.Text.Trim() + "%' and FaSongUser='******' order by ID desc"); GVData.DataSource = ds; GVData.DataBind(); AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; }
protected void ImageButton2_Click(object sender, EventArgs e) { ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.ToUserList = this.TextBox3.Text; MyModel.ContentStr = this.TextBox4.Text; MyModel.FaSongUser = ZWL.Common.PublicMethod.GetSessionValue("UserName"); Mobile.SendSMS2(MyModel.FaSongUser, MyModel.ToUserList, MyModel.ContentStr); MyModel.ToUserList = "外部人员:" + this.TextBox3.Text; MyModel.Add(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加新外部手机短信(" + this.TextBox4.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); }
protected void btn_Sub_Out_Click(object sender, EventArgs e) { ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.ToUserList = this.TextBox3.Text; MyModel.ContentStr = this.TextBox4.Text; MyModel.FaSongUser = ZWL.Common.PublicMethod.GetSessionValue("UserName"); //Mobile.SendSMS2(MyModel.FaSongUser, MyModel.ToUserList, MyModel.ContentStr); string WrongUser = Mobile.send(TextBox3.Text.Trim(), MyModel.ContentStr); //发送人和发送内容 MyModel.ToUserList = "外部人员:" + this.TextBox3.Text; MyModel.Add(); if (WrongUser.Trim() == "发送成功") { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); } else if (WrongUser.Trim() == "号码过多") { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送失败!失败原因:号码过多。", "MobileSms.aspx"); } else if (WrongUser.Trim() == "号码不正确") { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送失败!失败原因:号码不正确。", "MobileSms.aspx"); } else { ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送失败!失败原因:" + WrongUser + "。", "MobileSms.aspx"); } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加新外部手机短信(" + this.TextBox4.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); Response.Write("<script>alert('手机短信发送成功!');window.location.href='MobileSms.aspx'</script>"); //ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.ToUserList = this.TextBox3.Text; MyModel.ContentStr = this.TextBox4.Text; MyModel.FaSongUser = ZWL.Common.PublicMethod.GetSessionValue("UserName"); Mobile.SendSMS2(MyModel.FaSongUser, MyModel.ToUserList, MyModel.ContentStr); MyModel.ToUserList = "外部人员:" + this.TextBox3.Text; MyModel.Add(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加新外部手机短信(" + this.TextBox4.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "手机短信发送成功!", "MobileSms.aspx"); }
//将选择的人名转换为电话列表并发送 //发送人列表,发送内容 public static String UserToTel(string UserList, string SendContent) { //SendContent += "【协同办公】"; //string UserListOk = ""; //用户名列表 //string OneUser = ""; //记录用户 //int OnUser = 0; //为1表示用户名 //for (int i = 0; i < UserList.Length; i++) //{ // if (UserList[i] == '(') { OnUser = 1; } // else if (UserList[i] == ')') // { // OnUser = 0; // if (UserListOk.Trim() != "") { UserListOk += ","; } // UserListOk += "'" + OneUser + "'"; // OneUser = ""; // } // if (UserList[i] != '(' && UserList[i] != ')' && OnUser != 0) // { // OneUser += UserList[i]; // } //} string StrMobile = ""; string WrongUser = ""; DataSet MyDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select JiaTingDianHua from ERPUser where UserName in('" + UserList.Replace(",", "','") + "')"); for (int i = 0; i < MyDT.Tables[0].Rows.Count; i++) { if (!string.IsNullOrEmpty(MyDT.Tables[0].Rows[i]["JiaTingDianHua"].ToString())) { if (StrMobile != "") { StrMobile += ","; } StrMobile += MyDT.Tables[0].Rows[i]["JiaTingDianHua"].ToString().Trim(); } } /* DataSet MobileList = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UI_strTrueName,UI_cTel from UserInfo where UI_nActive = 1 and UI_strLoginName in (" + UserList + ")"); if (MobileList.Tables[0].Rows.Count > 30) { System.Web.HttpContext.Current.Response.Write("<script>alert('超出人员上限(30人)!');</script>"); return "0"; } for (int i = 0; i < MobileList.Tables[0].Rows.Count; i++) { if (MobileList.Tables[0].Rows[i]["UI_cTel"].ToString().Trim() == "" || Mobile.GetCount(MobileList.Tables[0].Rows[i]["UI_cTel"].ToString().Trim()) == 0) //表示不是正确的手机号 { if (WrongUser != "") { WrongUser += ","; } WrongUser += MobileList.Tables[0].Rows[i]["UI_strTrueName"].ToString().Trim(); } else //表示手机号没有问题 { if (StrMobile != "") { StrMobile += ","; } StrMobile += MobileList.Tables[0].Rows[i]["UI_cTel"].ToString().Trim(); } }*/ if (StrMobile == "") { System.Web.HttpContext.Current.Response.Write("<script>alert('选择用户的手机号码有误,请确定!');</script>"); return "0"; } ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.ToUserList = UserList; //发送人 //MyModel.Active = 1; MyModel.ContentStr = SendContent; //发送内容 MyModel.FaSongUser = ZWL.Common.PublicMethod.GetSessionValue("UserName").ToString().Trim(); //发送人 //MyModel.Count = GetCount(StrMobile); //发送条数 // MyModel.TypeStr = Mobile.send(StrMobile, MyModel.ContentStr); //发送人和发送内容,返回发送状态 string TypeStr = Mobile.send(StrMobile, MyModel.ContentStr); //发送人和发送内容,返回发送状态 if (TypeStr == "发送失败") { TypeStr = Mobile.send(StrMobile, MyModel.ContentStr); } if (TypeStr == "发送失败") { TypeStr = Mobile.send(StrMobile, MyModel.ContentStr); } MyModel.Add(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户发送短信(" + UserList + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); if (WrongUser.Trim() == "") { return "1"; } else { return WrongUser.Trim(); } }
public static String UserToTel(string UserList, string SendContent) //将选择的人名转换为电话列表并发送 //发送人列表,发送内容 { //SendContent += "【协同办公】"; //string UserListOk = ""; //用户名列表 //string OneUser = ""; //记录用户 //int OnUser = 0; //为1表示用户名 //for (int i = 0; i < UserList.Length; i++) //{ // if (UserList[i] == '(') { OnUser = 1; } // else if (UserList[i] == ')') // { // OnUser = 0; // if (UserListOk.Trim() != "") { UserListOk += ","; } // UserListOk += "'" + OneUser + "'"; // OneUser = ""; // } // if (UserList[i] != '(' && UserList[i] != ')' && OnUser != 0) // { // OneUser += UserList[i]; // } //} string StrMobile = ""; string WrongUser = ""; DataSet MyDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select JiaTingDianHua from ERPUser where UserName in('" + UserList.Replace(",", "','") + "')"); for (int i = 0; i < MyDT.Tables[0].Rows.Count; i++) { if (!string.IsNullOrEmpty(MyDT.Tables[0].Rows[i]["JiaTingDianHua"].ToString())) { if (StrMobile != "") { StrMobile += ","; } StrMobile += MyDT.Tables[0].Rows[i]["JiaTingDianHua"].ToString().Trim(); } } /* * DataSet MobileList = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UI_strTrueName,UI_cTel from UserInfo where UI_nActive = 1 and UI_strLoginName in (" + UserList + ")"); * * if (MobileList.Tables[0].Rows.Count > 30) * { * System.Web.HttpContext.Current.Response.Write("<script>alert('超出人员上限(30人)!');</script>"); * return "0"; * } * for (int i = 0; i < MobileList.Tables[0].Rows.Count; i++) * { * if (MobileList.Tables[0].Rows[i]["UI_cTel"].ToString().Trim() == "" || Mobile.GetCount(MobileList.Tables[0].Rows[i]["UI_cTel"].ToString().Trim()) == 0) //表示不是正确的手机号 * { * if (WrongUser != "") { WrongUser += ","; } * WrongUser += MobileList.Tables[0].Rows[i]["UI_strTrueName"].ToString().Trim(); * } * else //表示手机号没有问题 * { * if (StrMobile != "") { StrMobile += ","; } * StrMobile += MobileList.Tables[0].Rows[i]["UI_cTel"].ToString().Trim(); * } * }*/ if (StrMobile == "") { System.Web.HttpContext.Current.Response.Write("<script>alert('选择用户的手机号码有误,请确定!');</script>"); return("0"); } ZWL.BLL.ERPMobile MyModel = new ZWL.BLL.ERPMobile(); MyModel.ToUserList = UserList; //发送人 //MyModel.Active = 1; MyModel.ContentStr = SendContent; //发送内容 MyModel.FaSongUser = ZWL.Common.PublicMethod.GetSessionValue("UserName").ToString().Trim(); //发送人 //MyModel.Count = GetCount(StrMobile); //发送条数 // MyModel.TypeStr = Mobile.send(StrMobile, MyModel.ContentStr); //发送人和发送内容,返回发送状态 string TypeStr = Mobile.send(StrMobile, MyModel.ContentStr); //发送人和发送内容,返回发送状态 if (TypeStr == "发送失败") { TypeStr = Mobile.send(StrMobile, MyModel.ContentStr); } if (TypeStr == "发送失败") { TypeStr = Mobile.send(StrMobile, MyModel.ContentStr); } MyModel.Add(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户发送短信(" + UserList + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); if (WrongUser.Trim() == "") { return("1"); } else { return(WrongUser.Trim()); } }