Exemplo n.º 1
0
 public int ExecuteNonQuery(string storedProcedureName, Dictionary<string, object> parameters)
 {
     DBProvider database = new DBProvider(rutaContratos, "System.Data.SqlClient");
     DbCommand command = database.GetStoredProcCommand(storedProcedureName);
     foreach (KeyValuePair<string, object> parameter in parameters)
     {
         database.AddInParameter(command, parameter.Key, parameter.Value);
     }
     return database.ExecuteNonQuery(command);
 }
Exemplo n.º 2
0
        public object ExecuteScalar(string storedProcedureName, Dictionary <string, object> parameters)
        {
            DBProvider database = new DBProvider(rutaContratos, "System.Data.SqlClient");
            DbCommand  command  = database.GetStoredProcCommand(storedProcedureName);

            foreach (KeyValuePair <string, object> parameter in parameters)
            {
                database.AddInParameter(command, parameter.Key, parameter.Value);
            }
            return(database.ExecuteScalar(command));
        }
Exemplo n.º 3
0
        public DataTable LoadTable(string storedProcedureName, Dictionary <string, object> parameters)
        {
            DataTable  dtTable  = new DataTable();
            DBProvider database = new DBProvider(rutaContratos, "System.Data.SqlClient");
            DbCommand  command  = database.GetStoredProcCommand(storedProcedureName);

            foreach (KeyValuePair <string, object> parameter in parameters)
            {
                database.AddInParameter(command, parameter.Key, parameter.Value);
            }
            dtTable.Load(database.ExecuteReader(command));
            return(dtTable);
        }
Exemplo n.º 4
0
 public DataTable LoadTable(string storedProcedureName, Dictionary<string, object> parameters)
 {
     DataTable dtTable = new DataTable();
     DBProvider database = new DBProvider(rutaContratos, "System.Data.SqlClient");
     DbCommand command = database.GetStoredProcCommand(storedProcedureName);
     foreach (KeyValuePair<string, object> parameter in parameters)
     {
         database.AddInParameter(command, parameter.Key, parameter.Value);
     }
     dtTable.Load(database.ExecuteReader(command));
     return dtTable;
 }