Example #1
0
        // Add this object to the theatres collections of MovieTicketing class
        public bool AddTheatre(Theatre obj)
        {
            if (obj.TheatreID == null || obj.TheatreName == null || obj.CityName == null || obj.Address == null || obj.NoOfScreens == null || obj.Screens == null)
            {
                Console.WriteLine("The theatre details should not be empty");
            }

            else
            {
                obj.DisplayTheatreDetails();
            }

            try
            {
                if (obj.NoOfScreens <= 0)
                {
                    Exceptions.InvalidScreenCountExcpetion n1 = new Exceptions.InvalidScreenCountExcpetion();
                }
            }

            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Theatre t1 = obj;

            return(true);
        }
Example #2
0
        public bool UpdateTheatre(Theatre obj)
        {
            bool flag = false;

            obj.DisplayTheatreDetails();

            Console.WriteLine("What are the Updated details ????");

            string TheatreName1 = Console.ReadLine();
            string CityName1    = Console.ReadLine();
            string Address1     = Console.ReadLine();
            int    NoOfScreens1 = int.Parse(Console.ReadLine());

            if (TheatreName1 == null || CityName1 == null || Address1 == null || NoOfScreens1 == null)
            {
                Console.WriteLine("The theatre details should not be empty");
            }

            else
            {
                try
                {
                    if (NoOfScreens1 <= 0)
                    {
                        Exceptions.InvalidScreenCountExcpetion n1 = new Exceptions.InvalidScreenCountExcpetion();
                    }

                    else
                    {
                        obj.TheatreName = TheatreName1;
                        obj.CityName    = CityName1;
                        obj.Address     = Address1;
                        obj.NoOfScreens = NoOfScreens1;
                        flag            = true;
                    }
                }

                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
            return(flag);
        }