public static void AddArtpiece() { Console.WriteLine("Enter Piece ID"); string ID = Console.ReadLine(); Console.WriteLine("Enter Title"); string Title = Console.ReadLine(); Console.WriteLine("Enter Year"); string Year = Console.ReadLine(); Console.WriteLine("Enter Estimate"); double Estimate = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter ArtistID"); string ArtistID = Console.ReadLine(); Console.WriteLine("Enter CuratorID"); string CuratorID = Console.ReadLine(); gal.AddPiece(true, ID, Title, Year, Estimate, ArtistID, CuratorID); string output = gal.ListPieces(); Console.WriteLine(output); }
private static void NewArtPiece() { Console.WriteLine("==========================================="); Console.WriteLine(" Receive a Piece into the Collection "); Console.WriteLine("(*) Press ';' to return to menu "); Console.WriteLine("==========================================="); Console.WriteLine(""); // Step 4 - item 3 / a Console.WriteLine("Art Piece Id: "); artPieceID = Console.ReadLine(); Console.WriteLine("Title: "); pieceTitle = Console.ReadLine(); Console.WriteLine("Year: "); pieceYear = Console.ReadLine(); Console.WriteLine("Estimate Value: "); pieceEstimate = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Artist Id: "); artistId = Console.ReadLine(); Console.WriteLine("Curator Id: "); curatorID = Console.ReadLine(); // Step 4 - item 2 - a // Step 4 - item 3 / b gal.AddPiece(artPieceID, pieceTitle, pieceYear, pieceEstimate, artistId, curatorID); WaitReturn(); }
private void SubmitArtPieceButton_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(PieceId.Text) || string.IsNullOrWhiteSpace(PieceTitle.Text) || string.IsNullOrWhiteSpace(PieceArtistId.Text)) { MessageBox.Show("Id, Title and Artist Id are Required"); return; } var result = double.TryParse(PieceValue.Text, out var estimate); if (!result) { MessageBox.Show("Enter Numeric Value for Piece"); return; } _gallery.AddPiece(PieceId.Text, PieceTitle.Text, PieceYear.Text, estimate, PieceArtistId.Text, ""); MessageBox.Show("Piece Added Successfully"); }