private void Button_Click(object sender, RoutedEventArgs e) { CheckInBill checkInBill = new CheckInBill(); checkInBill.Id = Guid.NewGuid(); checkInBill.BillNumber = BillNumber; checkInBill.RoomNumber = MainWondows.SelectRoomNumber; checkInBill.GuestName = GuestName; checkInBill.NumberOfPeaple =Convert .ToString ( AddGuestToRoom.NumberOfPeaple); checkInBill.RoomRate = MainWondows.RoomRate; if (Convert .ToDecimal ( tbAmountPaid.Text)>=MainWondows.RoomRate) { checkInBill.AmountPaid =Convert .ToDecimal ( tbAmountPaid.Text); checkInBill.WaiterName = WaiterName; checkInBill.Date = System.DateTime.Now; AddCheckInBillBLL.addCheckInBill(checkInBill); tbAmountPaid.Text = ""; UpdateRoomBLL.updateRoomIsFull(checkInBill.RoomNumber); windowRefresh(sender ,e); addCheckInBill.Close(); AddGuestToRoom.NumberOfPeaple = 0; } else { lbNews.Content = "请输入一个大于或等于房价的金额!"; } }
public static void addCheckInBill(CheckInBill checkInBill) { SqlParameter[] pams = new SqlParameter[] { new SqlParameter ("@Id",checkInBill.Id ), new SqlParameter ("@BillNumber",checkInBill.BillNumber), new SqlParameter ("@RoomNumber",checkInBill.RoomNumber ), new SqlParameter ("@GuestName",checkInBill.GuestName ), new SqlParameter ("@NumberOfPeaple",checkInBill.NumberOfPeaple ), new SqlParameter ("@RoomRate",checkInBill.RoomRate ), new SqlParameter ("@AmountPaid",checkInBill.AmountPaid ), new SqlParameter ("@Date",checkInBill.Date ), new SqlParameter ("@WaiterName",checkInBill.WaiterName ), }; SqlHelper.ExecuteNonQuery(AddCheckInBillDAL.sql, pams); }
public static void addCheckInBill(CheckInBill checkInBill) { AddCheckInBillDAL.addCheckInBill(checkInBill); }