Ejemplo n.º 1
0
 private static bool MasterAction(BEntity op, ILocalBox box)
 {
     switch (op.ActionType)
     {
         case ActionType.Insert:
             return box.Insert(op.TableName, op.Value);
         case ActionType.Delete:
             return box.Delete(op.TableName, op.Key);
         case ActionType.Update:
             if (box.Update(op.TableName, op.Key, op.Value))
             {
                 return true;
             }
             else
             {
                 return box.Insert(op.TableName, op.Value);
             }
     }
     throw new Exception("");
 }
Ejemplo n.º 2
0
        private static bool MasterAction(BEntity op, ILocalBox box)
        {
            switch (op.ActionType)
            {
            case ActionType.Insert:
                return(box.Insert(op.TableName, op.Value));

            case ActionType.Delete:
                return(box.Delete(op.TableName, op.Key));

            case ActionType.Update:
                if (box.Update(op.TableName, op.Key, op.Value))
                {
                    return(true);
                }
                else
                {
                    return(box.Insert(op.TableName, op.Value));
                }
            }
            throw new Exception("");
        }