GetFoodDataTable() 공개 메소드

public GetFoodDataTable ( int restaurantId = null ) : DataTable
restaurantId int
리턴 System.Data.DataTable
예제 #1
0
 private void BindData()
 {
     IFood biz = new FoodBiz();
     DataTable dt = (bool)base.CurEmployeeEntity.IS_ADMIN ?
         biz.GetFoodDataTable() :
         biz.GetFoodDataTable(base.CurEmployeeEntity.RESTAURANT_ID);
     repeater1.DataSource = GetPagedDataSource(dt.DefaultView);
     repeater1.DataBind();
 }
예제 #2
0
        private void BindData()
        {
            //绑定菜单列表
            IFood foodBiz = new FoodBiz();
            var dt = foodBiz.GetFoodDataTable(RestaurantId);
            repeater2.DataSource = dt;
            repeater2.DataBind();

            //绑定菜单类型列表
            var strFoodId = string.Empty;
            var listFoodType = new List<FoodTypeEntity>();
            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (!strFoodId.Contains(dr["FOOD_TYPE_ID"].ToString() + "|"))
                    {
                        strFoodId += dr["FOOD_TYPE_ID"].ToString() + "|";
                        listFoodType.Add(new FoodTypeEntity()
                        {
                            FOOD_TYPE_ID = base.ParseInt(dr["FOOD_TYPE_ID"].ToString()),
                            FOOD_TYPE_NAME = dr["FOOD_TYPE_NAME"].ToString()
                        });
                    }
                }
            }
            repeater1.DataSource = listFoodType;
            repeater1.DataBind();

            //获取是否已经点过菜
            IOrder orderBiz = new OrderBiz();
            var condition = new OrderMainEntity();
            condition.RESTAURANT_ID = RestaurantId;
            condition.TABLE_ID = TableId;
            condition.ORDER_FLAG = "1";
            var list = orderBiz.GetOrderMainEntityList(condition);
            if (list != null && list.Count > 0)
                this.hOrderId.Value = list[0].ORDER_ID.ToString();
        }