示例#1
0
 public int bajaFactor(Factores f)
 {
     Command.CommandText = "delete from factores where idfactor = @idfactor";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idfactor", f.idfactor);
     return(Command.ExecuteNonQuery());
 }
示例#2
0
 public int bajaFactor(Factores f)
 {
     Command.CommandText = "delete from factores where idfactor = @idfactor";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idfactor", f.idfactor);
     return Command.ExecuteNonQuery();
 }
示例#3
0
 public int insertaFactor(Factores f)
 {
     Command.CommandText = "insert into factores (anio, valor) values (@anio, @valor)";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("anio", f.anio);
     Command.Parameters.AddWithValue("valor", f.valor);
     return Command.ExecuteNonQuery();
 }
示例#4
0
 public object FactorDePago(Factores f)
 {
     Command.CommandText = "select top 1 valor from factores where anio <= @anio order by anio desc";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("anio", f.anio);
     object dato = Select(Command);
     return dato;
 }
示例#5
0
 public int insertaFactor(Factores f)
 {
     Command.CommandText = "insert into factores (anio, valor) values (@anio, @valor)";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("anio", f.anio);
     Command.Parameters.AddWithValue("valor", f.valor);
     return(Command.ExecuteNonQuery());
 }
示例#6
0
 public int actualizaFactor(Factores f)
 {
     Command.CommandText = "update factores set anio = @anio, valor = @valor where idfactor = @idfactor";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idfactor", f.idfactor);
     Command.Parameters.AddWithValue("anio", f.anio);
     Command.Parameters.AddWithValue("valor", f.valor);
     return Command.ExecuteNonQuery();
 }
示例#7
0
 public int actualizaFactor(Factores f)
 {
     Command.CommandText = "update factores set anio = @anio, valor = @valor where idfactor = @idfactor";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("idfactor", f.idfactor);
     Command.Parameters.AddWithValue("anio", f.anio);
     Command.Parameters.AddWithValue("valor", f.valor);
     return(Command.ExecuteNonQuery());
 }
示例#8
0
        public object FactorDePago(Factores f)
        {
            Command.CommandText = "select max(valor) from factores where anio <= @anio order by anio desc";
            Command.Parameters.Clear();
            Command.Parameters.AddWithValue("anio", f.anio);
            object dato = Select(Command);

            return(dato);
        }
示例#9
0
 public List<Factores> obtenerFactores()
 {
     DataTable dtFactores = new DataTable();
     List<Factores> lstFactores = new List<Factores>();
     Command.CommandText = "select idfactor, anio, valor from factores";
     Command.Parameters.Clear();
     dtFactores = SelectData(Command);
     for (int i = 0; i < dtFactores.Rows.Count; i++)
     {
         Factores f = new Factores();
         f.idfactor = int.Parse(dtFactores.Rows[i]["idfactor"].ToString());
         f.anio = int.Parse(dtFactores.Rows[i]["anio"].ToString());
         f.valor = decimal.Parse(dtFactores.Rows[i]["valor"].ToString());
         lstFactores.Add(f);
     }
     return lstFactores;
 }
示例#10
0
        public List <Factores> obtenerFactores()
        {
            DataTable       dtFactores  = new DataTable();
            List <Factores> lstFactores = new List <Factores>();

            Command.CommandText = "select idfactor, anio, valor from factores";
            Command.Parameters.Clear();
            dtFactores = SelectData(Command);
            for (int i = 0; i < dtFactores.Rows.Count; i++)
            {
                Factores f = new Factores();
                f.idfactor = int.Parse(dtFactores.Rows[i]["idfactor"].ToString());
                f.anio     = int.Parse(dtFactores.Rows[i]["anio"].ToString());
                f.valor    = decimal.Parse(dtFactores.Rows[i]["valor"].ToString());
                lstFactores.Add(f);
            }
            return(lstFactores);
        }