Exemplo n.º 1
0
 public void UpdateRentalGroup(RentalGroup_Representation rentalGroup)
 {
     using (ISQLConnection dataSource = DataSource)
     {
         dataSource.UpdateRentalGroup(RepresentationConverter.convertRentalGroup(rentalGroup));
     }
 }
Exemplo n.º 2
0
 public RentalGroup_Representation GetRentalGroupById(long id)
 {
     using (ISQLConnection dataSource = DataSource)
     {
         return(RepresentationConverter.convertRentalGroup(dataSource.GetRentalGroupById(id)));
     }
 }
Exemplo n.º 3
0
        public List <RentalGroup_Representation> GetAllRentalGroups()
        {
            using (ISQLConnection dataSource = DataSource)
            {
                List <RentalGroup_Representation> rtn = new List <RentalGroup_Representation>();
                dataSource.GetAllRentalGroups().ForEach(rg => rtn.Add(RepresentationConverter.convertRentalGroup(rg)));

                return(rtn);
            }
        }
Exemplo n.º 4
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);
            }
        }