Example #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);
 }
Example #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));
        }
Example #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);
        }
Example #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;
 }