예제 #1
0
파일: Trade.cs 프로젝트: barros-jf/ESN
 public void cancel()
 {
     if(state == tradeStateType.pending)
     {
         state = tradeStateType.canceled;
         TradeDAO.currentInstance.save(this);
     }
 }
예제 #2
0
파일: Trade.cs 프로젝트: barros-jf/ESN
        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);
            }
        }
예제 #3
0
파일: Trade.cs 프로젝트: barros-jf/ESN
 public Trade(Picture imgA,Picture imgB)
 {
     this.pictureA = imgA;
     this.pictureB = imgB;
     state = tradeStateType.pending;
 }