Exemplo n.º 1
0
 private void addCur_button_Click(object sender, EventArgs e)
 {
     firstName = curFN_textBox.Text;
     lastName  = curLN_textBox.Text;
     curatorId = curID_textBox2.Text;
     gal.AddCurator(firstName, lastName, curatorId);
 }
Exemplo n.º 2
0
        public static void AddCurator()
        {
            Console.WriteLine("Enter ID");
            string ID = Console.ReadLine();

            Console.WriteLine("Enter first name");
            string fname = Console.ReadLine();

            Console.WriteLine("Enter last name");
            string lname = Console.ReadLine();

            gal.AddCurator(true, fname, lname, ID);
            string output = gal.ListCurators();

            Console.WriteLine(output);
        }
Exemplo n.º 3
0
        static private void NewCurator()
        {
            Console.Clear();
            Console.WriteLine("------ Add new curator ------ \n");

            Console.Write("Type the curator name: ");
            string fName = Console.ReadLine();

            Console.Write("Type the curator ID: ");
            string curatorID = Console.ReadLine();

            while (curatorID.Length != 5 || gal.SearchCurator(curatorID) != null)
            {
                Console.WriteLine("Invalid ID!Please try again.");
                curatorID = Console.ReadLine();
            }
            gal.AddCurator(fName, curatorID);

            Console.WriteLine("Curator added!Press any key to continue.");
            Console.ReadLine();
        }
Exemplo n.º 4
0
        private void addCurator_Click(object sender, RoutedEventArgs e)
        {
            if (curatorID.Text == "" || curatorName.Text == "")
            {
                MessageBox.Show("ID and Name are required!");
                return;
            }

            if (!fieldsValidation("id", curatorID))
            {
                MessageBox.Show("Invalid ID!\nID should have 5 characteres.");
                return;
            }
            if (!fieldsValidation("curatorName", curatorName))
            {
                int size = curatorName.Text.Length;
                MessageBox.Show("Invalid Name!\nName must have maximum 30 characteres.");
                return;
            }


            Curator c = gal.SearchCurator(curatorID.Text);

            if (c != null)
            {
                curatorsText.Text = "Curator ID already exists!";
            }
            else
            {
                c = gal.AddCurator(curatorName.Text, curatorID.Text);
                curatorsText.Text  = "Curator added!\n";
                curatorsText.Text += c.ToString();

                //Clear information
                curatorID.Text   = "";
                curatorName.Text = "";
            }
        }
Exemplo n.º 5
0
        private static void NewCurator()
        {
            Console.WriteLine("======================================");
            Console.WriteLine("    Add a Curator                     ");
            Console.WriteLine("(*) Press ';' to return to menu       ");
            Console.WriteLine("======================================");
            Console.WriteLine("");

            // Step 3 - item 2 / e
            Console.WriteLine("Curator First Name: ");
            fName = Console.ReadLine();
            Console.WriteLine("Curator Last Name: ");
            lName = Console.ReadLine();
            Console.WriteLine("Curator Id: ");
            curatorID = Console.ReadLine();

            // Step 3 - item 1 - a


            // Step 3 - item 2 - b
            gal.AddCurator(fName, lName, curatorID);

            WaitReturn();
        }
Exemplo n.º 6
0
//Interface
        static void Main(string[] args)
        {
            Gallery       gal      = new Gallery();
            Curator       curator  = new Curator(fName, lName, curatorId);
            EventListener listener = new EventListener(curator);

            //interface
            Title();
            Menu();

            int  maxMenuItems = 7;
            int  selector     = 0;
            bool good         = false;

            while (selector != maxMenuItems)
            {
                good = int.TryParse(Console.ReadLine(), out selector);
                if (good)
                {
                    Console.Clear();
                    switch (selector)
                    {
                    case 1:
                        //interface
                        // Adding a new artist
                        Console.WriteLine("Enter the artist's first name: ");
                        fName = Console.ReadLine();
                        Console.WriteLine("Enter the artist's last name: ");
                        lName = Console.ReadLine();
                        Console.WriteLine("Enter the artist's ID number: ");
                        artistID = Console.ReadLine();
                        gal.AddArtist(fName, lName, artistID);

                        DrawLine();
                        Console.WriteLine("The artist has been added to the list");
                        DrawLine();
                        gal.ListArtists();
                        DrawLine();
                        break;

                    case 2:

                        //Adding a new curator
                        Console.WriteLine("Enter the curator's first name: ");
                        fName = Console.ReadLine();
                        Console.WriteLine("Enter the curator's last name: ");
                        lName = Console.ReadLine();
                        Console.WriteLine("Enter the curator's ID number: ");
                        curatorId = Console.ReadLine();
                        gal.AddCurator(fName, lName, curatorId);
                        DrawLine();
                        Console.WriteLine("The curator has been added to the list");
                        DrawLine();
                        gal.ListCurators();
                        break;

                    case 3:
                        //Adding the artpiece
                        Console.WriteLine("Enter the artpiece's ID number: ");
                        artPieceID = Console.ReadLine();
                        Console.WriteLine("Enter the artpiece's Title: ");
                        pieceTitle = Console.ReadLine();
                        Console.WriteLine("Enter the artpiece's year: ");
                        pieceYear = Console.ReadLine();
                        Console.WriteLine("Enter the artpiece's value: ");
                        pieceValue = Convert.ToDouble(Console.ReadLine());
                        Console.WriteLine("Enter the artpiece's artist ID number: ");
                        artistID = Console.ReadLine();
                        Console.WriteLine("Enter the artpiece's curator ID number: ");
                        curatorId = Console.ReadLine();
                        gal.AddPieces(artPieceID, pieceTitle, pieceYear, pieceValue, artistID, curatorId);
                        DrawLine();
                        Console.WriteLine("The artpiece has been added to the list.");
                        DrawLine();
                        gal.ListPieces();
                        break;

                    case 4:
                        //Display Artpiece list
                        gal.ListPieces();
                        break;

                    case 5:
                        //Selling the artpiece
                        Console.WriteLine("Enter the ID number of the artpiece being sold : ");
                        artPieceID = Console.ReadLine();
                        Console.WriteLine("Enter the price paid for the artpeice being sold: ");
                        piecePrice = Convert.ToDouble(Console.ReadLine());

                        gal.SellPieces(artPieceID, piecePrice); //sell piece sells the piece and calls for curator commission
                        curator.clearComm();                    // resets commission to 0

                        DrawLine();
                        Console.WriteLine("The artpiece has been sold.");
                        DrawLine();
                        gal.ListPieces();
                        DrawLine();
                        gal.ListCurators();
                        break;

                    case 6:
                        //Calling all information
                        DrawLine();
                        gal.ListArtists();
                        DrawLine();
                        gal.ListCurators();
                        DrawLine();
                        gal.ListPieces();
                        DrawLine();
                        break;

                    case 7:
                        Environment.Exit(0);
                        break;

                    default:
                        if (selector != maxMenuItems)
                        {
                            ErrorMessage();
                        }
                        break;
                    }
                }
                else
                {
                    ErrorMessage();
                }
                Console.ReadKey();
            }
        }