internal static Group createGroupFromDALGroup(CarpoolingDAL.Group g)
        {
            Group ng = new Group();

            ng.Id        = g.idGroup;
            ng.Name      = g.name;
            ng.StartTime = g.startTime;
            ng.TotalCost = g.totalCost;
            ng.Type      = createGroupTypeFromDALGType(g.GroupType1);

            Repository.RouteRepository rr = Repository.RouteRepository.getInstanca();
            ng.Route = rr.getRouteById(g.route);

            ng.DestinationRange = new Range(g.destinationRange);
            ng.StartRange       = new Range(g.startRange);

            foreach (CarpoolingDAL.GroupMember item in g.GroupMembers)
            {
                ng.addGroupMember(createGroupMemberFromDALGroupMember(item));
            }
            Repository.MessageRepository mr = MessageRepository.getInstanca();
            foreach (CarpoolingDAL.LeaveAMessage item in g.LeaveAMessages)
            {
                ng.addMessage(createMessageFromDALMessage(mr.getMessageById(item.idMessage), ng.getGroupMemberById(item.client)));
            }
            return(ng);
        }
 internal static CarpoolingDAL.Group createDALGroupFromGroup(Group group)
 {
     CarpoolingDAL.Group ng = new CarpoolingDAL.Group();
     ng.destinationRange = group.DestinationRange.RangeDim;
     ng.groupType        = group.Type.Id;
     ng.name             = group.Name;
     ng.route            = group.Route.Id;
     ng.startRange       = group.StartRange.RangeDim;
     ng.startTime        = group.StartTime;
     ng.totalCost        = group.TotalCost;
     return(ng);
 }
 internal static CarpoolingDAL.Group createDALGroupFromGroup(Group group)
 {
     CarpoolingDAL.Group ng = new CarpoolingDAL.Group();
     ng.destinationRange = group.DestinationRange.RangeDim;
     ng.groupType = group.Type.Id;
     ng.name = group.Name;
     ng.route = group.Route.Id;
     ng.startRange = group.StartRange.RangeDim;
     ng.startTime = group.StartTime;
     ng.totalCost = group.TotalCost;
     return ng;
 }