示例#1
0
 /// <summary>
 /// 增加
 /// </summary>
 /// <param name="param">实体</param>
 public void Add(Parameter param)
 {
     if (param != null)
     {
         _values.Add(param);
     }
 }
示例#2
0
        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);
        }
示例#3
0
        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
            {

            }
        }
示例#4
0
 /// <summary>
 /// 设置实体
 /// </summary>
 /// <param name="param">实体</param>
 /// <param name="index">索引</param>
 public void Set(Parameter param, int index)
 {
     _values[index] = param;
 }
示例#5
0
 /// <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);
 }
示例#6
0
文件: SqlServerDAO.cs 项目: JuRogn/OA
 public int ExecuteNonQuery(string sql, Parameter[] pageparm)
 {
     return ExecuteNonQuery(sql, CommandType.Text, pageparm);
 }
示例#7
0
文件: SqlServerDAO.cs 项目: JuRogn/OA
 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);
 }