Ejemplo n.º 1
0
        private void ClickMenuCategory()
        {
            if (this.selectedmenuCategoryId != 0)
            {
                DishMenuBusiness menuManage = new DishMenuBusiness();
                DataTable        dt         = menuManage.GetDishMenus(this.selectedmenuCategoryId);

                this.BindDishCard(dt);
            }
        }
Ejemplo n.º 2
0
        private void BindDishCard(DataTable dataTable = null)
        {
            if (dataTable == null)
            {
                dataTable = new DishMenuBusiness().GetDishMenus();
            }

            if (this.dishPriceDT != null)
            {
                this.dishPriceDT.Clear();
            }
            this.dishPriceDT = dataTable;

            if (this.currentDishPage < 1)
            {
                this.currentDishPage = 1;
            }
            if (this.dishPriceDT == null)
            {
                return;
            }
            if (this.dishPriceDT.DefaultView.Count > 0)
            {
                this.maxDishPageCount = Convert.ToInt32(this.dishPriceDT.DefaultView.Count / 64) + 1;
            }
            else
            {
                this.maxDishPageCount = 1;
            }

            if (this.currentDishPage > this.maxDishPageCount)
            {
                this.currentDishPage = this.maxDishPageCount;
            }
            if (this.dishPriceDT.DefaultView.Count > 0)
            {
                for (int i = 0; i < 64; i++)
                {
                    this.dishCards[i].init();

                    if (((this.currentDishPage - 1) * 64) + i + 1 <= this.dishPriceDT.DefaultView.Count)
                    {
                        this.dishCards[i].DishId   = Convert.ToInt32(this.dishPriceDT.DefaultView[((this.currentDishPage - 1) * 64) + i]["Id"]);
                        this.dishCards[i].MOID     = Convert.ToInt32(this.dishPriceDT.DefaultView[((this.currentDishPage - 1) * 64) + i]["UnitId"]);
                        this.dishCards[i].Code     = "[" + this.dishPriceDT.DefaultView[((this.currentDishPage - 1) * 64) + i]["Code"].ToString() + "]";
                        this.dishCards[i].DishName = this.dishCards[i].Code + "\r\n" + this.dishPriceDT.DefaultView[((this.currentDishPage - 1) * 64) + i]["Name"].ToString();
                        this.dishCards[i].MoName   = this.dishPriceDT.DefaultView[(this.currentDishPage - 1) * 64 + i]["UnitName"].ToString();
                        this.dishCards[i].Price    = this.dishPriceDT.DefaultView[((this.currentDishPage - 1) * 64) + i]["Price"].ToString() + "/" + this.dishCards[i].MoName;
                        this.dishCards[i].isgq     = Convert.ToInt32(this.dishPriceDT.DefaultView[((this.currentDishPage - 1) * 64) + i]["Isgq"]); // 是否沽清
                        //this.dishCards[i].issetmeal = Convert.ToInt32(this.dishPriceDT.DefaultView[((this.currentDishPage - 1) * 64) + i]["ISSETMEAL"]);

                        this.dishCards[i].Class = Convert.ToString(this.dishPriceDT.DefaultView[((this.currentDishPage - 1) * 64) + i]["Category_Id"]);
                    }
                }
            }
            else
            {
                for (int i = 0; i < 64; i++)
                {
                    this.dishCards[i].init();
                }
            }
        }