1 Star 3 Fork 0

Admin/MyWebSms

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
control.aspx.cs 3.94 KB
一键复制 编辑 原始数据 按行查看 历史
Ai鹿子 提交于 2022-04-24 10:09 . 01
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Wuqi.Webdiyer;
using System.Data.SqlClient;
public partial class control : WebPage
{
public string CurUrl = HttpContext.Current.Request.RawUrl.Replace("/","");
protected void Page_Load(object sender, EventArgs e)
{
this.VerifyPage();
if (CheckCurUser())
{
if (!Page.IsPostBack)
{
DataBindlist();
}
}
else
{
this.message.Visible = true;
}
}
public bool CheckCurUser()
{
bool ret = false;
if (CurrentUser.UserPID == -1)
ret = true;
else
ret = false;
return ret;
}
protected void DataBindlist()
{
string sqlCount = string.Format("Select Count(1) From [Table_ErrSend] where SendFlag=1");
int recordcount = GetData.GetScalar(sqlCount);
if (recordcount == 0)
{
this.message.Visible = true;
}
pagelist.AlwaysShow = true;
pagelist.RecordCount = recordcount; //读出数据库里一共有多少条数据
string sql = "select * from [Table_ErrSend] where SendFlag=1 order by sendtime desc";
SqlDataAdapter ad = new SqlDataAdapter(sql, GetData.strConn);
DataSet ds = new DataSet();
ad.Fill(ds, pagelist.PageSize * (pagelist.CurrentPageIndex - 1), pagelist.PageSize, "temp");
rep_parent.DataSource = ds.Tables["temp"];
rep_parent.DataBind();
}
protected void PageChanging(object src, PageChangingEventArgs e)
{
pagelist.CurrentPageIndex = e.NewPageIndex;
DataBindlist();
}
protected void rep_parent_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
LinkButton btndel = (LinkButton)e.Item.FindControl("LinkBtnDel");
btndel.Attributes.Add("onclick", "Delete_Confirm();");
}
protected void rep_parent_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "BtnSend")
{
int s = int.Parse(e.CommandArgument.ToString());
ErrSend es = new ErrSend();
OutBox outb =new OutBox();
es.ID = s;
es = es.Select(es);
string content = es.Content;
string mobiles = es.Mobiles;
int flag = es.SendFlag;
int userid = es.UserID;
string orders = es.Orders;
Users us = new Users();
string interid = us.Select(userid).interid.ToString();
WebKey wk = new WebKey();
bool ret = wk.SendMobiles(mobiles, content, interid);
ShowMsg("发送成功!", Page);
outb.UpdateOutBoxOrd(orders);
es.UpdateErrSendsub(s.ToString());
DataBindlist();
//if (ret)
//{
// es.UpdateErrSend(s.ToString());
// DataBindlist();
//}
//else
//{
// ShowMsg("发送失败,请检查接口文件或通道剩余条数!", Page);
//}
}
if (e.CommandName == "BtnDel")
{
string s = e.CommandArgument.ToString();
ErrSend es = new ErrSend();
es.UpdateErrSend(s.ToString());
DataBindlist();
//if (es.Delete(int.Parse(s)))
//{
// DataBindlist();
//}
//else
//{
// ShowMsg("删除失败,请重试。", Page);
//}
}
}
public static string gettdname(string uid)
{
Users us = new Users();
int interid = us.Select(int.Parse(uid)).interid;
inters inter = new inters();
return inter.Select(interid).inter_name;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/huanghe_1_0/my-web-sms.git
git@gitee.com:huanghe_1_0/my-web-sms.git
huanghe_1_0
my-web-sms
MyWebSms
master

搜索帮助