Example #1
0
 public void cancel()
 {
     if(state == tradeStateType.pending)
     {
         state = tradeStateType.canceled;
         TradeDAO.currentInstance.save(this);
     }
 }
Example #2
0
        public void execute()
        {
            if(state == tradeStateType.pending)
            {
                string auxiliar = pictureA.getOwner();
                pictureA.setOwner(pictureB.getOwner());
                pictureB.setOwner(auxiliar);

                state = tradeStateType.completed;
                TradeDAO.currentInstance.save(this);
            }
        }
Example #3
0
 public Trade(Picture imgA,Picture imgB)
 {
     this.pictureA = imgA;
     this.pictureB = imgB;
     state = tradeStateType.pending;
 }