예제 #1
0
 public SqlParameter[] GetParameter(DataParameters cmdParms)
 {
     SqlParameter[] pms = new SqlParameter[cmdParms.Items.Count];
     for (int i = 0; i < cmdParms.Items.Count; i++)
     {
         pms[i] = new SqlParameter();
         if (!string.IsNullOrEmpty(cmdParms.Items[i].ParameterName))
         {
             pms[i].ParameterName = cmdParms.Items[i].ParameterName;
             pms[i].Value         = cmdParms.Items[i].ParameterValue == null ? "" : cmdParms.Items[i].ParameterValue;
         }
     }
     return(pms);
 }
예제 #2
0
 public object ExecuteScalar(string procedureName, DataParameters parameters)
 {
     SqlParameter[] pms = GetParameter(parameters);
     return(dapper.ExecuteScalar(procedureName, CommandType.StoredProcedure, pms));
 }
예제 #3
0
 public System.Data.DataSet ExecuteDataSetByProc(string storedProcName, DataParameters parameters)
 {
     SqlParameter[] pms = GetParameter(parameters);
     return(dapper.QueryFillDataSet(storedProcName, CommandType.StoredProcedure, pms));
 }
예제 #4
0
 public System.Data.DataRow ExecuteDataRow(string sql, DataParameters parameters, CommandType cmdType = CommandType.Text)
 {
     SqlParameter[] pms = GetParameter(parameters);
     return(dapper.QueryDataRow(sql, cmdType, pms));
 }
예제 #5
0
 public System.Data.DataSet ExecuteDataSet(string procedureName, System.Data.CommandType ctype, DataParameters parameters)
 {
     SqlParameter[] pms = GetParameter(parameters);
     return(dapper.QueryFillDataSet(procedureName, ctype, pms));
 }
예제 #6
0
 public int ExecuteNonQueryByText(string sql, DataParameters paraValues)
 {
     SqlParameter[] pms = GetParameter(paraValues);
     return(dapper.ExecuteNoquery(sql, CommandType.Text, pms));
 }
예제 #7
0
 public int ExecuteNonQueryByStore(string procedureName, DataParameters cmdParms)
 {
     SqlParameter[] pms = GetParameter(cmdParms);
     return(dapper.ExecuteNoquery(procedureName, CommandType.StoredProcedure, pms));
 }