コード例 #1
0
        public static void Main(string[] args)
        {
            bool closeProgram = false;

            while (!closeProgram)
            {
                Console.Clear();
                Console.WriteLine("=======================================================");
                Console.WriteLine("BILLIE'S ALBUMS COLLECTION");
                Console.WriteLine("=======================================================");
                Console.WriteLine("1 - Register Album\n2 - Display Albums\n3 - Search Albums\n4 - Search Musics\n5 - Create Playlist\n6 - Exit");
                Console.WriteLine("Please, select your option: ");

                string option = (Console.ReadLine());

                int opint = int.Parse(option);

                if (opint == 6)
                {
                    break;
                }

                AlbumServices.SelectedOption(opint);
            }
            Console.Clear();
        }
コード例 #2
0
 public MainServices()
 {
     Users   = new UserServices();
     News    = new NewsServices();
     Albums  = new AlbumServices();
     Modules = new ModulesServices();
 }
コード例 #3
0
        /// <summary>
        /// Init view to show the ddl
        /// </summary>
        /// <returns></returns>
        public IActionResult Index()
        {
            try
            {
                //Get all albums from the service
                var albumsResult = AlbumServices.GetAlbums();

                ViewBag.Albums = albumsResult;

                return(View());
            }
            catch (Exception ex)
            {
                ViewBag.Albums = new List <Album>();

                return(View());
            }
        }