public ActionResult VerDatos(int id)
        {
            Conductores conductores = new Conductores();
            Conductor   obj         = conductores.getConductor(id);
            var         model       = obj;

            return(View(obj));
        }
        public ActionResult Editar(int id)
        {
            Conductores conductores = new Conductores();
            Conductor   obj         = conductores.getConductor(id);
            var         modek       = obj;

            return(View(obj));
        }
Beispiel #3
0
 public void nuevoVehiculo(string Matricula, string Marca, string Modelo, string DniConductorHabitual)
 {
     try
     {
         Conductor c = conductores.getConductor(DniConductorHabitual);
         if (c == null)
         {
             throw new Exception("No existe el conductor;");
         }
         if (c.vehiculos >= 10)
         {
             throw new Exception("El conductor es habitual de mas de 10 vehiculos");
         }
         vehiculos.NuevoVehiculo(Matricula, Marca, Modelo, DniConductorHabitual);
         c.vehiculos = c.vehiculos + 1;
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }