Example #1
0
        public int SellPiece(string pieceID, double value)
        {
            ArtPiece p = SearchArtPiece(pieceID);

            if (p == null)
            {
                return(0);
            }
            if (p.Status == 'S')
            {
                //"Art Piece already sold!"
                return(1);
            }
            else if (p.Status == 'O')
            {
                //"Art Piece not avaliable for selling!
                return(2);
            }
            else if (p.Status == 'D')
            {
                p.ChangeStatus('S');
                p.PricePaid(value);

                Curator c = SearchCurator(p.CuratorID);
                c.SetComm(p.CalculateComm(value));
            }
            return(3);
        }
Example #2
0
        public bool SetStatus(string pieceID, char status)
        {
            ArtPiece p = SearchArtPiece(pieceID);

            if (p.Status != 'S')
            {
                p.ChangeStatus(status);
                return(true);
            }
            return(false);
        }