Example #1
0
 public static StatementParameterCollection ConvertStatement(Dictionary <string, CustomerParam> paras, out bool
                                                             isNonQuery)
 {
     isNonQuery = false;
     if (paras != null && paras.Count > 0)
     {
         StatementParameterCollection dic = new StatementParameterCollection();
         foreach (KeyValuePair <string, CustomerParam> item in paras)
         {
             if (item.Value.ParameterDirection.Equals(ParameterDirection.ReturnValue))
             {
                 dic.AddReturnParameter(item.Key, LinqEnumHelper.IntToEnum <DbType>(item.Value.DbType));
             }
             else if (item.Value.ParameterDirection.Equals(ParameterDirection.Output))
             {
                 if (!isNonQuery)
                 {
                     isNonQuery = true;
                 }
                 dic.AddOutParameter(item.Key, LinqEnumHelper.IntToEnum <DbType>(item.Value.DbType));
             }
             else
             {
                 dic.AddInParameter(item.Key, LinqEnumHelper.IntToEnum <DbType>(item.Value.DbType), item.Value.Value);
             }
             dic[item.Key].TableName  = item.Value.TableName;
             dic[item.Key].ColumnName = item.Value.ColumnName;
         }
         return(dic);
     }
     else
     {
         return(new StatementParameterCollection());
     }
 }
Example #2
0
 public static StatementParameterCollection ConvertStatement(Dictionary <string, CustomerParam> paras)
 {
     if (paras != null && paras.Count > 0)
     {
         StatementParameterCollection dic = new StatementParameterCollection();
         foreach (KeyValuePair <string, CustomerParam> item in paras)
         {
             dic.AddInParameter(item.Key, LinqEnumHelper.IntToEnum <DbType>(item.Value.DbType), item.Value.Value);
         }
         return(dic);
     }
     else
     {
         return(new StatementParameterCollection());
     }
 }