5 Star 43 Fork 3

maxinehehe/网上订餐系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
myOrder.aspx.cs 1.54 KB
一键复制 编辑 原始数据 按行查看 历史
maxinehehe 提交于 2018-02-04 20:18 . 提交课程设计 网上订餐
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class myOrder : System.Web.UI.Page
{
DataTable dt;
public void BindOrder()
{
SqlHelper sh = new SqlHelper();
SqlConnection con = sh.getCon();
if (Session["currentUser"] != null)
{
String username = Session["currentUser"].ToString();
String sql = "select * from orders ord,member mem ,users u where ord.username=u.username and u.memName=mem.memName and ord.userName='"+username+"'";
dt = new DataTable();
dt = sh.Query(sql);
con.Close();
if (dt.Rows.Count != 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
Response.Write("<script>alert('您还没有订单哦!');location.href='ShowFoods.aspx';</script>");
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindOrder();
}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex=e.NewPageIndex;
BindOrder();
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
ASP
1
https://gitee.com/maxinehehe/asp_project.git
git@gitee.com:maxinehehe/asp_project.git
maxinehehe
asp_project
网上订餐系统
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385