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("开单失败");
            }
        }
 /// <summary>
 /// 添加一个中间表的数据
 /// </summary>
 /// <param name="rod"></param>
 /// <returns></returns>
 public int AddROrderDesk(R_Order_Desk rod)
 {
     string sql = "insert into R_Order_Desk (OrderId,DeskId) values(@OrderId,@DeskId)";
     return SqliteHelper.ExecuteNonQuery(sql, new SQLiteParameter("@OrderId", rod.OrderId), new SQLiteParameter("@DeskId", rod.DeskId));
 }
 /// <summary>
 /// 添加一个中间表的数据
 /// </summary>
 /// <param name="rod"></param>
 /// <returns></returns>
 /// 
 public bool AddROrderDesk(R_Order_Desk rod)
 {
     return dal.AddROrderDesk(rod) > 0;
 }