/// <summary>
        /// 单击选项卡事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();

            if (this.tabControl1.SelectedIndex == 1)
            {
                List <Order> orderlist = orderBusinessLogic.GetOrderByStatus("未提交");
                this.dgvOrder.DataSource = orderlist;
            }
            else
            if (this.tabControl1.SelectedIndex == 2)
            {
                List <Order> submitOrderlist = orderBusinessLogic.GetOrderByStatus("未审核");
                this.dgvSubmitOrder.DataSource = submitOrderlist;
            }
            else
            if (this.tabControl1.SelectedIndex == 3)
            {
                List <Order> passOrderlist = orderBusinessLogic.GetOrderByStatus("审核通过");
                this.dgvPassOrder.DataSource = passOrderlist;
            }
            else
            if (this.tabControl1.SelectedIndex == 4)
            {
                List <Order> noPassOrderlist = orderBusinessLogic.GetOrderByStatus("不通过");
                this.dgvNoPassOrder.DataSource = noPassOrderlist;
            }
        }
        /// <summary>
        /// 单击操作列触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvOrder_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();

            //单击编辑执行的操作
            if (e.ColumnIndex == 0 && e.RowIndex != -1)
            {
                string        orderID       = this.dgvOrder.Rows[e.RowIndex].Cells[3].Value.ToString();
                OrderEditForm orderEditForm = new OrderEditForm(orderID, user);
                orderEditForm.ShowDialog();
                this.dgvOrder.DataSource = orderBusinessLogic.GetOrderByStatus("未提交");
            }
            //单击删除执行的操作
            if (e.ColumnIndex == 1 && e.RowIndex != -1)
            {
                DialogResult result = MessageBox.Show("确定删除此订单?", "提示", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    string orderID = this.dgvOrder.Rows[e.RowIndex].Cells[3].Value.ToString();
                    orderBusinessLogic.DeleteOrderById(orderID);//删除已经做级联
                    MessageBox.Show("删除成功!");
                    this.dgvOrder.DataSource = orderBusinessLogic.GetOrderByStatus("未提交");
                }
                else
                {
                    MessageBox.Show("删除取消!");
                }
            }
            //单击提交执行的操作
            if (e.ColumnIndex == 2 && e.RowIndex != -1)
            {
                //OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();
                DialogResult result = MessageBox.Show("确定提交此订单?", "提示", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    string orderID = this.dgvOrder.Rows[e.RowIndex].Cells[3].Value.ToString();
                    Order  order   = orderBusinessLogic.GetOrderByID(orderID);
                    order.Status    = "未审核";
                    order.InputDate = System.DateTime.Now;
                    orderBusinessLogic.UpdataOrder(order);
                    MessageBox.Show("提交成功!");
                    this.dgvOrder.DataSource = orderBusinessLogic.GetOrderByStatus("未提交");
                }
                else
                {
                    MessageBox.Show("提交取消!");
                }
            }
        }
        public void loadOrderList()
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();
            List <Order>       orderlist          = orderBusinessLogic.GetOrderByStatus("已发送");

            dataGridView1.DataSource = orderlist;
        }
        //加载订单数据
        public void loadMenu()
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();
            List <Order>       orderlist          = orderBusinessLogic.GetOrderByStatus("未提交");

            dgvOrder.DataSource = orderlist;
            List <Order> submitOrderlist = orderBusinessLogic.GetOrderByStatus("未审核");

            dgvSubmitOrder.DataSource = submitOrderlist;
            List <Order> passOrderlist = orderBusinessLogic.GetOrderByStatus("审核通过");

            dgvPassOrder.DataSource = passOrderlist;
            List <Order> noPassOrderlist = orderBusinessLogic.GetOrderByStatus("不通过");

            this.dgvNoPassOrder.DataSource = noPassOrderlist;
            List <Model.Menu> menuList = menuBusinessLogic.GetAllMenu();

            dgvMenu.DataSource = menuList;
        }
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();

            //ColumnIndex == 0是验收一列
            if (e.ColumnIndex == 0 && e.RowIndex != -1)
            {
                string    orderID   = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();//id在cells[1]这一列
                CheckFrom checkForm = new CheckFrom(orderID, user);
                checkForm.ShowDialog();
                this.dataGridView1.DataSource = orderBusinessLogic.GetOrderByStatus("已发送");
            }
        }