Пример #1
0
        private static void NewArtist()
        {
            // Step 2 - item 1 - c

            Console.WriteLine("======================================");
            Console.WriteLine("    Add a Artist                      ");
            Console.WriteLine("(*) Press ';' to return to menu       ");
            Console.WriteLine("======================================");
            Console.WriteLine("");

            Console.WriteLine("Artist First Name: ");
            fName = Console.ReadLine();
            Console.WriteLine("Artist Last Name: ");
            lName = Console.ReadLine();
            Console.WriteLine("Artist Id: ");
            artistId = Console.ReadLine();

            // Step 2 - item 1 - b


            // Step 2 - item 1 - d
            gal.AddArtist(fName, lName, artistId);

            WaitReturn();
        }
Пример #2
0
        private void addArtist_button_Click(object sender, EventArgs e)
        {
            firstName = artFN_textBox.Text;
            lastName  = artLN_textBox.Text;
            artistID  = artID_textBox2.Text;

            gal.AddArtist(firstName, lastName, artistID);
        }
Пример #3
0
        private void SubmitArtistButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(IdTextBox.Text) || string.IsNullOrWhiteSpace(FirstNameTextbox.Text) ||
                string.IsNullOrWhiteSpace(LastNameTextbox.Text))
            {
                MessageBox.Show("All Fields are Required");
                return;
            }


            _gallery.AddArtist(FirstNameTextbox.Text, LastNameTextbox.Text, IdTextBox.Text);
            MessageBox.Show("Artist Added Successfully");
        }
Пример #4
0
        public static void AddArtist()
        {
            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.AddArtist(true, fname, lname, ID);
            string output = gal.ListArtists();

            Console.WriteLine(output);
        }
Пример #5
0
        static private void NewArtist()
        {
            Console.Clear();
            Console.WriteLine("------ Add new artist ------ \n");

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

            Console.Write("Type the artist ID: ");
            string artistID = Console.ReadLine();

            while (artistID.Length != 5 || gal.SearchArtist(artistID) != null)
            {
                Console.WriteLine("Invalid ID!Please try again.");
                artistID = Console.ReadLine();
            }

            gal.AddArtist(fName, artistID);
            Console.WriteLine();
            Console.WriteLine("Artist added!Press any key to continue.");
            Console.ReadLine();
        }
Пример #6
0
        private void addArtist_Click(object sender, RoutedEventArgs e)
        {
            if (artistID.Text == "" || artistName.Text == "")
            {
                MessageBox.Show("ID and Name are required!");
                return;
            }

            if (!fieldsValidation("id", artistID))
            {
                MessageBox.Show("Invalid ID!\nID should have 5 characteres.");
                return;
            }
            if (!fieldsValidation("artistName", artistName))
            {
                MessageBox.Show("Invalid Name!\nName must have maximum 40 characteres.");
                return;
            }

            Artist a = gal.SearchArtist(artistID.Text);

            if (a != null)
            {
                artistsText.Text = "Artist ID already exists!";
            }
            else
            {
                a = gal.AddArtist(artistName.Text, artistID.Text);
                artistsText.Text  = "Artist added!\n";
                artistsText.Text += a.ToString();

                //Clear fields
                artistID.Text   = "";
                artistName.Text = "";
            }
        }
Пример #7
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();
            }
        }