Example #1
0
 public void Delete(EasyTable table, EasyBaseColumn condition)
 {
     if (condition is EasyBoolColumn)
     {
         EasyBoolColumn b = (EasyBoolColumn)condition;
         int            l = b.GetRowCount();
         for (int i = 0; i < l; i++)
         {
             if (b.Values[i])
             {
                 table.Delete(i, Transaction);
             }
         }
     }
     else if (condition is EasyIntColumn)
     {
         EasyIntColumn iCol = (EasyIntColumn)condition;
         int           l    = iCol.GetRowCount();
         for (int i = 0; i < l; i++)
         {
             table.Delete(iCol.Values[i], Transaction);
         }
     }
     else
     {
         throw new NotSupportedException();
     }
 }
Example #2
0
 public void Update(EasyTable table, EasyBaseColumn condition, KeyValuePair <string, object>[] values)
 {
     if (condition is EasyBoolColumn)
     {
         EasyBoolColumn b = (EasyBoolColumn)condition;
         int            l = b.GetRowCount();
         for (int i = 0; i < l; i++)
         {
             if (b.Values[i])
             {
                 table.Update(i, values, Transaction);
             }
         }
     }
     else if (condition is EasyIntColumn)
     {
         EasyIntColumn iCol = (EasyIntColumn)condition;
         int           l    = iCol.GetRowCount();
         for (int i = 0; i < l; i++)
         {
             table.Update(iCol.Values[i], values, Transaction);
         }
     }
     else
     {
         throw new NotSupportedException();
     }
 }