📄 sms_list.aspx.cs
字号:
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 SMS_Lib;
using DBLibrary;
public partial class SMS_Sms_List : SMS_PageBase
{
private DBLibrary.DBClass db = new DBClass();
private int flg = 1;//1,发送,2接收
protected void Page_Load(object sender, EventArgs e)
{
//this.GridView1.AutoGenerateColumns = false;
if (!Page.IsPostBack)
{
if (Request["Flag"] != null)
{
this.title.InnerText = "已接收的短信";
//this.GridView1.Columns[5].Visible = false;
this.GridView1.Columns.RemoveAt(2);
this.GridView1.Columns.RemoveAt(3);
flg = 2;
ViewState["fg"] = "2";
this.send.Visible = false;
}
else
{
ViewState["fg"] = "1";
this.title.InnerText = "已发送的短信";
this.GridView1.Columns.RemoveAt(1);
}
Sms_DataBind(flg);
}
}
private void Sms_DataBind(int flag)
{
string id = this.sms_id.ToString();
System.Data.SqlClient.SqlParameter[] para =
{
db.MakeInputParameter("@sid",SqlDbType.NVarChar,50,id),
db.MakeInputParameter("@flag",SqlDbType.Int,4,ViewState["fg"]==null?"1":ViewState["fg"].ToString())
};
try
{
DataTable dt = db.RunProcedureForDataSet("SMS_Web_SMSList", para).Tables[0];
this.GridView1.DataSource = dt.DefaultView;
this.GridView1.DataBind();
}
catch
{
}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.GridView1.PageIndex = e.NewPageIndex;
Sms_DataBind(flg);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -