private void btnBalance_Click(object sender, EventArgs e) { if (txtReceipts.Text != "" && Convert.ToInt32(txtReceipts.Text) >= Convert.ToInt32(lblVIPPrice.Text)) { Room r = RoomService.SelectRoomByRoomNo(txtRoomNo.Text); //根据房间编号查询房间信息 string checktime = r.CheckTime.ToString(); //获取入住时间 if (SpendService.UpdateMoneyState(txtRoomNo.Text, checktime) > 0) { int n = RoomService.UpdateRoomByRoomNo(txtRoomNo.Text); if (n > 0) { this.Close(); } else { return; } MessageBox.Show("结算成功!", "系统提示"); } else { MessageBox.Show("结算失败!", "系统提示"); } } else { MessageBox.Show("输入金额有误,请重新输入!", "系统提示"); } }
/// <summary> /// 根据房间编号、入住时间和当前时间修改结算状态 /// </summary> /// <param name="roomno"></param> /// <param name="checktime"></param> /// <returns></returns> public static int UpdateMoneyState(string roomno, string checktime) { return(SpendService.UpdateMoneyState(roomno, checktime)); }