Example #1
0
 public bool build(Item item)
 {
     StringTheory theory = new StringTheory();
     StringTheory theory2 = new StringTheory();
     Field field = null;
     Hashtable hashtable = item.getBoxView();
     ArrayList coll = new ArrayList();
     ArrayList list2 = new ArrayList();
     foreach (string str in hashtable.Keys)
     {
         field = (Field)hashtable[str];
         if ((field != null) && field.Touched())
         {
             coll.Add(str);
             list2.Add(field.toSql());
         }
     }
     theory.Join(coll, ", ");
     theory2.Join(list2, ", ");
     if (coll.Count > 0)
     {
         StringTheory val = new StringTheory("INSERT INTO %tableName% (%fields%) VALUES (%values%)");
         val.Replace("%tableName%", item.getStreamName());
         val.Replace("%fields%", theory);
         val.Replace("%values%", theory2);
         base.Append(val);
     }
     return false;
 }
Example #2
0
        public void Prepend(ICollection list)
        {
            StringTheory str = new StringTheory();

            str.Join(list, "");
            this.Prepend(str);
        }
Example #3
0
 public bool build(Item item)
 {
     Hashtable hashtable = item.getBoxView();
     Field field = (Field)hashtable[item.getIdField()];
     if (!field.IsEmpty())
     {
         Field field2 = null;
         ArrayList coll = new ArrayList();
         foreach (string str in hashtable.Keys)
         {
             field2 = (Field)hashtable[str];
             if (!str.Equals(item.getIdField()) && field2.Touched())
             {
                 coll.Add(str + "=" + field2.toSql());
             }
         }
         if (coll.Count > 0)
         {
             StringTheory theory = new StringTheory();
             theory.Join(coll, ", ");
             StringTheory val = new StringTheory("UPDATE %tableName% SET %pairListing% WHERE %idField% = %id%");
             val.Replace("%tableName%", item.getStreamName());
             val.Replace("%pairListing%", theory);
             val.Replace("%idField%", item.getIdField());
             val.Replace("%id%", field.toSql());
             base.Append(val);
         }
     }
     return false;
 }
Example #4
0
 protected void AppendSortSpecification(StringTheory spec, Item entity)
 {
     ArrayList coll = entity.getSortList();
     if (coll.Count > 0)
     {
         spec.Append(" ORDER BY ");
         spec.Join(coll, ", ");
     }
 }
Example #5
0
 public void Prepend(ICollection list)
 {
     StringTheory str = new StringTheory();
     str.Join(list, "");
     this.Prepend(str);
 }