Example #1
0
        internal int MtdGenerarIdProveedor()
        {
            DataTable      temp = new DataTable();
            ClsConexionSQL conn = new ClsConexionSQL();

            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.conectar();
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "USP_S_ListarProductos";
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(temp);

            int idproducto = temp.Rows.Count + 1;


            return(idproducto);
        }
Example #2
0
        public Boolean MtdAgregarABoleta(Cls_E_Boleta objEBoleta)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     objComando  = new SqlCommand();
                objComando.Connection  = objConexion.conectar();
                objComando.CommandText = "USP_I_AgregarCompra";
                objComando.CommandType = CommandType.StoredProcedure;
                objComando.Parameters.Add(new SqlParameter("ser", SqlDbType.VarChar));
                objComando.Parameters.Add(new SqlParameter("num", SqlDbType.VarChar));
                objComando.Parameters.Add(new SqlParameter("dnie", SqlDbType.VarChar));
                objComando.Parameters.Add(new SqlParameter("fecha", SqlDbType.Date));
                objComando.Parameters.Add(new SqlParameter("dnic", SqlDbType.VarChar));
                objComando.Parameters.Add(new SqlParameter("sub", SqlDbType.Decimal));
                objComando.Parameters.Add(new SqlParameter("igv", SqlDbType.Decimal));
                objComando.Parameters.Add(new SqlParameter("total", SqlDbType.Decimal));
                objComando.Parameters.Add(new SqlParameter("estado", SqlDbType.VarChar));
                objComando.Parameters.Add(new SqlParameter("tipopago", SqlDbType.VarChar));
                objComando.Parameters["ser"].Value      = objEBoleta.Serie;
                objComando.Parameters["num"].Value      = objEBoleta.Numero;
                objComando.Parameters["dnie"].Value     = objEBoleta.Empleado;
                objComando.Parameters["fecha"].Value    = objEBoleta.Fecha;
                objComando.Parameters["dnic"].Value     = objEBoleta.Cliente;
                objComando.Parameters["sub"].Value      = objEBoleta.Total;
                objComando.Parameters["igv"].Value      = objEBoleta.Total;
                objComando.Parameters["total"].Value    = objEBoleta.Total;
                objComando.Parameters["estado"].Value   = objEBoleta.Estado;
                objComando.Parameters["tipopago"].Value = objEBoleta.Empleado;
                objComando.Connection = objConexion.conectar();
                objComando.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Example #3
0
        public DataTable MtdListarEmpleado(Cls_E_Ingreso objE)
        {
            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("documento", SqlDbType.VarChar));
            objComando.Parameters.Add(new SqlParameter("cla", SqlDbType.VarChar));
            objComando.Parameters["documento"].Value = objE.Dni;
            objComando.Parameters["cla"].Value       = objE.Clave;
            objComando.Connection = objConexion.conectar();
            objComando.ExecuteNonQuery();
            adapter.SelectCommand = objComando;
            adapter.Fill(empleado);
            foreach (DataRow fila in empleado.Rows)
            {
                acceso = fila[5].ToString();
            }
            return(empleado);
        }
Example #4
0
        public Boolean MtdActualizarCargo(ClsECargo objE)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     objComando  = new SqlCommand();
                objComando.Connection  = objConexion.conectar();
                objComando.CommandText = "USP_U_ActualizarCargo";
                objComando.CommandType = CommandType.StoredProcedure;
                objComando.Parameters.Add(new SqlParameter("cod", SqlDbType.Int));
                objComando.Parameters.Add(new SqlParameter("des", SqlDbType.VarChar));
                objComando.Parameters["cod"].Value = objE.Codigo;
                objComando.Parameters["des"].Value = objE.Descripcion;
                objComando.Connection = objConexion.conectar();
                objComando.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }