Example #1
0
        private void FilmCollections_DrawItem(object sender, DrawItemEventArgs e)
        {
            Graphics       g   = e.Graphics;
            FilmCollection col = (this.filmCollections.Items[e.Index] as FilmCollection);

            Color textColor = Color.Red;

            if (col.Film.Uploaded && col.Film.AssetCreated)
            {
                textColor = Color.Green;
            }
            else if (col.Film.Uploaded)
            {
                textColor = Color.Blue;
            }

            SolidBrush foregroundBrush = new SolidBrush(textColor);
            string     text            = col.Name;
            Font       textFont        = e.Font;
            RectangleF rectangle       = new RectangleF(new PointF(e.Bounds.X, e.Bounds.Y), new SizeF(e.Bounds.Width, g.MeasureString(text, textFont).Height));

            g.DrawString(text, textFont, foregroundBrush, rectangle);

            foregroundBrush.Dispose();
            g.Dispose();
        }
        public FilmCollection PostFilmCollection(FilmCollection col)
        {
            var original = db.FilmCollections.Find(col.FilmCollectionID);

            if (original == null)
            {
                db.FilmCollections.Add(col);
                db.SaveChanges();

                FilmCategory cat     = db.FilmCategories.Where(fc => fc.Description == Film.SHORT_COLLECTION).FirstOrDefault();
                Film         newFilm = new Film()
                {
                    Title            = col.Name,
                    Showing          = DateTime.Parse("03/06/2021 11:00"),
                    FilmCategoryID   = cat.FilmCategoryID,
                    FilmCollectionID = col.FilmCollectionID
                };

                db.Films.Add(newFilm);
                db.SaveChanges();

                col.FilmID = newFilm.FilmID;
                col.Film   = newFilm;
                db.SaveChanges();

                return(col);
            }

            original.Name = col.Name;
            db.SaveChanges();

            return(original);
        }
 public PopularPage(FilmCollection Movies)
 {
     MovieDbFactory.RegisterSettings(Movies);
     this._modelView     = new PopularMoviesViewModel(this.Navigation, Movies._movies);
     this.BindingContext = this._modelView;
     InitializeComponent();
 }
Example #4
0
 public MovieListPage(FilmCollection Movie)
 {
     MovieDbFactory.RegisterSettings(Movie);
     this._movieListViewModel = new MovieListViewModel(this.Navigation, Movie._movies);
     this.BindingContext      = this._movieListViewModel;
     InitializeComponent();
 }
Example #5
0
        private async void filmCollectionDropdown_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox box = (ComboBox)sender;

            FilmCollection col = (FilmCollection)box.SelectedItem;

            await ShowFilms(col.FilmCollectionID);

            if (col.Film != null)
            {
                if (col.Film.FilmCategory.Description == Film.SHORT_COLLECTION)
                {
                    uploadFilm.Visible      = false;
                    createFilmAsset.Visible = false;
                }
                else
                {
                    uploadFilm.Visible      = true;
                    createFilmAsset.Visible = true;
                }
            }
            else
            {
                uploadFilm.Visible      = true;
                createFilmAsset.Visible = true;
            }
        }
Example #6
0
        private void filmCollections_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListBox box = (ListBox)sender;

            FilmCollection col = (FilmCollection)box.SelectedItem;

            filmCollection.Text = col.Name;
            newCollection       = false;

            saveCollection.Enabled = false;
            saveCollection.Text    = "Update";

            Film film = col.Film;

            if (!film.Uploaded)
            {
                uploadFilmCollection.Enabled = true;
                createFilmAsset.Enabled      = false;
            }
            else if (!film.AssetCreated)
            {
                uploadFilmCollection.Enabled = false;
                createFilmAsset.Enabled      = true;
            }
            else
            {
                uploadFilmCollection.Enabled = false;
                createFilmAsset.Enabled      = false;
            }

            deleteCollection.Enabled = true;
        }
Example #7
0
        private async void films_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            FilmCollection col = (FilmCollection)filmCollectionDropdown.SelectedItem;

            filmSortColumn = e.Column;

            await ShowFilms(col.FilmCollectionID, e.Column);
        }
Example #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FilmCollection webFilmCollection = Utility.MakeRequest <FilmCollection>(ConfigurationManager.AppSettings["apiurl"]);

        webFilmCollectionViewer.DataSource     = webFilmCollection.Results;
        webFilmCollectionViewer.ItemDataBound += WebFilmCollectionViewer_ItemDataBound;
        webFilmCollectionViewer.DataBind();
    }
Example #9
0
        public Film()
        {
            FilmCollection filmCollection = new FilmCollection();

            foreach (var film in filmCollection.GetFilmByDateNewToOld())
            {
                Console.WriteLine(film.FilmName + film.FilmInformation + film.FilmReleaseDate);
            }
        }
Example #10
0
        private async void editCollection_Click(object sender, EventArgs e)
        {
            FilmCollection col = (FilmCollection)filmCollections.SelectedItem;

            Film film = await _apiService.GetFilm(col.FilmID);

            FilmForm form = new FilmForm(_apiService, this, true, film);

            form.ShowDialog();
        }
Example #11
0
        private void uploadFilmCollection_Click(object sender, EventArgs e)
        {
            FilmCollection col  = (FilmCollection)filmCollections.SelectedItem;
            Film           film = col.Film;

            film.AssetName = Guid.NewGuid().ToString();

            UploadFilmForm form = new UploadFilmForm(this, _apiService, film, _config.Values.GetSection("AdminKey").Value);

            form.ShowDialog();
        }
Example #12
0
        public async Task UploadedFile(string fileName)
        {
            theFilms[films.SelectedItems[0].Index].Uploaded       = true;
            theFilms[films.SelectedItems[0].Index].RemoteFileName = fileName;

            uploadFilm.Enabled      = false;
            createFilmAsset.Enabled = true;

            FilmCollection col = (FilmCollection)filmCollectionDropdown.SelectedItem;

            await ShowFilms(col.FilmCollectionID, filmSortColumn);
        }
Example #13
0
        public IActionResult FilmCollectionDetails(int id)
        {
            FilmCollection col = db.FilmCollections.Include(fc => fc.Films).Where(fc => fc.FilmID == id).FirstOrDefault();

            col.Film = db.Films.Find(id);

            foreach (var film in col.Films)
            {
                film.FilmDetails = db.FilmDetails.Where(fd => fd.FilmID == film.FilmID).FirstOrDefault();
            }

            return(View(col));
        }
Example #14
0
        //private readonly FilmCollection _ListeResult = new FilmCollection();

        public dlgResults(EmberAPI.MediaContainers.Movie _ParamMovie)
        {
            // = String.Concat(Master.eLang.GetString(301, "Search Results - "), _SearchMovie.Title);
            //_ListeResult = TryFindResource("ResultDataSource") as FilmCollection;
            _ListeResult = new FilmCollection();
            API _API = new API();

            _SearchMovie = _ParamMovie;
            _ListeResult = _API.Search(_SearchMovie);
            InitializeComponent();
            //lstResults.ItemsSource = _ListeResult;
            string test = "";
            //foreach (var item in _ListeResult)
            //{
            //    lstResults.Items.Add(item);
            //}
        }
Example #15
0
        private async void saveCollection_Click(object sender, EventArgs e)
        {
            FilmCollection col = null;

            if (newCollection)
            {
                col = new FilmCollection()
                {
                    Name = filmCollection.Text
                };

                colBinding.Add(col);
            }
            else
            {
                col      = (FilmCollection)filmCollections.SelectedItem;
                col.Name = filmCollection.Text;
            }

            var newcol = await _apiService.PostFilmCollection(col);

            if (newCollection)
            {
                col = colBinding.Where(fc => fc.FilmCollectionID == 0).First();

                col.FilmCollectionID = newcol.FilmCollectionID;
                col.Name             = newcol.Name;
                col.Film             = newcol.Film;
                col.FilmID           = newcol.FilmID;

                filmCollections.SelectedIndex = filmCollections.Items.Count - 1;

                colDropBinding.Add(newcol);
                colDropBindingSource.ResetBindings(true);
            }
            else
            {
                colBinding.Where(fc => fc.FilmCollectionID == col.FilmCollectionID).First().Name = newcol.Name;
                colBindingSource.ResetBindings(true);
            }

            saveCollection.Enabled = false;
        }
Example #16
0
        private void addFilm_Click(object sender, EventArgs e)
        {
            Film newFilm = new Film()
            {
                Rating       = Rating.Universal,
                Showing      = DateTime.Parse("03/06/2021 17:00"),
                Uploaded     = false,
                AssetCreated = false
            };

            FilmCollection col = (FilmCollection)filmCollectionDropdown.SelectedItem;

            if (col.FilmCollectionID != 0)
            {
                newFilm.FilmCollectionID = col.FilmCollectionID;
            }

            FilmForm form = new FilmForm(_apiService, this, false, newFilm);

            form.ShowDialog();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Movies = new FilmCollection();
            MovieDbFactory.RegisterSettings(Movies);

            SetContentView(Resource.Layout.Main);

            var fragments = new Fragment[]
            {
                this._searchFragment   = new SearchFragment(Movies),
                this._topRatedFragment = new TopRatedFragment(Movies)
            };

            var titles = CharSequence.ArrayFromStringArray(new[] { "Search", "Top Rated" });

            var viewPager = FindViewById <ViewPager>(Resource.Id.viewpager);

            viewPager.Adapter = new TabsFragmentPagerAdapter(SupportFragmentManager, fragments, titles);

            var tabLayout = this.FindViewById <TabLayout>(Resource.Id.sliding_tabs);

            tabLayout.SetupWithViewPager(viewPager);

            tabLayout.TabSelected += async(sender, args) =>
            {
                if (fragments[args.Tab.Position] == this._topRatedFragment)
                {
                    this.ActionBar.Title = "Top Rated";
                    await this._topRatedFragment.GetTopRatedAsync();
                }
            };

            var toolbar = this.FindViewById <Toolbar>(Resource.Id.toolbar);

            this.SetActionBar(toolbar);
            this.ActionBar.Title = "Movie Search";
        }
Example #18
0
        public IActionResult FilmDetails(int id)
        {
            Film        film    = db.Films.Include(f => f.FilmCategory).Where(f => f.FilmID == id).FirstOrDefault();
            FilmDetails details = db.FilmDetails.Include(fd => fd.StillUrls).Where(fd => fd.FilmID == id).FirstOrDefault();
            List <Film> films   = null;

            if (film.FilmCategory.Description == Film.SHORT_COLLECTION)
            {
                FilmCollection col = db.FilmCollections.Where(fc => fc.FilmID == id).FirstOrDefault();

                films = db.Films.Where(f => f.FilmCollectionID == col.FilmCollectionID).ToList();

                foreach (var thisfilm in films)
                {
                    thisfilm.FilmDetails = db.FilmDetails.Where(fd => fd.FilmID == thisfilm.FilmID).FirstOrDefault();
                }
            }

            FilmDetailsViewModel vm = new FilmDetailsViewModel()
            {
                Film        = film,
                FilmDetails = details,
                Films       = films
            };

            if (CurrentMember != null)
            {
                var memberFilm = db.MemberFilms.Where(mf => mf.FilmID == id && mf.MemberID == CurrentMember.MemberID).FirstOrDefault();
                ViewBag.Booked = memberFilm != null;
            }
            else
            {
                ViewBag.Booked = false;
            }

            return(View(vm));
        }
Example #19
0
        private static void LoadSchedules()
        {
            FilmCollection filmsCollection = Utility.MakeRequest <FilmCollection> (APIURL);

            filmsCollection.RequestWikipediaUrl();
            Film powerRangersFilm = new Film();

            powerRangersFilm.Title    = "Power Rangers";
            powerRangersFilm.Genre    = FilmGenre.Action;
            powerRangersFilm.Duration = 125;
            powerRangersFilm.Is3D     = false; //superfluo

            Film DancesWithWolfesFilm = new Film();

            DancesWithWolfesFilm.Title    = "Dances With Wolfes";
            DancesWithWolfesFilm.Genre    = FilmGenre.Action;
            DancesWithWolfesFilm.Duration = 236;
            DancesWithWolfesFilm.Is3D     = false; //superfluo

            Schedule PowerRangersSchedule = new Schedule();

            PowerRangersSchedule.Film          = powerRangersFilm;
            PowerRangersSchedule.ScreeningRoom = GetScreeningRoombyName("3");
            //PowerRangersSchedule.SetHour(timeRanges[timeRanges.Length],0);
            PowerRangersSchedule.NumberOfAvailableSeats = PowerRangersSchedule.ScreeningRoom.NumberOfSeats;



            int maxLenght = LAST_PROJECTION - FIRST_PROJECTION;

            if (maxLenght / (DancesWithWolfesFilm.Duration + 30) + 1 >= 3)
            {
                if (FIRST_PROJECTION + (DancesWithWolfesFilm.Duration + 30) * 2 < LAST_PROJECTION)
                {
                }
            }
        }
Example #20
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            this.Window = new UIWindow(UIScreen.MainScreen.Bounds);

            var movies = new FilmCollection();

            MovieDbFactory.RegisterSettings(movies);

            var movieController           = new ViewController(movies._movies);
            var movieNavigationController = new UINavigationController(movieController);

            var topRatedController           = new TopRatedMovieController(movies._movies);
            var topRatedNavigationController = new UINavigationController(topRatedController);

            var tabBarController = new TabBarController()
            {
                ViewControllers = new UINavigationController[] { movieNavigationController, topRatedNavigationController }
            };


            this.Window.RootViewController = tabBarController;
            this.Window.MakeKeyAndVisible();
            return(true);
        }
Example #21
0
        //Lance la recherche
        public FilmCollection Search(Movie MovieSearch, Query QueryType, Lang QueryLang, Format QueryFormat)
        {
            FilmCollection _Result      = new FilmCollection();
            Film           _Movie       = new Film();
            string         _QueryType   = "Title";
            string         _QueryLang   = "fr";
            string         _QueryFormat = "XML";
            string         _Query       = "";

            #region Options

            //Type de recherche
            switch (QueryType)
            {
            case Query.Title:
                _QueryType = "Title";
                _Query     = MovieSearch.Title;
                break;

            case Query.IMDB:
                _QueryType = "IMDB";
                _Query     = MovieSearch.IMDBID;
                break;

            default:
                _QueryType = "Title";
                _Query     = MovieSearch.Title;
                break;
            }

            //Langue
            switch (QueryLang)
            {
            case Lang.French:
                _QueryLang = "fr";
                break;

            case Lang.English:
                _QueryLang = "en";
                break;

            default:
                _QueryLang = "en";
                break;
            }

            //Format de retour
            switch (QueryFormat)
            {
            case Format.XML:
                _QueryFormat = "XML";
                break;

            default:
                _QueryFormat = "XML";
                break;
            }

            #endregion

            string _URLSearch = @"http://passion-xbmc.org/scraper/API/1/Movie.Search/" +
                                _QueryType + "/" + _QueryLang + "/" + _QueryFormat + "/" + API_KEY + "/" + _Query;

            XmlDocument _XMLResult  = Fetch(_URLSearch);
            XmlNodeList _ChildMovie = _XMLResult.GetElementsByTagName("movie");
            foreach (XmlNode _NodeMovie in _ChildMovie)
            {
                _Movie               = new Film();
                _Movie.Id            = _NodeMovie["id"].InnerText;
                _Movie.Id_Allocine   = _NodeMovie["id_allocine"].InnerText;
                _Movie.Id_IMDB       = _NodeMovie["id_imdb"].InnerText;
                _Movie.LastChange    = _NodeMovie["last_change"].InnerText;
                _Movie.Url           = _NodeMovie["url"].InnerText;
                _Movie.Title         = _NodeMovie["title"].InnerText;
                _Movie.OriginalTitle = _NodeMovie["originaltitle"].InnerText;
                _Movie.Year          = _NodeMovie["year"].InnerText;
                _Movie.Runtime       = _NodeMovie["runtime"].InnerText;
                _Movie.Plot          = _NodeMovie["plot"].InnerText;
                if (_NodeMovie["tagline"] != null)
                {
                    _Movie.Tagline = _NodeMovie["tagline"].InnerText;
                }
                //_Movie.Title = _NodeMovie["runtime"].InnerText;
                //_Movie.Title = _NodeMovie["information"].InnerText;

                //Cover
                if (_NodeMovie["images"] != null)
                {
                    XmlNodeList _ChildImages = _NodeMovie["images"].ChildNodes;
                    foreach (XmlNode _NodeImage in _ChildImages)
                    {
                        Thumb _Image = new Thumb();

                        //if (_NodeImage.Attributes["type"].InnerText == "Poster" && _NodeImage.Attributes["size"].InnerText == "thumb")
                        //{
                        //    _Image.URLImage = _NodeImage.Attributes["url"].InnerText;
                        //    _Movie.ListeCover.Add(_Image);
                        //}
                        if (_NodeImage.Attributes["type"].InnerText == "Poster" && _NodeImage.Attributes["size"].InnerText == "preview")
                        {
                            _Image.URLImage = _NodeImage.Attributes["url"].InnerText;
                            _Movie.ListeCover.Add(_Image);
                        }
                        if (_NodeImage.Attributes["type"].InnerText == "Fanart" && _NodeImage.Attributes["size"].InnerText == "original")
                        {
                            _Image.URLImage = _NodeImage.Attributes["url"].InnerText;
                            _Movie.ListeFanart.Add(_Image);
                        }
                    }
                }

                _Result.Add(_Movie);
            }


            return(_Result);
        }
Example #22
0
        public async Task <FilmCollection> PostFilmCollection(FilmCollection col)
        {
            FilmCollection newCol = await ApiComplexPost <FilmCollection, FilmCollection>(BasePath + "api/Admin/PostFilmCollection", col);

            return(newCol);
        }
 public MainPage(FilmCollection movies)
 {
     InitializeComponent();
 }
Example #24
0
 public SearchFragment(FilmCollection movieList)
 {
     this._movieCollection = movieList;
 }
Example #25
0
 public TopRatedPage(FilmCollection Movies)
 {
     this._modelView     = new TopRatedViewModel(this.Navigation, Movies._movies);
     this.BindingContext = this._modelView;
     InitializeComponent();
 }
Example #26
0
 public TopRatedFragment(FilmCollection movies)
 {
     this._movieCollection = movies;
 }
        public void Save()
        {
            ValidateBuchung(true);
            // Overwrite Modified Items (Buchung)
            foreach (Buchung buchung in BuchungCollection)
            {
                Buchung dbitem = mDao.mKino.Buchung.Where(o => o.ID == buchung.ID).FirstOrDefault <Buchung>();
                if (dbitem.Email != buchung.Email || dbitem.Name != buchung.Name || dbitem.PlatzNr != buchung.PlatzNr || dbitem.VorfuehrungID != buchung.VorfuehrungID)
                {
                    SetBuchungItem(dbitem, buchung);
                }
            }
            // Added items
            foreach (Buchung buchung in BuchungCollection)
            {
                Buchung dbitem = mDao.mKino.Buchung.Where(o => o.ID == buchung.ID).FirstOrDefault <Buchung>();
                if (dbitem == null)
                {
                    mDao.mKino.Buchung.Add(buchung);
                }
            }
            // Removed items
            List <Buchung> delItemsB = new List <Buchung>();

            foreach (Buchung dbitem in mDao.mKino.Buchung)
            {
                Buchung buchung = BuchungCollection.Where(o => o.ID == dbitem.ID).FirstOrDefault <Buchung>();
                if (buchung == null)
                {
                    delItemsB.Add(dbitem);
                }
            }
            foreach (Buchung delItem in delItemsB)
            {
                mDao.mKino.Buchung.Remove(delItem);
            }

            // Overwrite Modified Items (Vorfuehrung)
            foreach (Vorfuehrung vorfuehrung in VorfuehrungCollection)
            {
                Vorfuehrung dbitem = mDao.mKino.Vorfuehrung.Where(o => o.ID == vorfuehrung.ID).FirstOrDefault <Vorfuehrung>();
                if (dbitem.Bezeichnung != vorfuehrung.Bezeichnung || dbitem.Datum != vorfuehrung.Datum || dbitem.FilmID != vorfuehrung.FilmID || dbitem.SaalID != vorfuehrung.SaalID)
                {
                    SetVorfuehrungItem(dbitem, vorfuehrung);
                }
            }
            // Added items
            foreach (Vorfuehrung vorfuehrung in VorfuehrungCollection)
            {
                Vorfuehrung dbitem = mDao.mKino.Vorfuehrung.Where(o => o.ID == vorfuehrung.ID).FirstOrDefault <Vorfuehrung>();
                if (dbitem == null)
                {
                    mDao.mKino.Vorfuehrung.Add(vorfuehrung);
                }
            }
            // Removed items
            List <Vorfuehrung> delItemsV = new List <Vorfuehrung>();

            foreach (Vorfuehrung dbitem in mDao.mKino.Vorfuehrung)
            {
                Vorfuehrung vorfuehrung = VorfuehrungCollection.Where(o => o.ID == dbitem.ID).FirstOrDefault <Vorfuehrung>();
                if (vorfuehrung == null)
                {
                    delItemsV.Add(dbitem);
                }
            }
            foreach (Vorfuehrung delItem in delItemsV)
            {
                mDao.mKino.Vorfuehrung.Remove(delItem);
            }

            // Overwrite Modified Items
            foreach (Saal saal in SaalCollection)
            {
                Saal dbitem = mDao.mKino.Saal.Where(o => o.ID == saal.ID).FirstOrDefault <Saal>();
                if ((dbitem.AnzahlPlaetze != saal.AnzahlPlaetze) || dbitem.Bezeichnung != saal.Bezeichnung || dbitem.Dreidimensional != saal.Dreidimensional)
                {
                    SetSaalItem(dbitem, saal);
                }
            }
            // Added items
            foreach (Saal saal in SaalCollection)
            {
                Saal dbitem = mDao.mKino.Saal.Where(o => o.ID == saal.ID).FirstOrDefault <Saal>();
                if (dbitem == null)
                {
                    mDao.mKino.Saal.Add(saal);
                }
            }
            // Removed items
            List <Saal> delItemsS = new List <Saal>();

            foreach (Saal dbitem in mDao.mKino.Saal)
            {
                Saal saal = SaalCollection.Where(o => o.ID == dbitem.ID).FirstOrDefault <Saal>();
                if (saal == null)
                {
                    delItemsS.Add(dbitem);
                }
            }
            foreach (Saal delItem in delItemsS)
            {
                mDao.mKino.Saal.Remove(delItem);
            }

            // Overwrite Modified Items (Film)
            foreach (Film film in FilmCollection)
            {
                Film dbitem = mDao.mKino.Film.Where(o => o.ID == film.ID).FirstOrDefault <Film>();
                if (dbitem.Bezeichnung != film.Bezeichnung || dbitem.Dauer != film.Dauer || dbitem.FSK18 != film.FSK18 || dbitem.Preis != film.Preis)
                {
                    SetFilmItem(dbitem, film);
                }
            }
            // Added items
            foreach (Film film in FilmCollection)
            {
                Film dbitem = mDao.mKino.Film.Where(o => o.ID == film.ID).FirstOrDefault <Film>();
                if (dbitem == null)
                {
                    mDao.mKino.Film.Add(film);
                }
            }
            // Removed items
            List <Film> delItemsF = new List <Film>();

            foreach (Film dbitem in mDao.mKino.Film)
            {
                Film film = FilmCollection.Where(o => o.ID == dbitem.ID).FirstOrDefault <Film>();
                if (film == null)
                {
                    delItemsF.Add(dbitem);
                }
            }
            foreach (Film delItem in delItemsF)
            {
                mDao.mKino.Film.Remove(delItem);
            }
            mDao.Save();
        }
Example #28
0
        public async void UpdateFilmList(Film film)
        {
            FilmCollection col = (FilmCollection)filmCollectionDropdown.SelectedItem;

            await ShowFilms(col.FilmCollectionID, filmSortColumn);
        }
Example #29
0
        public async Task <ActionResult> PurchaseTicket(int FilmID, decimal Amount)
        {
            if (Amount > 0)
            {
                Donation donation = new Donation()
                {
                    FilmID = FilmID, Amount = Amount, MemberID = CurrentMember.MemberID
                };

                db.Donations.Add(donation);
                db.SaveChanges();
            }

            Film film     = db.Films.Include(f => f.FilmCollection).Where(f => f.FilmID == FilmID).First();
            int  memberID = CurrentMember.MemberID;

            bool booked = BookPurchase(FilmID);

            if (booked)
            {
            }

            if (FilmID == 243)
            {
                booked = BookPurchase(84);
            }

            var user = await _userManager.FindByIdAsync(LoggedInUserASPID);

            string email = user.Email;

            string title  = film.Title;
            string screen = "";

            if (film.FilmDetails != null)
            {
                film.FilmDetails.Screen.GetDescription();
            }

            FilmCollection col = db.FilmCollections.Where(fc => fc.FilmID == film.FilmID).FirstOrDefault();

            if (col != null)
            {
                title = col.Name;
            }

            string message = "<p>Thank you for booking '" + title + "'</p><p>Showing: " + film.Showing.ToString("dddd dd MMMM yyyy HH:mm") + "</p><p>Screen: " + screen + "</p>";

            if (film.FilmID == 243)
            {
                message += "<p>Thank you for booking The Opening Night Presentation with the film Adverse and the live Q&A. <br/>Go to www.ramsgatedigitalcinema.co.uk to watch the Presentation and the film.<br/>Here’s the link to join the live Q&A after the screening:<br/>Topic: Q & A Adverse<br/>Time: Jun 3, 2021 09:15 PM London<br/>Doin Zoom Meeting<br/><a href='https://zoom.us/j/96259752381?pwd=K0t5WUFTSHo2bEZYbzEyZWdpRGNWQT09'>https://zoom.us/j/96259752381?pwd=K0t5WUFTSHo2bEZYbzEyZWdpRGNWQT09</a><br/>Meeting ID: 962 5975 2381<br/>Passcode: 943932<br/><br/>Enjoy the Festival<br/>The team at Ramsgate International Film & TV Festival 2021</p>";
            }
            else if (film.FilmID == 244)
            {
                message += "<p>Thank you for booking the CODUMENTARY – IN CONVERSATION WITH JONATHAN BEALES event with the Screening of the film <br/>First, here’s the link to join the live Q&A after the screening: <br/><br/>Topic: CODumentary Master Class <br /> Time: Jun 4, 2021 10:30 AM London<br/><br /> Join Zoom Meeting<br/><a href = 'https://zoom.us/j/94669303654?pwd=clc4S1FOVXZjOFIzcGl1TWpmd1JpUT09'>https://zoom.us/j/94669303654?pwd=clc4S1FOVXZjOFIzcGl1TWpmd1JpUT09</a><br/><br/>Meeting ID: 946 6930 3654 <br /> Passcode: 325456 <br /><br /> Then when the talk is over, go to www.ramsgatedigitalcinema.co.uk to watch the film.<br /><br /> Enjoy the Festival<Br/><br /> The team at Ramsgate International Film & TV Festival 2021 </p> ";
            }
            else if (film.FilmID == 245)
            {
                message += "<p>Thank you for booking the HOW TO GET AN AGENT, WHEN YOU’RE AN ACTOR event <br/>Here’s the link on how to join the live talk:<br/><br/>Topic: How To Get An Agent<br/><br/>Time: Jun 4, 2021 03:00 PM London<br/><br/>Join Zoom Meeting <a href='https://zoom.us/j/91342663574?pwd=ZkpkVEx4MERjMnNOdTdsZHoyTXZkQT09'>https://zoom.us/j/91342663574?pwd=ZkpkVEx4MERjMnNOdTdsZHoyTXZkQT09</a><br/><br/>Meeting ID: 913 4266 3574<br/>Passcode: 216213<br/><br/>Enjoy the Festival<br/><br/>The team at Ramsgate International Film & TV Festival 2021<br/></p>";
            }
            else if (film.FilmID == 246)
            {
                message += "<p>Thank you for booking to attend the NETWORKING PARTY <br/><br/>Here’s the link on how to join the party:<br/>Topic: Networking Party<br/>Time: Jun 4, 2021 06:00 PM London<br/><br/>Join Zoom Meeting<br/><a href='https://zoom.us/j/96017385019?pwd=UEpjRnFXUmFLZjkxR3FVcGFVcFl6dz09'>https://zoom.us/j/96017385019?pwd=UEpjRnFXUmFLZjkxR3FVcGFVcFl6dz09</a><br/><br/>Meeting ID: 960 1738 5019<br/>Passcode: 886708<br/><br/>Enjoy the Festival<br/>The team at Ramsgate International Film & TV Festival 2021<br/></p>";
            }
            else if (film.FilmID == 186)
            {
                message += "<p>Thank you for booking the screening of PHIL LIGGETT: THE VOICE OF CYCLING and the live Q&A. <br/><br/>Go to www.ramsgatedigitalcinema.co.uk to watch the Film<br/><br/>Then, here’s the link to join the live Q&A after the screening:<br/><br/>Topic: Phil Liggett: the Voice of Cycling Q & A<br/><br/>Time: Jun 5, 2021 08:15 PM London<br/><br/>Join Zoom Meeting<br/><br/><a href='https://zoom.us/j/99575075739?pwd=L1BIbTh5dUZPUXBLVTkyVy81M25kUT09'>https://zoom.us/j/99575075739?pwd=L1BIbTh5dUZPUXBLVTkyVy81M25kUT09</a><br/><br/>Meeting ID: 995 7507 5739<br/>Passcode: 949960</p>";
            }
            else if (film.FilmID == 249)
            {
                message += "<p>Thank you for booking TONTON MANU the live Q&A. <br/><br/>Go to www.ramsgatedigitalcinema.co.uk to watch the Film<br/><br/>Then, here’s the link to join the live Q&A after the screening:<br/><br/>Topic: Tonton Manu Q & A<br/><br/>Time: Jun 6, 2021 07:15 PM London<br/><br/>Join Zoom Meeting<br/><a href='https://zoom.us/j/99362988485?pwd=cTlERTFFSGhpaExsdmp3d0duRm4vUT09'>https://zoom.us/j/99362988485?pwd=cTlERTFFSGhpaExsdmp3d0duRm4vUT09</a><br/>Meeting ID: 993 6298 8485<br/>Passcode: 402477<br/></p>";
            }
            else if (film.FilmID == 250)
            {
                message += "<p>Thank you for booking THE AWARDS PRESENTATION  <br/><br/>Here’s the link to join us:<br/><br/>Topic: Awards Presentation<br/>Time: Jun 6, 2021 08:30 PM London<br/><br/>Join Zoom Meeting<br/><a href='https://zoom.us/j/97045349594?pwd=QUFRQk9qWTdhN0cwTFJ0SUJQVU9mdz09'>https://zoom.us/j/97045349594?pwd=QUFRQk9qWTdhN0cwTFJ0SUJQVU9mdz09</a><br/><br/>Meeting ID: 970 4534 9594<br/>Passcode: 523394<br/>Enjoy the Festival<br/><br/>The team at Ramsgate International Film & TV Festival 2021</p>";
            }

            await _emailSender.SendEmailAsync(email, "Booked Film", message);

            return(Content("SUCCESS"));
        }