Пример #1
0
        public CilindroBE ConsultarCilindro(string cilindro)
        {
            CilindroDL cil = new CilindroDL();
            CilindroBE resp = new CilindroBE();
            try
            {
                resp = cil.ConsultarCilindro(cilindro);
                if(resp.Tipo_Ubicacion.Nombre_Ubicacion=="VEHICULO")
                {
                    VehiculoDL veh = new VehiculoDL();
                    VehiculoBE datVeh = new VehiculoBE();
                    string var = Convert.ToString(resp.Tipo_Ubicacion.Ubicacion.Id_Ubicacion);
                    datVeh = veh.ConsultaPlacaPorUbicacion(var);
                    resp.Vehiculo = datVeh;
                }
                if (resp.Tipo_Ubicacion.Nombre_Ubicacion == "CLIENTE")
                {
                    ClienteDL cli = new ClienteDL();
                    UbicacionBE datCli = new UbicacionBE();
                    string idUbica = resp.Tipo_Ubicacion.Ubicacion.Id_Ubicacion;
                    datCli = cli.ConsultarDirClientePorUbicacion(idUbica);
                    resp.Ubicacion= datCli;
                    string idCliente = resp.Ubicacion.Cliente.Id_Cliente;
                    resp.Cliente = cli.ConsultarCliente(idCliente);
                }
            }
            catch (Exception ex)
            {

            }

            return resp;
        }
Пример #2
0
        public List<Ubicacion_CilindroBE> ConsultarCilPorVehiculo(string idVehiculo)
        {
            List<Ubicacion_CilindroBE> lstResp = new List<Ubicacion_CilindroBE>();

            VehiculoDL veh = new VehiculoDL();
            try
            {
                lstResp = veh.ConsultarCilPorVehiculo(idVehiculo);
            }
            catch (Exception ex)
            {

            }

            return lstResp;
        }
Пример #3
0
        /// <summary>
        /// Método para la consulta de existencia de vehículos en el sistema 
        /// </summary>
        /// <param name="consultar_existencia"></param>
        /// <returns></returns>
        public long ConsultaExistenciaVehiculo(string vehiculo)
        {
            VehiculoDL veh = new VehiculoDL();
            long resp = 0;
            try
            {
                resp = veh.ConsultaExistenciaVehiculo(vehiculo);
            }
            catch (Exception ex)
            {
                //guardar exepcion en el log de bd
                resp = -1;
            }

            return resp;
        }
Пример #4
0
        public long ConsultaExistenciaContratista(string cedula)
        {
            VehiculoDL veh = new VehiculoDL();
            long resp = 0;
            try
            {
                resp = veh.ConsultaExistenciaContratistas(cedula);
            }
            catch (Exception ex)
            {
                //guardar exepcion en el log de bd
                resp = -1;
            }

            return resp;
        }
Пример #5
0
        public long RegistrarContratista(ContratistaBE contratista)
        {
            VehiculoDL veh = new VehiculoDL();

            long resp = 0;
            try
            {
                resp = veh.RegistrarContratista(contratista);
            }
            catch (Exception ex)
            {
                //guardar exepcion en el log de bd
                resp = -1;
            }

            return resp;
        }
Пример #6
0
        /// <summary>
        /// Método para la modificación de vehículos en el sistema
        /// </summary>
        /// <param name="modificar_vehiculo"></param>
        /// <returns>codigo</returns>
        public long ModificarVehiculo(VehiculoBE modificar_vehiculo)
        {
            VehiculoDL veh = new VehiculoDL();
            long resp = 0;
            try
            {
                if (modificar_vehiculo.Estado == "Activo")
                {
                    modificar_vehiculo.Estado = "1";
                }
                else
                {
                    modificar_vehiculo.Estado = "0";
                }
                resp = veh.ModificarVehiculo(modificar_vehiculo);
            }
            catch (Exception ex)
            {

            }
            return resp;
        }
Пример #7
0
        /// <summary>
        /// Método para el registro de vehículos en el sistema
        /// </summary>
        /// <param name="registrar_vehiculo"></param>
        /// <returns></returns>
        public long CrearVehiculo(VehiculoBE vehiculo)
        {
            VehiculoDL veh = new VehiculoDL();
            long resp =0;
            try
            {
                if (vehiculo.Estado == "Activo")
                {
                    vehiculo.Estado = "1";
                }
                else
                {
                    vehiculo.Estado = "0";
                }
                resp = veh.CrearVehiculo(vehiculo);
            }
            catch (Exception ex)
            {

            }
            return resp;
        }
Пример #8
0
        /// <summary>
        /// Método para la consulta de vehículos en el sistema y muestra de información
        /// </summary>
        /// <param name="consultar_vehiculo"></param>
        /// <returns></returns>
        public List<VehiculoBE> ConsultarVehiculo(string placa)
        {
            VehiculoDL veh = new VehiculoDL();
            List<VehiculoBE> vehiculo = new List<VehiculoBE>();
            try
            {
                if (placa == "")
                {
                    placa = "0";
                }

                vehiculo = veh.ConsultarVehiculo(placa);
                foreach (VehiculoBE datos in vehiculo)
                {
                    if (datos.Estado == "1")
                    {
                        datos.Estado = "Activo";
                    }
                    else
                        datos.Estado = "Inactivo";
                }

            }
            catch (Exception ex)
            {

            }
            return vehiculo;
        }
Пример #9
0
        public ContratistaBE ConsultarPropVehiculo(string cedula)
        {
            VehiculoDL veh = new VehiculoDL();
            ContratistaBE cont = new ContratistaBE();
            try
            {
                cont = veh.ConsultarPropVehiculo(cedula);
            }
            catch (Exception ex)
            {

            }
            return cont;
        }
Пример #10
0
        /// <summary>
        /// Método para la consulta de conductores en el sistema
        /// </summary>
        /// <param name="cedula"></param>
        /// <returns></returns>
        public ConductorBE ConsultarConductor(string cedula)
        {
            VehiculoDL veh = new VehiculoDL();
            ConductorBE cond = new ConductorBE();
            try
            {
                cond = veh.ConsultarConductor(cedula);
            }
            catch (Exception ex)
            {

            }
            return cond;
        }
Пример #11
0
        public List<Ubicacion_CilindroBE> HistoricoCilindro(string codigo)
        {
            List<Ubicacion_CilindroBE> lstResp = new List<Ubicacion_CilindroBE>();
            VehiculoBE veh = new VehiculoBE();
            ReporteDL rep = new ReporteDL();
            VehiculoDL vehDL = new VehiculoDL();
            UbicacionBE ubi = new UbicacionBE();
            ClienteDL cliDL = new ClienteDL();
            try
            {
                lstResp = rep.ConsultarHistoricoCilindro(codigo);
                foreach(Ubicacion_CilindroBE datos in lstResp)
                {
                if(datos.Nombre_Ubicacion=="VEHICULO")
                {
                    veh = vehDL.ConsultaPlacaPorUbicacion(datos.Id_Ubicacion_Cilindro);
                    ubi.Vehiculo = veh;
                    datos.Ubicacion = ubi;
                }
                if (datos.Nombre_Ubicacion == "CLIENTE")
                {
                    ubi = cliDL.ConsultarDirClientePorUbicacion(datos.Id_Ubicacion_Cilindro);
                    datos.Ubicacion = ubi;
                }
                }
            }
            catch (Exception ex)
            {

            }

            return lstResp;
        }