?? orderinfo.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 System.Data.SqlClient;
public partial class MemberManage_OrderInfo : System.Web.UI.Page
{
SqlOperate sqloperate = new SqlOperate();
SqlConnection sqlconn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
protected void txtSel_Click(object sender, EventArgs e)
{
if (Session["MName"] == null)
{
Response.Write("<script>alert('您還沒有登錄,請登錄后再使用,謝謝!');location='javascript:history.go(-1)';</script>");
}
else
{
this.gvbind();
}
}
protected void gvShopInfo_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvShopInfo.PageIndex = e.NewPageIndex;
this.gvbind();
}
public void gvbind()
{
string sqlstr = "select MemberID,MemberName from tb_Member where MemberID='" + txtMID.Text.Trim() + "'";
sqlconn.Open();
SqlCommand sqlcom = new SqlCommand(sqlstr,sqlconn);
int count = Convert.ToInt32(sqlcom.ExecuteScalar());
if (count > 0)
{
SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlconn);
DataSet myds = new DataSet();
myda.Fill(myds, "tb_Member");
DataRowView mydrv = myds.Tables["tb_Member"].DefaultView[0];
string sqlstrbind = "select * from tb_OrderInfo where OrderMember='"
+ Convert.ToString(mydrv.Row["MemberName"]) + "'";
SqlCommand com = new SqlCommand(sqlstrbind,sqlconn);
int countInfo = Convert.ToInt32(com.ExecuteScalar());
if (countInfo > 0)
{
sqloperate.gvDataBind(gvShopInfo, sqlstrbind);
}
else
{
gvShopInfo.Visible = false;
Response.Write("<script>alert('沒有該會員購物信息')</script>");
}
}
else
{
Response.Write("<script>alert('沒有該用戶,請您重新輸入!');location='javascript:history.go(-1)';</script>");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -