⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tablestate_form.cs

📁 饮食管理系统
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Entity;
using BusinessLayer;

namespace project_beat
{
    public partial class TableState_Form : Form
    {
        State s = new State();
        BLL_State bs = new BLL_State();
        tableState table = new tableState();
        BLL_tableState ts = new BLL_tableState();

        public TableState_Form(tableState ts)
        {
            
               
                InitializeComponent();
                this.table = ts;
                this.lblTableId.Text = ts.ID;
                s.StateID = ts.State;
                this.lblTalestate.Text = bs.SelectStateById(s);
          }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
             if (table.State != 1)
            {
            table.State = 0;
            int i=ts.UpdateTableStateByState(table);
            if (i == 1)
                MessageBox.Show("修改成功!","提示");
            this.Close();
        }
        else
            MessageBox.Show("没有可寄托的主单,不能改变基状态!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
      

        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
              if (table.State != 1)
            {
            table.State = 3;
            int i = ts.UpdateTableStateByState(table);
            if (i == 1)
                MessageBox.Show("修改成功!", "提示");
            else
                MessageBox.Show("修改失败","提示");
            this.Close();
             }
            else
            MessageBox.Show("没有可寄托的主单,不能改变基状态!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
      
        }

        private void pictureBox3_Click(object sender, EventArgs e)
        {
            if (table.State != 1)
            {
            table.State = 2;            
            int i = ts.UpdateTableStateByState(table);
            if (i == 1)
                MessageBox.Show("修改成功!", "提示");
            else
                MessageBox.Show("修改失败", "提示");
            this.Close();
           }
            else
            MessageBox.Show("没有可寄托的主单,不能改变基状态!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
      
        }

        private void pictureBox4_Click(object sender, EventArgs e)
        {
            if (table.State != 1)
            {
            table.State = 4;           
            int i = ts.UpdateTableStateByState(table);
            if (i == 1)
                MessageBox.Show("修改成功!", "提示");
            else
                MessageBox.Show("修改失败", "提示");
            this.Close();
            }
            else
            MessageBox.Show("没有可寄托的主单,不能改变基状态!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
      
        }

        private void TableState_Form_Load(object sender, EventArgs e)
        {

        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -