tablestate_form.cs

来自「饮食管理系统」· CS 代码 · 共 103 行

CS
103
字号
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 + =
减小字号Ctrl + -
显示快捷键?