Example #1
0
        public long AddRentalGroup(RentalGroup_Representation rentalGroup)
        {
            using (ISQLConnection dataSource = DataSource)
            {
                RentalGroups rentalGroupToAdd = RepresentationConverter.convertRentalGroup(rentalGroup);
                //foreach (RentalRepresentation rental in rentalGroup.rentals)
                //{
                //rentalGroupToAdd.Rentals.Add(RepresentationConverter.convertRental(rental));
                //dataSource.UpdateTool(RepresentationConverter.convertTool(rental.tool));
                //dataSource.UpdateCustomer(RepresentationConverter.convertCustomer(rental.customer));
                //}
                rentalGroup.id = dataSource.AddRentalGroup(rentalGroupToAdd);

                //foreach (RentalRepresentation rental in rentalGroup.rentals)
                //{
                //    rental.group = rentalGroup;
                //    AddRental(rental);
                //}

                return(rentalGroup.id);
            }
        }