public void Insertar(DO.Persona persona)
        {
            DbProviderFactory factory = DbProviderFactories.GetFactory(Settings.Default.proveedor);

            DbConnection conn = null;

            DbCommand comm = null;



            try
            {
                conn = factory.CreateConnection();

                conn.ConnectionString = Settings.Default.connection;

                comm = factory.CreateCommand();



                DbParameter param1 = factory.CreateParameter();

                DbParameter param2 = factory.CreateParameter();

                DbParameter param3 = factory.CreateParameter();

                DbParameter param4 = factory.CreateParameter();

                DbParameter param5 = factory.CreateParameter();
                DbParameter param6 = factory.CreateParameter();



                param1.ParameterName = "@vNombre";

                param1.DbType = System.Data.DbType.String;


                param1.Value = persona.VNombre;



                param2.ParameterName = "@iGenero";


                param2.DbType = System.Data.DbType.Int32;

                param2.Value = persona.IGenero;



                param3.ParameterName = "@vCategoria";

                param3.DbType = System.Data.DbType.String;

                param3.Value = persona.VCategoria;



                param4.ParameterName = "@iValor";

                param4.DbType = System.Data.DbType.Decimal;

                param4.Value = persona.IValor;



                param5.ParameterName = "@bDisponible";

                param5.DbType = System.Data.DbType.Boolean;

                param5.Value = persona.BDisponible;



                //Abrir Coneccion

                comm.Connection = conn;

                conn.Open();



                //Ejecutar Store Procedure

                comm.CommandType = System.Data.CommandType.StoredProcedure;

                comm.CommandText = "sp_Insertar";

                comm.Parameters.Add(param1);

                comm.Parameters.Add(param2);

                comm.Parameters.Add(param3);

                comm.Parameters.Add(param4);

                comm.Parameters.Add(param5);



                comm.ExecuteNonQuery();
            }

            catch (Exception ee)
            {
                throw;
            }

            finally
            {
                comm.Dispose();

                conn.Dispose();
            }
        }
        public void Borrar(DO.Persona persona)
        {
            DbProviderFactory factory = DbProviderFactories.GetFactory(Settings.Default.proveedor);

            DbConnection conn = null;

            DbCommand comm = null;



            try
            {
                conn = factory.CreateConnection();

                conn.ConnectionString = Settings.Default.connection;

                comm = factory.CreateCommand();



                DbParameter param1 = factory.CreateParameter();



                //Carga de Parametros

                param1.ParameterName = "@iId";

                param1.DbType = System.Data.DbType.Int32;

                param1.Value = persona.IId;


                //Abrir Coneccion

                comm.Connection = conn;

                conn.Open();



                //Ejecutar Store Procedure

                comm.CommandType = System.Data.CommandType.StoredProcedure;

                comm.CommandText = "sp_Eliminar";

                comm.Parameters.Add(param1);

                comm.ExecuteNonQuery();
            }

            catch (Exception ee)
            {
                throw;
            }

            finally
            {
                comm.Dispose();

                conn.Dispose();
            }
        }