private void btnOK_Click(object sender, EventArgs e)
        {
            //change desk state
            DeskInfoBLL dkBll = new DeskInfoBLL();
            bool dkFlag = dkBll.UpdateDeskStateByDeskId(this.ID, 1);
            //add an order
            OrderInfoBLL orBll = new OrderInfoBLL();
            OrderInfo or = new OrderInfo();
            or.SubTime = System.DateTime.Now;
            or.OrderMoney = 0;
            or.DelFlag = 0;
            or.OrderState = 1;
            or.Remark = txtPersonCount.Text + txtDescription.Text;
            or.SubBy = 1;
            int orderId = orBll.AddOrderInfo(or);

            //add R_Order_Desk
            R_Order_DeskBLL rodBll = new R_Order_DeskBLL();
            R_Order_Desk rod = new R_Order_Desk();
            rod.DeskId = this.ID;
            rod.OrderId = orderId;
            bool rodFlag = rodBll.AddROrderDesk(rod);

            if(dkFlag && rodFlag)
            {
                MessageBox.Show("开单成功");
                if(ckbMeal.Checked)
                {
                    MyEventArgs mea = new MyEventArgs();
                    //deskName
                    mea.Name = labDeskName.Text;
                    //Order Id
                    mea.Temp = orderId;
                    FrmAddMoney fam = new FrmAddMoney();
                    this.evtFrmMoney += new EventHandler(fam.SetText);
                    if(this.evtFrmMoney != null)
                    {
                        this.evtFrmMoney(this, mea);
                        fam.FormClosed += new FormClosedEventHandler(fam_FormClosed);
                        fam.ShowDialog();
                    }
                }
            }
            else
            {
                MessageBox.Show("开单失败");
            }
        }
 //Pay the bill
 private void btnAccounts_Click(object sender, EventArgs e)
 {
     MemberInfo mem = cmbMemmber.SelectedItem as MemberInfo;
     if(string.IsNullOrEmpty(txtMoney.Text))
     {
         MessageBox.Show("请输入钱");
         return;
     }
     if(Convert.ToDecimal(txtMoney.Text) < Convert.ToDecimal(lblMoney.Text))
     {
         MessageBox.Show("就这点钱? 搞笑呢");
         return;
     }
     OrderInfo order = new OrderInfo();
     //deskState in DeskInfo table
     DeskInfoBLL bll = new DeskInfoBLL();
     bool deskFlag = bll.UpdateDeskStateByDeskId(this.deskId, 0);
     //non-member
     if(cmbMemmber.SelectedIndex != 0)
     {
         order.OrderMemId = mem.MemmberId;
         order.DisCount = Convert.ToDecimal(mem.MemDiscount);
         //after pay in member money
         decimal money = mem.MemMoney - Convert.ToDecimal(lblMoney.Text);
         MemberInfoBLL mbll = new MemberInfoBLL();
         //if(money < 0)
         //{
         
         //}
         //Member money in MemmberInfo table
         bool memFlag = mbll.UpdateMoneyByMemId(mem.MemmberId, money);
     }
     order.EndTime = System.DateTime.Now;
     order.OrderId = Convert.ToInt32(labOrderId.Text);
     order.OrderMoney = Convert.ToDecimal(lblMoney.Text);
     OrderInfoBLL obll = new OrderInfoBLL();
     bool orderFlag = obll.UpdateOrderInfoMoney(order);
     lblSpareMoney.Text = (Convert.ToDecimal(txtMoney.Text) - Convert.ToDecimal(lblMoney.Text)).ToString();
     if(deskFlag && orderFlag)
     {
         MessageBox.Show("结账成功");
     }
     else
     {
         MessageBox.Show("失败");
     }
 }