protected void favor_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.InFavor(cid, Request.QueryString["content"].ToString());
if (result.code)
{
Response.Write("<script>alert('收藏成功!');location.href='Index.aspx';</script>");
}
else
{
Response.Write("<script>alert('收藏失败!请检查您是否已收藏该菜!');</script>");
}
}
}
protected void moveout_Click(object sender, EventArgs e)
{
if(Request.QueryString["type"]=="1")
{
foodmanage.MoveOut("[Restaurant].[dbo].[Order]", Session["id"].ToString().Trim(), Convert.ToInt32(Request.QueryString["content"]));
Response.Write("<script>alert('移除成功!');location.href='MyOrder.aspx';</script>");
}
else
{
foodmanage.MoveOut("[Restaurant].[dbo].[Favorite]", Session["id"].ToString().Trim(), Convert.ToInt32(Request.QueryString["content"]));
Response.Write("<script>alert('移除成功!');location.href='Myfavorite.aspx';</script>");
}
}
protected void favor_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.InFavor(cid, Request.QueryString["content"].ToString());
if (result.code)
{
Response.Write("<script>alert('收藏成功!');location.href='Index.aspx';</script>");
}
else
{
Response.Write("<script>alert('收藏失败!请检查您是否已收藏该菜!');</script>");
}
}
}
protected void moveout_Click(object sender, EventArgs e)
{
if(Request.QueryString["type"]=="1")
{
foodmanage.MoveOut("[Restaurant].[dbo].[Order]", Session["id"].ToString().Trim(), Convert.ToInt32(Request.QueryString["content"]));
Response.Write("<script>alert('移除成功!');location.href='MyOrder.aspx';</script>");
}
else
{
foodmanage.MoveOut("[Restaurant].[dbo].[Favorite]", Session["id"].ToString().Trim(), Convert.ToInt32(Request.QueryString["content"]));
Response.Write("<script>alert('移除成功!');location.href='Myfavorite.aspx';</script>");
}
}