Beispiel #1
0
        private void BackButton_Click(object sender, RoutedEventArgs e)
        {
            MainMenuWindow mainMenuWindow = new MainMenuWindow(1);

            mainMenuWindow.Show();
            Close();
        }
Beispiel #2
0
        private void Button1_Clicktemp(object sender, RoutedEventArgs e)
        {
            MainMenuWindow mainMenuWindow = new MainMenuWindow(1);

            mainMenuWindow.Show();
            this.Close();
        }
Beispiel #3
0
        /**
         * 结账按钮的实现,提交到数据库
         * 1. 改变账号余额
         * 2. 改变桌子状态为空闲
         * 3. 删除该桌子的订单
         * */
        private void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            if (MemberInfo != null)
            {
                MemberInfoConnector.ModifyMoney(MemberInfo.MbId, leftMoney);
            }
            TableInfoConnector.ModifyStatus(TId, 1);
            OrderInfoConnector.DeleteOrderByTId(TId);
            MessageBox.Show("结账完成!");
            MainMenuWindow mainMenuWindow = new MainMenuWindow(loginType);

            mainMenuWindow.Show();
            Close();
        }
Beispiel #4
0
        private void Button1_Click(object sender, RoutedEventArgs e)
        {
            /*
             * 判断输入框是否为空
             */
            if (textBox1.Text == "")
            {
                MessageBox.Show("用户名不能为空!");
                return;
            }
            else if (passwordBox1.Password == "")
            {
                MessageBox.Show("密码不能为空!");
                return;
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("验证码不能为空!");
                return;
            }

            /*
             * 判断验证码是否正确
             */
            else if (!textBox2.Text.ToString().ToUpper().Equals(validCode.CheckCode))
            {
                MessageBox.Show("验证码错误!");
                validCode          = new ValidCode(5, ValidCode.CodeType.Alphas);
                this.image1.Source = BitmapFrame.Create(validCode.CreateCheckCodeImage());
                return;
            }

            int result = ManagerConnector.Login(textBox1.Text, passwordBox1.Password);

            if (result == -2)
            {
                MessageBox.Show("用户名或密码错误!");
                textBox1.Text         = "";
                passwordBox1.Password = "";
                textBox2.Text         = "";
                LoadValidCode();
            }
            else
            {
                MainMenuWindow mainMenuWindow = new MainMenuWindow(result);
                mainMenuWindow.Show();
                this.Close();
            }
        }
        /**
         * 提交按钮事件
         * 提交数据库,修改桌号的状态
         * */
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            int submit = OrderInfoConnector.SubmitOrder(TId, addOrders);
            int modify = TableInfoConnector.ModifyStatus(TId, 0);

            if (submit == 0 && modify == 1)
            {
                MessageBox.Show("提交成功!");
            }
            else if (submit == 0 && modify != 1)
            {
                MessageBox.Show("修改餐桌状态失败!");
                return;
            }
            else
            {
                MessageBox.Show("提交失败");
                return;
            }
            MainMenuWindow mainMenuWindow = new MainMenuWindow(LoginType);

            mainMenuWindow.Show();
            Close();
        }