using Restaurant.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Restaurant.WEB
{
public partial class FoodInfo : System.Web.UI.Page
{
BLL.FoodManage foodmanage = new BLL.FoodManage();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = foodmanage.GetFoodInfo(Convert.ToInt32(Request.QueryString["content"]));
img.ImageUrl = dt.Rows[0][5].ToString().Trim();
feature.InnerText += dt.Rows[0][1].ToString().Trim();
fname.InnerText += dt.Rows[0][2].ToString().Trim();
fprice.InnerText += dt.Rows[0][3].ToString().Trim();
fdesc.InnerText += dt.Rows[0][4].ToString().Trim();
if (Request.QueryString["type"] == "1"||Request.QueryString["type"] == "2")
{
moveout.Visible = true;
}
else
{
moveout.Visible = false;
}
}
}
protected void order_Click(object sender, EventArgs e)
{
if (Session["id"] == null)
{
Response.Redirect("Login.aspx");
}
else
{
Result result = new Result();
string cid = Session["id"].ToString().Trim();
result = foodmanage.InOrder(cid, Request.QueryString["content"]);
if (result.code)
{
Response.Write("<script>alert('预订成功!');location.href='Index.aspx';</script>");
}
else
{
Response.Write("<script>alert('预订失败!请检查您是否已预定过该菜!');</script>");
}
}
}
}
}