Beispiel #1
0
        public static BookingRoomService BookingRoomService(System.Data.IDataReader reader)
        {
            BookingRoomService result = null;

            if (null != reader && reader.Read())
            {
                result = new BookingRoomService();
                PopulateBookingRoomService(result, reader);
            }

            return result;
        }
 void btnInsertBookingService_Click(object sender, RoutedEventArgs e)
 {
     RoomService service = uiServiceList.SelectedItem as RoomService;
     if (service != null && _selectedBookingId > 0)
     {
         List<BookingRoomService> list = (List<BookingRoomService>)gvwBookingService.ItemsSource;
         if (list.Count(i => i.ServiceId == service.ServiceId) > 0)
         {
             MessageBox.Show(ResourceHelper.GetReourceValue("Common_ItemExist"));
         }
         else
         {
             BookingRoomService newBookingService = new BookingRoomService();
             newBookingService.BookingId = _selectedBookingId;
             newBookingService.ServiceId = service.ServiceId;
             newBookingService.Service = service.Service;
             newBookingService.IsChanged = true;
             newBookingService.Price = service.Price;
             newBookingService.Unit = service.Unit;
             newBookingService.Description = service.Description;
             list.Add(newBookingService);
             gvwBookingService.ItemsSource = null;
             gvwBookingService.ItemsSource = list;
         }
     }
 }
Beispiel #3
0
 public static void PopulateBookingRoomService(BookingRoomService input, System.Data.IDataReader reader)
 {
     PopulateRecord(input, reader);
     input.RecordId = input.BookingRoomServiceId = Utilities.ToInt(reader[Mimosa.Apartment.Common.BookingRoomService.ColumnNames.BookingRoomServiceId]);
     input.BookingId = Utilities.ToInt(reader[Mimosa.Apartment.Common.BookingRoomService.ColumnNames.BookingId]);
     input.ServiceId = Utilities.ToInt(reader[Mimosa.Apartment.Common.BookingRoomService.ColumnNames.ServiceId]);
     input.Service = Utilities.ToString(reader[Mimosa.Apartment.Common.BookingRoomService.ColumnNames.Service]);
     input.Price = Utilities.ToNDecimal(reader[Mimosa.Apartment.Common.BookingRoomService.ColumnNames.Price]);
     input.Description = Utilities.ToString(reader[Mimosa.Apartment.Common.BookingRoomService.ColumnNames.Description]);
     input.Unit = Utilities.ToString(reader[Mimosa.Apartment.Common.BookingRoomEquipment.ColumnNames.Unit]);
     input.CanDelete = Utilities.ToBool(reader["CanDelete"]);
 }
 void ListBookingRoomServiceCompleted(List<BookingRoomService> Services)
 {
     if (Services != null && Services.Count > 0)
     {
         _bookingRoomServiceItem = Services[0];
         DataServiceHelper.ListBookingRoomServiceDetailAsync(null, this.BookingServiceId, null, null, null, ListBookingRoomServiceDetailCompleted);
     }
 }