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); }
public object ExecuteScalar(string procedureName, DataParameters parameters) { SqlParameter[] pms = GetParameter(parameters); return(dapper.ExecuteScalar(procedureName, CommandType.StoredProcedure, pms)); }
public System.Data.DataSet ExecuteDataSetByProc(string storedProcName, DataParameters parameters) { SqlParameter[] pms = GetParameter(parameters); return(dapper.QueryFillDataSet(storedProcName, CommandType.StoredProcedure, pms)); }
public System.Data.DataRow ExecuteDataRow(string sql, DataParameters parameters, CommandType cmdType = CommandType.Text) { SqlParameter[] pms = GetParameter(parameters); return(dapper.QueryDataRow(sql, cmdType, pms)); }
public System.Data.DataSet ExecuteDataSet(string procedureName, System.Data.CommandType ctype, DataParameters parameters) { SqlParameter[] pms = GetParameter(parameters); return(dapper.QueryFillDataSet(procedureName, ctype, pms)); }
public int ExecuteNonQueryByText(string sql, DataParameters paraValues) { SqlParameter[] pms = GetParameter(paraValues); return(dapper.ExecuteNoquery(sql, CommandType.Text, pms)); }
public int ExecuteNonQueryByStore(string procedureName, DataParameters cmdParms) { SqlParameter[] pms = GetParameter(cmdParms); return(dapper.ExecuteNoquery(procedureName, CommandType.StoredProcedure, pms)); }