void AddCast() { Cast c = new Cast(); Console.Write(" Enter Cast Name = "); c.Name = Console.ReadLine(); Console.Write("Enter Gender = "); c.Gender = Console.ReadLine(); Console.Write("Enter TmbdUrl = "); c.TmdbUrl = Console.ReadLine(); Console.Write("Enter ProfilePath = "); c.ProfilePath = Console.ReadLine(); if (castService.AddCast(c) > 0) { Console.WriteLine("Cast added successfully"); } else { Console.WriteLine("Some error has occurred"); } }
void AddCast() { try { Cast c = new Cast(); Console.Write("Enter Name => "); c.Name = Console.ReadLine(); Console.Write("Enter Gender => "); c.Gender = Console.ReadLine(); Console.Write("Enter TmdbUrl => "); c.TmdbUrl = Console.ReadLine(); Console.Write("Enter ProfilePath => "); c.ProfilePath = Console.ReadLine(); int res = castService.AddCast(c); if (res > 0) { Console.WriteLine("Cast added successfully"); } else { Console.WriteLine("Some error occurs"); } } catch (Exception ex) { Console.WriteLine("some error has been occured. Contact the admin department"); } }