internal object MtdFiltrarCliente(string filtro)
        {
            ClsConexionSQL conn    = new ClsConexionSQL();
            DataTable      result  = new DataTable();
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.Conectar();
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "USP_S_FiltrarCliente";
            command.Parameters.Add(new SqlParameter("fil", SqlDbType.VarChar));
            command.Parameters["fil"].Value = filtro;
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(result);
            command.Connection = conn.Desconectar();

            return(result);
        }
        internal DataTable MtdBusquedaProveedor(string ruc)
        {
            ClsConexionSQL conn    = new ClsConexionSQL();
            DataTable      result  = new DataTable();
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.Conectar();
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "USP_S_BusquedaProveedor";
            command.Parameters.Add(new SqlParameter("r", SqlDbType.VarChar));
            command.Parameters["r"].Value = ruc;
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(result);
            command.Connection = conn.Desconectar();

            return(result);
        }
Beispiel #3
0
        internal Boolean MtdAgregarLote(ClsElote e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarLote";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("cod", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("nom", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("col", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("pro", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("so", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("can", SqlDbType.Int));
                command.Parameters.Add(new SqlParameter("pre", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("for", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("mem", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("pes", SqlDbType.Decimal));
                command.Parameters["cod"].Value = e.Codigo;
                command.Parameters["nom"].Value = e.Nombre;
                command.Parameters["col"].Value = e.Color;
                command.Parameters["pro"].Value = e.Proveedor;
                command.Parameters["so"].Value  = e.SistemaOperativo;
                command.Parameters["can"].Value = e.Cantidad;
                command.Parameters["pre"].Value = e.Precio_unitario;
                command.Parameters["for"].Value = e.Forma;
                command.Parameters["mem"].Value = e.Memoria;
                command.Parameters["pes"].Value = e.Peso;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Beispiel #4
0
        internal void MtdAgregarHistorial(ClsEauditoria objE)
        {
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_I_AgregarAuditoria";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("dniemp", SqlDbType.VarChar));
            objComando.Parameters.Add(new SqlParameter("desc", SqlDbType.VarChar));
            objComando.Parameters.Add(new SqlParameter("fech", SqlDbType.Date));
            objComando.Parameters.Add(new SqlParameter("hor", SqlDbType.VarChar));
            objComando.Parameters["dniemp"].Value = objE.Dniemp;
            objComando.Parameters["desc"].Value   = objE.Desc;
            objComando.Parameters["fech"].Value   = objE.Fecha;
            objComando.Parameters["hor"].Value    = objE.Hora;
            objComando.ExecuteNonQuery();
            objComando.Connection = objConexion.Desconectar();
        }
Beispiel #5
0
        internal DataTable MtdVerificarExistencia(string texto)
        {
            DataTable      empleado    = new DataTable();
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_S_VerificarCuenta";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("ver", SqlDbType.VarChar));
            objComando.Parameters["ver"].Value = texto;
            objComando.Connection = objConexion.Conectar();
            objComando.ExecuteNonQuery();
            adapter.SelectCommand = objComando;
            adapter.Fill(empleado);
            objComando.Connection = objConexion.Desconectar();

            return(empleado);
        }
Beispiel #6
0
        internal DataTable MtdBuscarSesion(string usuario)
        {
            DataTable      empleado    = new DataTable();
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_S_BuscarSesion";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("usu", SqlDbType.VarChar));
            objComando.Parameters["usu"].Value = usuario;
            objComando.Connection = objConexion.Conectar();
            objComando.ExecuteNonQuery();
            adapter.SelectCommand = objComando;
            adapter.Fill(empleado);
            objComando.Connection = objConexion.Desconectar();

            return(empleado);
        }
Beispiel #7
0
        internal Boolean MtdGuardarComprobante(ClsEcomprobante e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarComprobante";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("ser", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("num", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("fec", SqlDbType.Date));
                command.Parameters.Add(new SqlParameter("demp", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("dcli", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("sub", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("igv", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("tot", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
                command.Parameters["ser"].Value  = e.Serie;
                command.Parameters["num"].Value  = e.Numero;
                command.Parameters["fec"].Value  = e.Fecha;
                command.Parameters["demp"].Value = e.Empleado;
                command.Parameters["dcli"].Value = e.Cliente;
                command.Parameters["sub"].Value  = e.Subtotal;
                command.Parameters["igv"].Value  = e.Igv;
                command.Parameters["tot"].Value  = e.Total;
                command.Parameters["est"].Value  = e.Estado;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Beispiel #8
0
        internal object MtdListarDetallesComprobante(ClsEdetallecomprobante e)
        {
            DataTable      data        = new DataTable();
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_S_ListarDetallesComprobante";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("ser", SqlDbType.VarChar));
            objComando.Parameters.Add(new SqlParameter("num", SqlDbType.VarChar));
            objComando.Parameters["ser"].Value = e.Serie;
            objComando.Parameters["num"].Value = e.Numero;
            objComando.Connection = objConexion.Conectar();
            objComando.ExecuteNonQuery();
            adapter.SelectCommand = objComando;
            adapter.Fill(data);
            objComando.Connection = objConexion.Desconectar();

            return(data);
        }
Beispiel #9
0
        internal DataTable MtdValidarLogin(ClsElogin e)
        {
            DataTable      empleado    = new DataTable();
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_S_ValidarLogin";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("usu", SqlDbType.VarChar));
            //objComando.Parameters.Add(new SqlParameter("cla", SqlDbType.VarChar));
            objComando.Parameters["usu"].Value = e.Usuario;
            //objComando.Parameters["cla"].Value = e.Clave;
            objComando.Connection = objConexion.Conectar();
            objComando.ExecuteNonQuery();
            adapter.SelectCommand = objComando;
            adapter.Fill(empleado);
            objComando.Connection = objConexion.Desconectar();

            return(empleado);
        }
        internal bool MtdGuardarCliente(ClsEcliente e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarCliente";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("d", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("nom", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("ape", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("cor", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("tel", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
                //command.Parameters.Add(new SqlParameter("idd", SqlDbType.VarChar));
                command.Parameters["d"].Value   = e.Dni;
                command.Parameters["nom"].Value = e.Nombres;
                command.Parameters["ape"].Value = e.Apellidos;
                command.Parameters["cor"].Value = e.Correo;
                command.Parameters["tel"].Value = e.Telefono;
                command.Parameters["est"].Value = e.Estado;
                //command.Parameters["idd"].Value = e.IdDispositivo;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Beispiel #11
0
        internal Boolean MtdGuardarDetalleComprobante(ClsEdetallecomprobante ed)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarDetalleComprobante";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("ser", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("num", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("cod", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("des", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("can", SqlDbType.Int));
                command.Parameters.Add(new SqlParameter("pre", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("imp", SqlDbType.Decimal));
                command.Parameters["ser"].Value = ed.Serie;
                command.Parameters["num"].Value = ed.Numero;
                command.Parameters["cod"].Value = ed.Codigo;
                command.Parameters["des"].Value = ed.Descripcion;
                command.Parameters["can"].Value = ed.Cantidad;
                command.Parameters["pre"].Value = ed.Precio_unitario;
                command.Parameters["imp"].Value = ed.Importe;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Beispiel #12
0
        internal bool MtdGuardarSesion(string usuario)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarSesion";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("usu", SqlDbType.VarChar));
                command.Parameters["usu"].Value = usuario;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }