Esempio n. 1
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;
 }
Esempio n. 2
0
 protected override void build(Item item, int limit)
 {
     string val = item.getStreamName();
     string str2 = item.getIdField();
     StringTheory condition = new StringTheory();
     base.BuildCondition(condition, item);
     if (limit > -1)
     {
         StringTheory theory2 = new StringTheory("SELECT TOP %limit% %id_field% FROM %table%");
         theory2.Replace("%limit%", limit);
         theory2.Replace("%id_field%", item.getIdField());
         theory2.Replace("%table%", val);
         if ((condition != null) && (condition.Length > 0))
         {
             theory2.Append(" WHERE ");
             theory2.Append(condition);
         }
         base.Append("DELETE FROM ");
         base.Append(val);
         base.Append(" WHERE ");
         base.Append(string.Concat(new object[] { item.getIdField(), " IN (", theory2, ")" }));
     }
     else
     {
         base.Append("DELETE FROM ");
         base.Append(val);
         if ((condition != null) && (condition.Length > 0))
         {
             base.Append(" WHERE ");
             base.Append(condition);
         }
     }
 }
Esempio n. 3
0
 public void build(Item item)
 {
     StringTheory val = new StringTheory("SELECT TOP 1 %idField% FROM %tableName% WHERE %idField% = '%id%'");
     val.Replace("%idField%", item.getIdField());
     val.Replace("%tableName%", item.getStreamName());
     val.Replace("%id%", item.Id);
     base.Append(val);
 }
Esempio n. 4
0
 protected override void build(Item item, int limit)
 {
     string val = item.getStreamName();
     string str2 = item.getIdField();
     StringTheory condition = new StringTheory();
     base.BuildCondition(condition, item);
     base.Append("DELETE FROM ");
     base.Append(val);
     if ((condition != null) && (condition.Length > 0))
     {
         base.Append(" WHERE ");
         base.Append(condition);
     }
     if (limit > -1)
     {
         base.Append(" LIMIT " + limit);
     }
 }
Esempio n. 5
0
 protected override void build(Item entity, int limit)
 {
     string str = entity.getStreamName();
     string str2 = entity.getIdField();
     StringTheory condition = new StringTheory();
     base.BuildCondition(condition, entity);
     OracleSelectQuery query = new OracleSelectQuery(entity, -1);
     base.Append("DELETE FROM " + str);
     if (condition.Length > 0)
     {
         base.Append(" WHERE " + condition);
         if (limit > -1)
         {
             base.Append(" AND rownum < ");
             base.Append(limit + 1);
         }
     }
     else if (limit > -1)
     {
         base.Append(" WHERE rownum < ");
         base.Append(limit + 1);
     }
 }