Пример #1
0
        private void btnDC_Click(object sender, EventArgs e)
        {
            int    n       = 0;
            Random rd      = new Random();
            string OrderId = "";

            OrderId += DateTime.Now.Year.ToString();
            OrderId += DateTime.Now.Month.ToString();
            OrderId += DateTime.Now.Day.ToString();
            for (int i = 0; i < 6; i++)
            {
                OrderId += rd.Next(0, 10).ToString();
            }
            n = OrderManager.InsertOrder(OrderId, Convert.ToInt32(lbTableId.Text));
            ScheduleManager.DeleteSchedule();
            TableManager.UpdateTypebyTableId(5, lbTableId.Text);
            TableManager.UpdateTableNowInfo(lbTableId.Text, OrderId, DateTime.Now, 0, null, false);
            if (n > 0)
            {
                // FoodPlayer.Ctlcontrols.stop();
                FrmFoodMain drm = new FrmFoodMain();
                FrmFoodInfo ffi = new FrmFoodInfo();

                drm.lbTable.Text   = lbTableId.Text;
                drm.lbOrderId.Text = OrderId;

                this.Hide();
                drm.Show();
            }
            else
            {
                Transmit.FrmFoodMain.Tipsk("打开失败请重试!");
            }
        }
Пример #2
0
        private void txtFind_TextChanged(object sender, EventArgs e)
        {
            pbxNew.Image        = Image.FromFile(Application.StartupPath + @"\Images\主界面\新品菜品.png");
            pbxHot.Image        = Image.FromFile(Application.StartupPath + @"\Images\主界面\热销菜品.png");
            pbxHotDishes.Image  = Image.FromFile(Application.StartupPath + @"\Images\主界面\热菜.png");
            pbxColdDishes.Image = Image.FromFile(Application.StartupPath + @"\Images\主界面\凉菜.png");
            pbxSoup.Image       = Image.FromFile(Application.StartupPath + @"\Images\主界面\汤类.png");
            pbxWine.Image       = Image.FromFile(Application.StartupPath + @"\Images\主界面\酒水.png");
            pbxOther.Image      = Image.FromFile(Application.StartupPath + @"\Images\主界面\其他.png");
            string text1 = GetSpellCode(txtFind.Text);

            if (text1 == "")
            {
                flpMain.Controls.Clear();
                List <Food> fd = FoodManager.SelectFoodAll();

                for (int i = 0; i < fd.Count; i++)
                {
                    FrmFoodInfo t = new FrmFoodInfo();
                    t.pbxImage.Image  = Image.FromFile(Application.StartupPath + @"\Images\食物\" + fd[i].FoodImage + ".jpg");
                    t.lbFoodName.Text = fd[i].FoodName;
                    t.lbRMB.Text      = fd[i].Price.ToString().Substring(0, 4);
                    double VipPrice = Convert.ToDouble(t.lbRMB.Text);
                    t.lbVipPrice.Text = (VipPrice * 0.8).ToString();
                    flpMain.Controls.Add(t);
                }
            }
            else
            {
                List <string> list = new List <string>();
                for (int i = 0; i < fd.Count; i++)
                {
                    if (GetSpellCode(fd[i].ToString()).IndexOf(text1) == 0)
                    {
                        list.Add(fd[i]);
                        flpMain.Controls.Clear();
                    }
                }
                for (int i = 0; i < list.Count; i++)
                {
                    List <Food> fd = FoodManager.SelectFoodbyFoodName(list[i]);
                    for (int j = 0; j < fd.Count; j++)
                    {
                        FrmFoodInfo t = new FrmFoodInfo();
                        t.pbxImage.Image  = Image.FromFile(Application.StartupPath + @"\Images\食物\" + fd[j].FoodImage + ".jpg");
                        t.lbFoodName.Text = fd[j].FoodName;
                        t.lbRMB.Text      = fd[j].Price.ToString().Substring(0, 4);
                        double VipPrice = Convert.ToDouble(t.lbRMB.Text);
                        t.lbVipPrice.Text = (VipPrice * 0.8).ToString();
                        flpMain.Controls.Add(t);
                    }
                }
            }
        }
Пример #3
0
        /// <summary>
        /// 加载菜品类型
        /// </summary>
        /// <param name="type">类型</param>
        public void FoodType(string type)
        {
            flpMain.Controls.Clear();
            List <Food> fd = FoodManager.SelectFoodbyType(type);

            for (int i = 0; i < fd.Count; i++)
            {
                FrmFoodInfo t   = new FrmFoodInfo();
                Food        fds = new Food();
                t.pbxImage.Image  = Image.FromFile(Application.StartupPath + @"\Images\食物\" + fd[i].FoodImage + ".jpg");
                t.lbFoodName.Text = fd[i].FoodName;
                t.lbRMB.Text      = fd[i].Price.ToString().Substring(0, 4);
                double VipPrice = Convert.ToDouble(t.lbRMB.Text);
                t.lbVipPrice.Text = (VipPrice * 0.8).ToString();
                this.flpMain.Controls.Add(t);
            }
        }
Пример #4
0
        private void FrmFood_Load(object sender, EventArgs e)
        {
            ProcessMain.Visible = true;
            flpMain.Controls.Clear();
            List <Food> fd = FoodManager.SelectFoodAll();

            for (int i = 0; i < fd.Count; i++)
            {
                FrmFoodInfo t = new FrmFoodInfo();
                t.pbxImage.Image  = Image.FromFile(Application.StartupPath + @"\Images\食物\" + fd[i].FoodImage + ".jpg");
                t.lbFoodName.Text = fd[i].FoodName;
                t.lbRMB.Text      = fd[i].Price.ToString().Substring(0, 4);
                double VipPrice = Convert.ToDouble(t.lbRMB.Text);
                t.lbVipPrice.Text = (VipPrice * 0.8).ToString();
                flpMain.Controls.Add(t);
            }
            tmrProcess.Enabled = true;
        }