Ejemplo n.º 1
0
 private void pictureBox1_Click(object sender, EventArgs e)
 {
     //Process.Start(@"C:\windows\system32\osk.exe");
     // System.Diagnostics.Process.Start(@"%windir%\system32\osk.exe");
     HideInputPanel();
     ShowInputPanel();
     CommonInfo.FrmMessageBox fm = new CommonInfo.FrmMessageBox("请输入密码", "管理员提示:", MessageBoxStyle.mima);
     //fm.ShowDialog();
     if (DialogResult.Cancel == fm.ShowDialog())
     {
         return;
     }
     //ShowInputPanel();
     HideInputPanel();
     Application.Exit();
 }
Ejemplo n.º 2
0
        private void pictureBox2_DoubleClick(object sender, EventArgs e)
        {
            WelCome.HideInputPanel();
            WelCome.ShowInputPanel();
            bool   fl     = true;
            string result = null;

            while (fl)
            {
                result = Microsoft.VisualBasic.Interaction.InputBox("请输入餐桌号", "锁定餐桌", "", 0, this.Top);
                if (string.IsNullOrEmpty(result))
                {
                    var A = MessageBox.Show("请重新输入,不可为空值", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (DialogResult.No == A)
                    {
                        fl = false;
                    }
                }
                else
                {
                    var i = db.FoodTable.Where(m => m.TableName.Equals(result));
                    if (i.Count() > 0)
                    {
                        MessageBox.Show("更改成功");
                        WelCome.HideInputPanel();
                        fl = false;
                    }
                    else
                    {
                        CommonInfo.FrmMessageBox fm = new CommonInfo.FrmMessageBox("不存在该餐桌", "管理员提示:", MessageBoxStyle.question);
                        fm.ShowDialog();
                    }
                }
            }
            WriteStart(result);
        }
Ejemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            CommonInfo.FrmMessageBox frm = new FrmMessageBox("是否选择共用模式", "模式选择", MessageBoxStyle.question);
            DialogResult             A   = frm.ShowDialog();

            if (A == DialogResult.Cancel)
            {
                buttonX1.Show();
                if (!File.Exists("Table.txt"))
                {
                    WelCome.HideInputPanel();
                    WelCome.ShowInputPanel();
                    string result;// = Microsoft.VisualBasic.Interaction.InputBox("请输入餐桌号", "锁定餐桌", "", this.Left, this.Top);
                    // WriteStart(result);
                    Boolean fl = true;
                    while (fl)
                    {
                        result = Microsoft.VisualBasic.Interaction.InputBox("请输入餐桌号", "锁定餐桌", "", this.Left, this.Top);
                        if (string.IsNullOrEmpty(result))
                        {
                            var B = MessageBox.Show("请重新输入,不可为空值", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                            if (DialogResult.No == B)
                            {
                                fl = false;
                            }
                        }
                        else
                        {
                            var i = mDF.FoodTable.Where(m => m.TableName.Equals(result));
                            if (i.Count() > 0)
                            {
                                CommonInfo.FrmMessageBox fm = new CommonInfo.FrmMessageBox("添加成功", "管理员提示:", MessageBoxStyle.right);
                                fm.ShowDialog();
                                WriteStart(result);
                                WelCome.HideInputPanel();
                                fl = false;
                            }
                            else
                            {
                                CommonInfo.FrmMessageBox fm = new CommonInfo.FrmMessageBox("不存在该餐桌", "管理员提示:", MessageBoxStyle.question);
                                fm.ShowDialog();
                            }
                        }
                    }
                }
                List <String> Ro = new List <string>(File.ReadAllLines("Table.txt", Encoding.UTF8));
                tablenum = Ro[0];
                if (string.IsNullOrEmpty(tablenum))
                {
                    CommonInfo.FrmMessageBox fm = new CommonInfo.FrmMessageBox("餐桌绑定失败", "管理员提示:", MessageBoxStyle.right);
                    fm.ShowDialog();
                }
            }
            else
            {
                buttonX1.Hide();
            }
            textBox2.Hide();
            button7.Hide();
            comboBox1.DataSource    = mDF.FoodType.ToList();
            comboBox1.DisplayMember = "FoodTypeName";
            //comboBox1.ValueMember = "FoodTypeID";
            shopCars.Add(shopCar1);
            shopCars.Add(shopCar2);
            shopCars.Add(shopCar3);
            shopCars.Add(shopCar4);
            shopCars.Add(shopCar5);
            shopCars.Add(shopCar6);
            shopCars.Add(shopCar7);
            shopCars.Add(shopCar8);
            Load_FoodList();
        }