public void SetText(object sender, EventArgs e) { //餐桌编号 var mea = e as MyEventArgs; var dk = mea.Obj as DeskInfo; labDeskName.Text = dk.DeskName; _dkId = dk.DeskId; //订单号 -> 根据DeskId查询OrderId var orderBLL = new OrderInfoBLL(); var orderId = orderBLL.GetOrderIdByDeskId(dk.DeskId); labOrderId.Text = orderId.ToString(); //消费总金额 -> 通过OrderId查询 var money = orderBLL.GetMoneyByOrderId(orderId); if (money != -1) { labMoney.Text = money.ToString(); lblMoney.Text = money.ToString(); } else { MessageBox.Show("查询订单消费失败"); } }
private FrmGuestPay(int orderId, string deskName, int deskId) { InitializeComponent(); labDeskName.Text = deskName; labOrderId.Text = orderId.ToString(); labdkId.Text = deskId.ToString(); OrderInfoBLL obll = new OrderInfoBLL(); object objMoney = obll.GetMoneyByOrderId(orderId); labMoney.Text = objMoney.ToString(); //显示消费金额 lblMoney.Text = objMoney.ToString(); //结账金额 }