public void updateClient(Client client)
        {
            try {
                RouteRepository      rr     = RouteRepository.getInstanca();
                ResourceRepository   rer    = ResourceRepository.getInstanca();
                CarpoolingDAL.Client oldOne = db.Clients.Single(o => o.idClient == client.Id);
                oldOne.contactNumber = client.ContactNumber;
                oldOne.email         = client.Email;
                oldOne.name          = client.Name;
                oldOne.notes         = client.Notes;
                oldOne.password      = client.Password;
                oldOne.surname       = client.Surname;
                oldOne.username      = client.Username;
                foreach (Route item in client.getAllFirmRoutes())
                {
                    if (rr.existFirmRoute(item.Id, client.Id))
                    {
                        rr.updateRoute(item);
                    }
                    else
                    {
                        rr.addFirmRoute(item, client);
                    }
                }
                foreach (Resource item in client.getAllResources())
                {
                    if (rer.existResource(item.Id))
                    {
                        rer.updateResource(item);
                    }
                    else
                    {
                        rer.addResource(item, client);
                    }
                }
                db.SubmitChanges();
            } catch (Exception) {
                //return false;
            }

            //return true;
        }