protected void ButtonAddComment_Click(object sender, EventArgs e)
        {
            if (TextBoxComment.Visible == false)
            {
                if (Session["Customer"] != null)
                {
                    TextBoxComment.Visible = true;
                    ButtonAddComment.Text = "Publish Comment";
                }
                else
                {
                    Response.Write("<Script>alert('login first to add comment')</script>");

                }
            }
            else
            {
                customer = (Customer)Session["Customer"];
                string str = TextBoxComment.Text;
                Comment comment = new Comment(Guid.NewGuid(), str, dish.name, customer.name);
                customer.PublishComment(comment);

                Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["DishDetail"] + "?DishName=" + dish.name );
                //TextBoxComment.Visible = false;
                //ButtonAddComment.Text = "Add comment";
            }
        }
        //List<Reservation> timeoutReservationList = new List<Reservation>();
        //List<Delivery> timeoutDelivery = new List<Delivery>();
        //Function: initiate the all the dishes, by query the configure information in db
        //从数据库吧dish信息读出来,dish是Admin通过adddish加的
        public static void InitAllDish()
        {
            dishList = new List<Dish>();

            DataContextDataContext dc = new DataContextDataContext();
            ISingleResult<select_all_dishResult> rs = dc.select_all_dish();
            foreach (select_all_dishResult r in rs)
            {

                List<Tag> tagList = new List<Tag>();
                List<Comment> commentList = new List<Comment>();

                ISingleResult<get_tag_by_dishResult> rs2 = dc.get_tag_by_dish(r.name);
                foreach (get_tag_by_dishResult r2 in rs2)
                {
                    Tag tag = new Tag(r2.name, (int)r2.popularity);
                    tagList.Add(tag);
                }

                ISingleResult<get_comment_by_dishResult> rs3 = dc.get_comment_by_dish(r.name);
                foreach (get_comment_by_dishResult r3 in rs3)
                {
                    Comment comment = new Comment(r3.id,r3.content,r3.about_dish,r3.user_from);
                    commentList.Add(comment);

                }

                Dish dish = new Dish(
                    r.name,
                    r.description,
                    (double)r.price,
                    r.pict_path,
                    (int)r.popularity,
                    tagList,
                    commentList);
                dishList.Add(dish);
            }
        }
 public void PublishComment(Comment pC)
 {
     DataContextDataContext dc = new DataContextDataContext();
     dc.insert_comment(pC.id,pC.content,pC.aboutDish,pC.userFrom);
 }
        public List<Dish> SearchDishByKeyword(string pKeyword)
        {
            List<Dish> dishList = new List<Dish>();
            DataContextDataContext dc = new DataContextDataContext();

            ISingleResult<search_dish_by_keywordResult> rs = dc.search_dish_by_keyword(pKeyword);
            foreach (search_dish_by_keywordResult r in rs)
            {
                List<Tag> tagList = new List<Tag>();
                ISingleResult<get_tag_by_dishResult> rs2 = dc.get_tag_by_dish(r.name);
                foreach (get_tag_by_dishResult r2 in rs2)
                {
                    Tag tag = new Tag(r2.name, (int)r2.popularity);
                    tagList.Add(tag);
                }

                List<Comment> commentList = new List<Comment>();

                ISingleResult<get_comment_by_dishResult> rs3 = dc.get_comment_by_dish(r.name);
                foreach (get_comment_by_dishResult r3 in rs3)
                {
                    Comment comment = new Comment(r3.id, r3.content, r3.about_dish, r3.user_from);
                    commentList.Add(comment);
                }
                Dish dish = new Dish(r.name,
                    r.description,
                    (double)r.price,
                    r.pict_path,
                    (int)r.popularity,
                    tagList,
                    commentList);
                dishList.Add(dish);

            }
            return dishList;
        }
        public Dish GetDishByName(string pDishName)
        {
            Dish dish = null;

            DataContextDataContext dc = new DataContextDataContext();
            ISingleResult<get_dish_by_nameResult> rs = dc.get_dish_by_name(pDishName);

            foreach (get_dish_by_nameResult r in rs)
            {
                List<Tag> tagList = new List<Tag>();
                List<Comment> commentList = new List<Comment>();

                ISingleResult<get_tag_by_dishResult> rs2 = dc.get_tag_by_dish(r.name);
                foreach (get_tag_by_dishResult r2 in rs2)
                {
                    Tag tag = new Tag(r2.name, (int)r2.popularity);
                    tagList.Add(tag);
                }

                ISingleResult<get_comment_by_dishResult> rs3 = dc.get_comment_by_dish(r.name);
                foreach (get_comment_by_dishResult r3 in rs3)
                {
                    Comment comment = new Comment(r3.id, r3.content, r3.about_dish, r3.user_from);
                    commentList.Add(comment);

                }

                dish = new Dish(
                    r.name,
                    r.description,
                    (double)r.price,
                    r.pict_path,
                    (int)r.popularity,
                    tagList,
                    commentList);
            }
            return dish;
        }