// --------------------------------------------------------------------- /// <summary> /// /// </summary> /// <param name="r"></param> /// <returns></returns> public static DTOReservable BuildReservableDTO(Table r, Terminal t) { DTOReservable reservableDTO = new DTOReservable(); if (r != null) { reservableDTO.Id = r.Id; reservableDTO.Name = r.Name; reservableDTO.MaxGuests = r.MaxGuests; // create a 'shallow' dto location DTOLocation pl = new DTOLocation(); pl.Id = r.ParentLocation.Id; pl.Name = r.ParentLocation.Name; reservableDTO.ParentLocation = pl; // send back the current interest level if (r.Id != 0) { reservableDTO.CurrentInterestLevel = ReservationsService.GetTableInterestLevel(r.Id); } // table plan data reservableDTO.X = r.X; reservableDTO.Y = r.Y; reservableDTO.Width = r.Width; reservableDTO.Height = r.Height; reservableDTO.RotationAngle = r.RotationAngle; reservableDTO.Shape = r.Shape; reservableDTO.TableColor = r.Status(t); reservableDTO.Number = r.Number; } return(reservableDTO); }