public Vehiculo ModificarVehiculo(int ID_VEHICULO, string PLACA, string MODELO, string MARCA, string ANNIO_FABRICACION, string NRO_UNIDAD, int id_empresa)
        {
            Vehiculo vehiculoaAModificar = new Vehiculo()

            {
                ID_VEHICULO       = ID_VEHICULO,
                PLACA             = PLACA,
                MODELO            = MODELO,
                MARCA             = MARCA,
                ANNIO_FABRICACION = ANNIO_FABRICACION,
                NRO_UNIDAD        = NRO_UNIDAD,
                ID_EMPRESA        = id_empresa,
            };

            return(VehiculoDAO.Modificar(vehiculoaAModificar));
        }
        public Vehiculo EliminarVehiculo(int ID_VEHICULO, string PLACA, string MODELO, string MARCA, string ANNIO_FABRICACION, string NRO_UNIDAD, int id_empresa, int FLAG_ANULA)
        {
            Vehiculo vehiculoaAEliminar = new Vehiculo()
            {
                ID_VEHICULO       = ID_VEHICULO,
                PLACA             = PLACA,
                MODELO            = MODELO,
                MARCA             = MARCA,
                ANNIO_FABRICACION = ANNIO_FABRICACION,
                NRO_UNIDAD        = NRO_UNIDAD,
                ID_EMPRESA        = id_empresa,
                FLAG_ANULA        = FLAG_ANULA,
            };

            //return VehiculoDAO.Eliminar(vehiculoaAEliminar);
            return(VehiculoDAO.Modificar(vehiculoaAEliminar));
        }
示例#3
0
        public VehiculoEN ModificarVehiculo(VehiculoEN vehiculoModificar)
        {
            VehiculoEN vehiculoExistente = VehiculoDAO.Obtener(vehiculoModificar.Codigo);
            bool       bPlacaExistente   = false;

            if (vehiculoExistente.Placa != vehiculoModificar.Placa)
            {
                bPlacaExistente = VehiculoDAO.ValidarPlacaExistente(vehiculoModificar.Placa);
                if (bPlacaExistente)
                {
                    throw new FaultException <RepetidoException>(new RepetidoException()
                    {
                        Codigo  = 1,
                        Mensaje = "La placa ya ha sido registrada"
                    },
                                                                 new FaultReason("Validación de negocio"));
                }
            }

            return(VehiculoDAO.Modificar(vehiculoModificar));
        }