⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checkprint.aspx.cs

📁 C# + MYSQL 课程设计 ASP.NET 2.0数据库开发《餐饮消费管理系统》功能完整
💻 CS
字号:
//文件名:CheckPrint.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 EatingManage_CheckPrint : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {//打印客人用餐结账单
        if (Session["MyCompanyName"] != null)
        {
            this.Label1.Text = Session["MyCompanyName"].ToString() + "客人用餐结账单";
        }
        string MyID = Request.QueryString["MyID"].ToString();        
        DataTable MyTable = new DataTable();
        string MySQL = "SELECT * FROM [用餐信息] WHERE ([用餐单号]='" + MyID + "') ";
        String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyEateryDBConnectionString"].ConnectionString;
        SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);
        MyConnection.Open();
        SqlDataAdapter MyAdatper = new SqlDataAdapter(MySQL, MyConnection);
        MyAdatper.Fill(MyTable);
        this.Label3.Text = "用餐单号:" + MyTable.Rows[0]["用餐单号"].ToString();
        this.Label4.Text = "入座台位:" + MyTable.Rows[0]["入座台位"].ToString();
        this.Label5.Text = "客人人数:" + MyTable.Rows[0]["宾客人数"].ToString();
        this.Label2.Text = "用餐日期:" + DateTime.Parse(MyTable.Rows[0]["用餐日期"].ToString()).ToShortDateString();
        this.Label6.Text = "用餐类别:" + MyTable.Rows[0]["用餐类别"].ToString();
        this.Label7.Text = "用餐金额:" + MyTable.Rows[0]["用餐金额"].ToString()+"元";
        this.Label9.Text = "折扣金额:" + MyTable.Rows[0]["折扣金额"].ToString() + "元";
        this.Label10.Text = "实收金额:" + MyTable.Rows[0]["实收金额"].ToString() + "元";
        this.TextBox1.Text = MyTable.Rows[0]["宾客意见"].ToString();
        MySQL = "SELECT * FROM [员工信息] WHERE ([员工编号]='" + MyTable.Rows[0]["服务人员"].ToString() + "') ";
        MyAdatper = new SqlDataAdapter(MySQL, MyConnection);
        MyTable = new DataTable();      
        MyAdatper.Fill(MyTable);
        this.Label8.Text = "服务人员:" + MyTable.Rows[0]["员工姓名"].ToString();      
        MyTable = new DataTable();
        MySQL = "SELECT 菜品名称,计量单位,计费单价,计费数量,计费金额  FROM [用餐明细] WHERE ([用餐单号]='" + MyID + "') ";
        MyAdatper = new SqlDataAdapter(MySQL, MyConnection);
        MyAdatper.Fill(MyTable);
        this.GridView1.DataSource = MyTable;
        this.GridView1.DataBind();
        if (MyConnection.State == ConnectionState.Open)
        {
            MyConnection.Close();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -