/// <summary> /// 增加 /// </summary> /// <param name="param">实体</param> public void Add(Parameter param) { if (param != null) { _values.Add(param); } }
public static void AddParameter(string name, object value, OracleType oracleType, ParameterCollection parameters) { Parameter p = new Parameter("p" + name, oracleType); switch (oracleType) { case OracleType.DateTime: p.ParameterValue = value == null ? DateTime.Now : value; break; default: if (value == null) { p.ParameterValue = string.Empty; } else { if (value.ToString() == "") { p.ParameterValue = string.Empty; } else { p.ParameterValue = value; } } break; } parameters.Add(p); }
public void ExecuteMessageSql(string sql, Parameter[] pageparm) { try { ParameterCollection pras = new ParameterCollection(); foreach (var item in pageparm) { pras.Add(item); } dao.ExecuteNonQuery(sql, CommandType.Text, pras); } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { } }
/// <summary> /// 设置实体 /// </summary> /// <param name="param">实体</param> /// <param name="index">索引</param> public void Set(Parameter param, int index) { _values[index] = param; }
/// <summary> /// 增加 /// </summary> /// <param name="parameterName">参数名</param> /// <param name="parameterValue">参数值</param> public void Add(string parameterName, object parameterValue) { Parameter p = new Parameter(); p.ParameterName = parameterName; p.ParameterValue = parameterValue; _values.Add(p); }
public int ExecuteNonQuery(string sql, Parameter[] pageparm) { return ExecuteNonQuery(sql, CommandType.Text, pageparm); }
public int ExecuteNonQuery(string sql, CommandType type, Parameter[] pageparm) { ParameterCollection pras = new ParameterCollection(); foreach (var item in pageparm) { pras.Add(item); } return ExecuteNonQuery(sql, type, pras); }