Пример #1
0
        public static int guardarParte(ParteProveedor oParteProveedor)
        {
            int noSeq = 0;

            try
            {
                SqlCommand oCommand = new SqlCommand("sp_GuardarParte");
                oCommand.CommandType = CommandType.StoredProcedure;

                oCommand.Parameters.AddWithValue("@noSeq", oParteProveedor.noSeq);
                oCommand.Parameters.AddWithValue("@idParte", oParteProveedor.idParte);
                oCommand.Parameters.AddWithValue("@idCategoriaParte", oParteProveedor.idCategoriaParte);
                oCommand.Parameters.AddWithValue("@descripcion", oParteProveedor.descripcion);
                oCommand.Parameters.AddWithValue("@idProveedor", oParteProveedor.idProveedor);
                oCommand.Parameters.AddWithValue("@idProvincia", oParteProveedor.idProvincia);
                oCommand.Parameters.AddWithValue("@idCanton", oParteProveedor.idCanton);
                oCommand.Parameters.AddWithValue("@codProveedor", oParteProveedor.codProveedor);
                oCommand.Parameters.AddWithValue("@estado", oParteProveedor.estado);
                oCommand.Parameters.AddWithValue("@clasificacion", oParteProveedor.clasificacion);
                oCommand.Parameters.AddWithValue("@precio", oParteProveedor.precio);
                oCommand.Parameters.AddWithValue("@envio", oParteProveedor.envio);
                oCommand.Parameters.AddWithValue("@costoEnvio", oParteProveedor.costoEnvio);
                oCommand.Parameters.AddWithValue("@Imagen", oParteProveedor.imagen);
                //TODO: Agregar Vehiculos e Imagenes
                noSeq = Convert.ToInt32(ConexionDAO.getInstance().EjecutarSQLScalar(oCommand));
                return(noSeq);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        public static DataTable obtenerParteTabla(int idProveedor)
        {
            string oSql = "select v.noSeq,categoria,v.descripcion as parte, descripcion,i.Clasificacion,v.precio from vw_VistaPartes v inner join vw_InfoParte i on v.noSeq = i.noSeq  where idProveedor = " + idProveedor;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #3
0
        public static DataTable obtenerCanton(int idProvincia)
        {
            string oSql = "select idCanton, canton from Canton where idProvincia = " + idProvincia;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #4
0
        public static DataTable obtenerVehiculoParte(int noSeq)
        {
            string oSql = "SELECT [Marca],[Modelo],[anno] FROM [vw_InfoParteVehiculo] where idParte = " + noSeq;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #5
0
        public static DataTable ListaProveedores(int idProveedor)
        {
            string oSql = string.Format("Select idProveedor,tipoProveedor,cedula,descripcion,Canton,provincia,direccion,email,logo,telefonos from Vw_ListaProveedores where idProveedor={0}", idProveedor);

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #6
0
        public static DataTable obtenerParteImagen(int idParte)
        {
            string oSql = "SELECT [id],[rutaImagen] FROM [Imagenes] where idParte = " + idParte;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #7
0
        public static DataTable obtenerInfoUsuarioCoti(int idUsuario)
        {
            string oSql = "select CONCAT(Nombre,' ',Apellido1,' ',Apellido2) as Nombre,correo,Telefono from Usuario where idUsuario = " + idUsuario;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #8
0
        public static DataTable obtenerModelo(int idMarca)
        {
            string oSql = "select idModelo,Modelo from ModeloVehiculo where idMarca = " + idMarca;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #9
0
        public static DataTable obtenerProveedor(int idProveedor)
        {
            string oSql = "SELECT [idProveedor],[tipoProveedor],[NombreProveedor],[cedula],[descripcion],[idProvincia],[idCanton],[direccion],[logo],[email] FROM [dbo].[Proveedor] where idProveedor = " + idProveedor;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #10
0
        public static string Top10()
        {
            string oSql = "Select * from Vw_Top10";

            try
            {
                return(ConexionDAO.getInstance().EjecutarSQLScalar(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #11
0
        public static DataTable obtenerMarca()
        {
            string oSql = "select idMarca,Marca from MarcaVehiculo";

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #12
0
        public static DataTable obtenerCategoria()
        {
            string oSql = "select idCategoriaParte,categoria from CategoriaParte";

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #13
0
        public static DataTable obtenerTelProveedor(int idProveedor)
        {
            string oSql = "select telefono from telefonoProveedor where idProveedor = " + idProveedor;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #14
0
        public static DataTable obtenetTipoTelefono()
        {
            string oSql = "select idTtipoTelefono,tipoTelefono from tipoTelefono";

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #15
0
        public static DataTable obtenerProvincia()
        {
            string oSql = "select idProvincia,provincia from provincia";

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #16
0
        public static DataTable obtenerParte()
        {
            string oSql = "SELECT [noSeq],[idParte],[descripcion],[categoria],[NombreProveedor] ,[provincia],[Canton],[precio],[imagen],anno,marca,Modelo FROM [dbo].[vw_VistaPartes]";

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #17
0
        public static DataTable obtenerParte(int noSeq)
        {
            string oSql = "SELECT [noSeq],[Parte],[Clasificacion],[precio],[provincia],[Canton],[idParte],[idProveedor] FROM [dbo].[vw_InfoParte] where noSeq = " + noSeq;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #18
0
        public static DataTable obtenerClasificacion()
        {
            string oSql = "select id,descripcion from Clasificacion";

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #19
0
        public static DataTable obtenerListaPartes()
        {
            string oSql = "select idParte,parte from listaParte";

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #20
0
        public static int actualizarImagenParte(int noSeq, string ruta)
        {
            string oSql = "update Parte set imagen = '" + ruta + "' where noSeq = " + noSeq;

            try
            {
                return(ConexionDAO.getInstance().EjecutarSqlActualizacion(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #21
0
        public static DataTable obtenerInfoProveedor(int idProveedor)
        {
            string oSql = "SELECT [NombreProveedor],[tipoProveedor],[provincia],[Canton],[direccion],[email] FROM [dbo].[vw_InfoProveedorParte] where idProveedor = " + idProveedor;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #22
0
        public static DataTable obtenerInfoCotizacion(int idCotizacion)
        {
            string oSql = "SELECT [idCotizacion],[descripcion],[Marca],[Modelo],[año],[otrosDatos],[idUsuario],[estado],[imagen] FROM vw_InfoCotizaciones where idCotizacion = " + idCotizacion;

            try
            {
                return(ConexionDAO.getInstance().EjecutarConsultaDataTable(oSql));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #23
0
        public static int guardarImagen(int idParte, int idProveedor, string rutaImagen, int id)
        {
            try
            {
                SqlCommand oCommand = new SqlCommand("sp_GuardarImagen");
                oCommand.CommandType = CommandType.StoredProcedure;

                oCommand.Parameters.AddWithValue("@idParte", idParte);
                oCommand.Parameters.AddWithValue("@idProveedor", idProveedor);
                oCommand.Parameters.AddWithValue("@rutaImagen", rutaImagen);
                oCommand.Parameters.AddWithValue("@id", id);

                return(ConexionDAO.getInstance().EjecutarSqlActualizacion(oCommand));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #24
0
        public static int guardarVehiculo(Vehiculo vehi, int noSeq, int idParte, int idCategoria)
        {
            try
            {
                SqlCommand oCommand = new SqlCommand("sp_GuardarVehiculo");
                oCommand.CommandType = CommandType.StoredProcedure;

                oCommand.Parameters.AddWithValue("@noSeq", noSeq);
                oCommand.Parameters.AddWithValue("@idParte", idParte);
                oCommand.Parameters.AddWithValue("@idCategoriaParte", idCategoria);
                oCommand.Parameters.AddWithValue("@idMarcaVehiculo", vehi.marca);
                oCommand.Parameters.AddWithValue("@idModeloVehiculo", vehi.modelo);
                oCommand.Parameters.AddWithValue("@anno", vehi.anno);

                return(ConexionDAO.getInstance().EjecutarSqlActualizacion(oCommand));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #25
0
        public static int guardarCotizacion(Cotizacion cotizacion)
        {
            try
            {
                SqlCommand oCommand = new SqlCommand("sp_GuardarCotizacion");
                oCommand.CommandType = CommandType.StoredProcedure;

                oCommand.Parameters.AddWithValue("@idCotizacion", cotizacion.idCotizacion);
                oCommand.Parameters.AddWithValue("@descripcion", cotizacion.descripcion);
                oCommand.Parameters.AddWithValue("@idMarca", cotizacion.idMarca);
                oCommand.Parameters.AddWithValue("@idModelo", cotizacion.idModelo);
                oCommand.Parameters.AddWithValue("@Año", cotizacion.anno);
                oCommand.Parameters.AddWithValue("@otroDatos", cotizacion.otrosDatos);
                oCommand.Parameters.AddWithValue("@idUsuario", cotizacion.idUsuario);
                oCommand.Parameters.AddWithValue("@estado", cotizacion.estado);
                oCommand.Parameters.AddWithValue("@imagen", cotizacion.imagen);

                return(ConexionDAO.getInstance().EjecutarSqlActualizacion(oCommand));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #26
0
        public static DataTable ObtenerInfo(string usuario)
        {
            string osql = string.Format("Select [idUsuario],[Usuario],[contrasenna],[Identificacion],[Nombre],[Apellido1],[Apellido2],[correo],[Telefono],b.[Rol],a.[Rol][idRol],[estado],[Proveedor] from Usuario a inner join Roles b on a.Rol=b.idRol where Usuario='{0}' and estado=1", usuario);

            return(ConexionDAO.getInstance().EjecutarConsultaDataTable(osql));
        }
Пример #27
0
        public static string Proveedor(string user)
        {
            string osql = string.Format("Select Proveedor from Usuario where Usuario='{0}'", user);

            return(ConexionDAO.getInstance().EjecutarSQLScalar(osql));
        }
Пример #28
0
        public static string Login(string user, string clave)
        {
            string osql = string.Format("Select count(*)[flag] from usuario where estado=1 and Usuario='{0}' and contrasenna=hashbytes('MD5','{1}')", user, clave);

            return(ConexionDAO.getInstance().EjecutarSQLScalar(osql));
        }
Пример #29
0
        public static int Actualizar(Usuario usuario)
        {
            string osql = string.Format("Update a set Usuario = '{0}',[contrasenna]=case  when '{1}'='' then [contrasenna] else HASHBYTES('MD5','{1}') end ,[Identificacion] = '{2}',[Nombre] = '{3}',[Apellido1] = '{4}',[Apellido2] = '{5}',[correo] = '{6}',[Telefono] = '{7}' from Usuario a where idUsuario={8}", usuario.Usuario1, usuario.Contrasenna, usuario.Identificacion1, usuario.Nombre, usuario.Apellido11, usuario.Apellido21, usuario.Correo, usuario.Telefono1, usuario.IdUsuario);

            return(ConexionDAO.getInstance().EjecutarSqlActualizacion(osql));
        }