//Metodo verifica que los datos esten correctos para luego //pasarcelos al dal public void borrarRepuestoMarca(ENT.MarcaVehiculo marca) { DAL.Repuesto DalRepesto = new DAL.Repuesto(); try { if (marca.Id <= 0) { throw new Exception("Debes seleccionar una marca a eliminar"); } DalRepesto.borrarRepuestoMarca(marca); if (DalRepesto.Error) { throw new Exception("Error al eliminar la marca del repuesto " + DalRepesto.ErrorMsg); } } catch (Exception ex) { throw ex; } }
//Metodo valida los datos que ingresan por parametos, que esten //correctos para pasarlos al DAL public void agregarRepuestoMarca(ENT.MarcaVehiculo marca, ENT.RepuestoVehiculo repuesto) { DAL.Repuesto DalRepesto = new DAL.Repuesto(); try { if (marca.Id <= 0) { throw new Exception("Debes seleccionar una marca"); } if (repuesto.Id <= 0) { throw new Exception("Debes seleccionar un repuesto"); } DalRepesto.agregarMarcasRepuesto(marca, repuesto); if (DalRepesto.Error) { throw new Exception("Error al agregar la marca a este repuesto " + DalRepesto.ErrorMsg); } } catch (Exception ex) { throw ex; } }