Beispiel #1
0
    protected void btnAddGuarantors_Click(object sender, EventArgs e)
    {
        Guid  show_ID = new Guid(Show_ID);
        Shows show    = new Shows(_connString, show_ID);

        if (ValidateGuarantors(show))
        {
            MembershipUser userInfo = Membership.GetUser();
            Guid           user_ID  = (Guid)userInfo.ProviderUserKey;

            Guarantors guarantor = new Guarantors(_connString);
            guarantor.Show_ID             = show_ID;
            guarantor.Chairman_Person_ID  = new Guid(Chairman_ID);
            guarantor.Secretary_Person_ID = new Guid(Secretary_ID);
            guarantor.Treasurer_Person_ID = new Guid(Treasurer_ID);
            if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
            {
                guarantor.Committee1_Person_ID = new Guid(Committee1_ID);
                guarantor.Committee2_Person_ID = new Guid(Committee2_ID);
                guarantor.Committee3_Person_ID = new Guid(Committee3_ID);
            }
            Guid?guarantor_ID;
            guarantor_ID = guarantor.Insert_Guarantor(user_ID);
            if (!string.IsNullOrEmpty(guarantor_ID.ToString()))
            {
                Guarantor_ID                = guarantor_ID.ToString();
                Common.Guarantor_ID         = Guarantor_ID;
                Common.GuarantorsPopulated  = true;
                divAddGuarantors.Visible    = false;
                divUpdateGuarantors.Visible = true;
                MessageLabel.Text           = "Guarantors added successfully.";
            }
        }
    }
Beispiel #2
0
        void ClearDatabase()
        {
            musicDatabase.DeleteAll();
            musicDatabase.DeleteAll();
            musicDatabase.DeleteAll();
            trackCollectionRepository.DeleteAll();
            tracklistItemRepository.DeleteAll();

            musicDatabase.Initialize();
            musicDatabase.Initialize();
            musicDatabase.Initialize();
            trackCollectionRepository.Initialize();
            tracklistItemRepository.Initialize();

            Artists.Clear();
            Albums.Clear();
            Tracks.Clear();
            TrackCollections.Clear();

            videoDatabase.DeleteAll();

            Videos.Clear();
            CameraRoll.Clear();
            Shows.Clear();
        }
Beispiel #3
0
        public async Task AddTvShow(VideoItem episode)
        {
            episode.IsTvShow = true;
            try
            {
                TvShow show = Shows.FirstOrDefault(x => x.ShowTitle == episode.ShowTitle);
                if (show == null)
                {
                    // Generate a thumbnail for the show
                    await Locator.MediaLibrary.FetchVideoThumbnailOrWaitAsync(episode);

                    show = new TvShow(episode.ShowTitle);
                    show.Episodes.Add(episode);
                    Shows.Add(show);
                }
                else
                {
                    if (show.Episodes.FirstOrDefault(x => x.Id == episode.Id) == null)
                    {
                        await DispatchHelper.InvokeAsync(CoreDispatcherPriority.Normal, () => show.Episodes.Add(episode));
                    }
                }
            }
            catch (Exception e)
            {
                LogHelper.Log(StringsHelper.ExceptionToString(e));
            }
        }
Beispiel #4
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ShowId,LastChangeDate,LaseChangeUserId,CheckIn,Start,End,EventId")] Shows shows)
        {
            if (id != shows.ShowId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    Shows result = await _showService.EditAsync(id, shows);
                }
                catch (DbUpdateConcurrencyException)
                {
                    throw;
                }
                catch (KeyNotFoundException)
                {
                    return(NotFound());
                }
                return(RedirectToAction(nameof(Index)));
            }
            //ViewData["EventId"] = new SelectList(_context.Events, "EventId", "Name", shows.EventId);
            //ViewData["LaseChangeUserId"] = new SelectList(_context.Users, "UserId", "FirstName", shows.LaseChangeUserId);
            return(View(shows));
        }
Beispiel #5
0
        public async Task Initialize()
        {
            Artists.Clear();
            Albums.Clear();
            Tracks.Clear();
            TrackCollections.Clear();

            Videos.Clear();
            CameraRoll.Clear();
            Shows.Clear();

            if (_alreadyIndexedOnce)
            {
                return;
            }
            _alreadyIndexedOnce = true;
            // Doing full indexing from scratch if 0 tracks are found
            if (IsMusicDatabaseEmpty() && IsVideoDatabaseEmpty())
            {
                ClearDatabase();
            }
            else // Restore the database
            {
                LoadVideosFromDatabase();
                await LoadShowsFromDatabase();

                LoadCameraRollFromDatabase();
            }
            await PerformMediaLibraryIndexing();
        }
Beispiel #6
0
        private async void reloadBtn_Click(object sender, EventArgs e)
        {
            if (_rotationId.HasValue)
            {
                var rotation = await _apiService.GetById <Model.Rotation>(_rotationId);

                From.Value        = rotation.From.Date;
                To.Value          = rotation.To.Date;
                Description.Text  = rotation.Description;
                Available.Checked = rotation.Available;
                Birthday.Checked  = rotation.ForBirthday;
                var movie = await _moviesApi.GetById <Model.Movie>(rotation.MovieId);

                var show = await _showsApi.GetById <Model.Show>(rotation.ShowId);

                Movies.SelectedIndex = Movies.FindStringExact(movie.Title);
                Shows.SelectedIndex  = Shows.FindStringExact(show.Title);
            }
            else
            {
                From.Value           = DateTime.Now;
                To.Value             = DateTime.Now;
                Description.Text     = "";
                Available.Checked    = false;
                Birthday.Checked     = false;
                Movies.SelectedIndex = -1;
                Shows.SelectedIndex  = -1;
            }
        }
        public async Task LoadData()
        {
            LoadedPages++;
            var results = await Task.Run(() => TMDBService.Search(Query["query"], LoadedPages, 1));

            foreach (var v in results.OnlyWithImages())
            {
                Results.Add(v);
                if (v.media_type.Equals("movie"))
                {
                    Movies.Add(v);
                }
                if (v.media_type.Equals("tv"))
                {
                    Shows.Add(v);
                }
                if (v.media_type.Equals("person"))
                {
                    People.Add(v);
                }
            }

            if (results.Count != 0)
            {
                LoadedMore();
            }
            else
            {
                NoMore();
            }
        }
Beispiel #8
0
        static public void LoadShows(ShowsLoadCount loadCount)
        {
            Task.Run(() =>
            {
                if (IsRun)
                {
                    return;
                }
                IsRun     = true;
                int count = (int)loadCount;

                var ids = ImdbIDs.GetRange(0, count);
                ImdbIDs.RemoveRange(0, count);

                foreach (var id in ids)
                {
                    var show = GetShow(id);
                    Shows.Add(show);
                    var bitmap = GetBitmap(show.PosterLink);
                    ShowsBitmaps.Add(bitmap);
                }
                IsRun = false;
                ShowsAdd?.Invoke();
            });
        }
Beispiel #9
0
    private void PopulateLinkedShowGridView()
    {
        Guid               club_ID      = new Guid(Club_ID);
        int                show_Year_ID = Int32.Parse(Show_Year_ID);
        LinkedShows        linkedShows  = new LinkedShows(_connString);
        List <LinkedShows> lnkLinkedShows;

        lnkLinkedShows = linkedShows.GetLinked_Shows();
        List <LinkedShows> linkedShowList = new List <LinkedShows>();

        foreach (LinkedShows linkedShowRow in lnkLinkedShows)
        {
            Shows parentShow = new Shows(_connString, linkedShowRow.Parent_Show_ID);
            Shows childShow  = new Shows(_connString, linkedShowRow.Child_Show_ID);
            if (parentShow.Club_ID == club_ID && parentShow.Show_Year_ID == show_Year_ID)
            {
                LinkedShows newLinkedShow = new LinkedShows(_connString, linkedShowRow.Linked_Show_ID);
                newLinkedShow.Parent_Show_Name  = parentShow.Show_Name;
                newLinkedShow.Parent_Show_Opens = parentShow.Show_Opens;
                newLinkedShow.Child_Show_Name   = childShow.Show_Name;
                newLinkedShow.Child_Show_Opens  = childShow.Show_Opens;
                linkedShowList.Add(newLinkedShow);
            }
        }
        if (linkedShowList != null && linkedShowList.Count > 0)
        {
            LinkedShowsGridView.DataSource = linkedShowList;
            LinkedShowsGridView.DataBind();
            divClubLinkedShows.Visible = true;
        }
        else
        {
            divClubLinkedShows.Visible = false;
        }
    }
        public static TmdbShowImages GetShowImages(int?id, bool forceUpdate = false)
        {
            if (id == null)
            {
                return(null);
            }

            // if its in our cache return it
            var showImages = Shows.FirstOrDefault(s => s.Id == id);

            if (showImages != null)
            {
                if (forceUpdate)
                {
                    return(showImages);
                }

                // but only if the request is not very old
                if (DateTime.Now.Subtract(new TimeSpan(TraktSettings.TmdbShowImageMaxCacheAge, 0, 0, 0, 0)) < Convert.ToDateTime(showImages.RequestAge))
                {
                    return(showImages);
                }

                TraktLogger.Info("Show image cache expired. TMDb ID = '{0}', Request Age = '{1}'", id, showImages.RequestAge);
                RemoveShowImagesFromCache(showImages);
            }

            // get movie images from tmdb and add to the cache
            showImages = TmdbAPI.TmdbAPI.GetShowImages(id.ToString());
            AddShowImagesToCache(showImages);

            return(showImages);
        }
 static void RemoveShowImagesFromCache(TmdbShowImages images)
 {
     if (images != null)
     {
         Shows.RemoveAll(s => s.Id == images.Id);
     }
 }
    private bool ValidEntry()
    {
        bool              valid   = true;
        Guid              show_ID = new Guid(Show_ID);
        Shows             show    = new Shows(_connString, show_ID);
        List <DogClasses> tblDogClasses;
        DogClasses        dogClasses = new DogClasses(_connString);
        Guid              entrant_ID = new Guid(Entrant_ID);

        tblDogClasses = dogClasses.GetDog_ClassesByEntrant_ID(entrant_ID);
        short dogClassCount = 0;

        if (string.IsNullOrEmpty(Handler_ID) && lstClasses.SelectedItem.Text != "NFC")
        {
            MessageLabel.Text = "You must select the Handler.";
            valid             = false;
        }
        if (!string.IsNullOrEmpty(Dog_ID) && lstClasses.SelectedItem.Text != "NFC")
        {
            Guid dog_ID = new Guid(Dog_ID);
            Dogs dog    = new Dogs(_connString, dog_ID);
            if (!IsCorrectClassGender(dog))
            {
                MessageLabel.Text = "This dog is the wrong gender for this class.";
                valid             = false;
            }
        }
        foreach (DogClasses row in tblDogClasses)
        {
            if (!row.IsShow_Entry_Class_IDNull && row.Show_Entry_Class_ID != new Guid() && Dog_ID == row.Dog_ID.ToString())
            {
                if (Show_Entry_Class_ID == row.Show_Entry_Class_ID.ToString())
                {
                    MessageLabel.Text = string.Format("You have already entered this dog in {0}.", GetClassName((Guid)row.Show_Entry_Class_ID));
                    valid             = false;
                }
                else if (lstClasses.SelectedItem.Text == "NFC" && GetClassName((Guid)row.Show_Entry_Class_ID) != "NFC")
                {
                    MessageLabel.Text = "This dog is already entered in other classes, so cannot be NFC";
                    valid             = false;
                }
                else if (GetClassName((Guid)row.Show_Entry_Class_ID) == "NFC")
                {
                    MessageLabel.Text = "This dog is entered NFC so cannot be entered in other classes.";
                    valid             = false;
                }
                if (valid)
                {
                    dogClassCount += 1;
                    if (dogClassCount >= show.MaxClassesPerDog)
                    {
                        MessageLabel.Text = string.Format("There is a maximum of {0} classes per dog for this show.", show.MaxClassesPerDog.ToString());
                        valid             = false;
                    }
                }
            }
        }

        return(valid);
    }
Beispiel #13
0
        /// <summary>
        /// Search shows asynchronously
        /// </summary>
        public override async Task LoadShowsAsync(bool reset = false)
        {
            await LoadingSemaphore.WaitAsync(CancellationLoadingShows.Token);

            StopLoadingShows();
            if (reset)
            {
                Shows.Clear();
                Page           = 0;
                VerticalScroll = 0d;
            }

            var watch = Stopwatch.StartNew();

            Page++;
            if (Page > 1 && Shows.Count == MaxNumberOfShows)
            {
                Page--;
                LoadingSemaphore.Release();
                return;
            }

            Logger.Info(
                $"Loading search page {Page} with criteria: {SearchFilter}");
            HasLoadingFailed = false;
            try
            {
                IsLoadingShows = true;
                var result =
                    await ShowService.SearchShowsAsync(SearchFilter,
                                                       Page,
                                                       MaxNumberOfShows,
                                                       Genre,
                                                       Rating * 10,
                                                       CancellationLoadingShows.Token);

                Shows.AddRange(result.shows.Except(Shows, new ShowLightComparer()));
                IsLoadingShows       = false;
                IsShowFound          = Shows.Any();
                CurrentNumberOfShows = Shows.Count;
                MaxNumberOfShows     = result.nbShows;
                UserService.SyncShowHistory(Shows);
            }
            catch (Exception exception)
            {
                Page--;
                Logger.Error(
                    $"Error while loading search page {Page} with criteria {SearchFilter}: {exception.Message}");
                HasLoadingFailed = true;
                Messenger.Default.Send(new ManageExceptionMessage(exception));
            }
            finally
            {
                watch.Stop();
                var elapsedMs = watch.ElapsedMilliseconds;
                Logger.Info(
                    $"Loaded search page {Page} with criteria {SearchFilter} in {elapsedMs} milliseconds.");
                LoadingSemaphore.Release();
            }
        }
Beispiel #14
0
    private void PopulateShow(string show_ID)
    {
        Guid  newShow_ID = new Guid(show_ID);
        Shows show       = new Shows(_connString, newShow_ID);

        Show_Year_ID = show.Show_Year_ID.ToString();
        lstShowYears.SelectedValue = Show_Year_ID;
        Show_Type_ID = show.Show_Type_ID.ToString();
        lstShowTypes.SelectedValue = Show_Type_ID;
        Show_Name        = show.Show_Name;
        txtShowName.Text = Show_Name;
        string format = "yyy-MM-dd hh:mm";

        Show_Opens              = DateTime.Parse(show.Show_Opens.ToString()).ToString(format);
        txtShowDateTime.Text    = Show_Opens;
        Judging_Commences       = DateTime.Parse(show.Judging_Commences.ToString()).ToString(format);
        txtJudgingDateTime.Text = Judging_Commences;
        if (show.Closing_Date != null)
        {
            format                = "yyy-MM-dd";
            Closing_Date          = DateTime.Parse(show.Closing_Date.ToString()).ToString(format);
            txtCloseDateTime.Text = Closing_Date;
        }
        MaxClassesPerDog         = show.MaxClassesPerDog.ToString();
        txtMaxClassesPerDog.Text = MaxClassesPerDog;
        divAddShow.Visible       = false;
        divUpdateShow.Visible    = true;
        divAddClasses.Visible    = true;
        //StoreCommon();
    }
Beispiel #15
0
    private bool HasChanges(Guarantors guarantor, Shows show)
    {
        bool Changed = false;

        if (guarantor.Chairman_Person_ID.ToString() != Chairman_ID)
        {
            Changed = true;
        }
        if (guarantor.Secretary_Person_ID.ToString() != Secretary_ID)
        {
            Changed = true;
        }
        if (guarantor.Treasurer_Person_ID.ToString() != Treasurer_ID)
        {
            Changed = true;
        }
        if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
        {
            if (guarantor.Committee1_Person_ID.ToString() != Committee1_ID)
            {
                Changed = true;
            }
            if (guarantor.Committee2_Person_ID.ToString() != Committee2_ID)
            {
                Changed = true;
            }
            if (guarantor.Committee3_Person_ID.ToString() != Committee3_ID)
            {
                Changed = true;
            }
        }


        return(Changed);
    }
Beispiel #16
0
        private Shows PopulateShows()
        {
            Movies movies = new Movies();
            Shows  shows  = new Shows();

            movies.Add("Noc żywych prowadzących", Convert.ToDateTime("1996-12-12"), 125, "Roman R.", 17,
                       "Matematyczny");
            movies.Add("Dogłębna analiza", Convert.ToDateTime("2012-11-26"), 125, "Pedro", 19, "Polski");

            shows.Add(Convert.ToDateTime("2017-12-12 12:00"), 120, 15, movies.Items[1]);
            shows.Add(Convert.ToDateTime("2017-12-12 17:00"), 120, 15, movies.Items[1]);
            shows.Add(Convert.ToDateTime("2017-12-12 8:00"), 120, 15, movies.Items[2]);

            return(shows);
            //shows.Items[1].AddReservation(new PersonalData("Bogdan", "Bobek", "123456789"),
            //    new Tuple<int, int>(5, 6));
            //shows.Items[1].AddReservation(new PersonalData("Zenon", "Ziemniak", "321654987"),
            //    new Tuple<int, int>(5, 7));
            //shows.Items[1].AddReservation(new PersonalData("Klaudiusz", "Kalafior", "321632387"),
            //    new Tuple<int, int>(3, 4));
            //shows.Items[1].AddReservation(new PersonalData("Piotr", "Pyra", "321365987"),
            //    new Tuple<int, int>(3, 5));
            //shows.Items[1].AddReservation(new PersonalData("Bartek", "Brokół", "854654987"),
            //    new Tuple<int, int>(3, 6));
            //shows.Items[2].AddReservation(new PersonalData("Bogdan", "Bobek", "123456789"),
            //    new Tuple<int, int>(7, 6));
        }
Beispiel #17
0
        public async Task OnGet()
        {
            Shows = await youTubeService.GetShows();

            UpcomingShow = Shows.LastOrDefault(show => show.IsInFuture && !show.IsOnAir);
            OnAirShow    = Shows.FirstOrDefault(show => show.IsOnAir);
        }
Beispiel #18
0
 public List <Show> GetShowsByTitle(string title)
 {
     title = title.ToLower();
     return(Shows.Where(s => s.Title.ToLower() == title ||
                        s.OriginalTitle.ToLower() == title ||
                        s.Title.ToLower() + " (" + s.OriginalTitle + ")" == title).ToList());
 }
Beispiel #19
0
        public void HasValue_example()
        {
            var field = Browser.FindField("find-this-field");

            Assert.That(field, Shows.Value("This value is what we are looking for"));
            Assert.IsFalse(field.HasValue("This is not the value"));
        }
Beispiel #20
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,EndDate,FullPrice,ConcessionPrice")] Shows shows)
        {
            if (id != shows.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shows);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShowsExists(shows.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shows));
        }
        public async Task <IActionResult> Edit(string id, [Bind("FranchiseNo,HomeNo,ShowDate,ShowTime,ShowTotalSale")] Shows shows)
        {
            if (id != shows.FranchiseNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shows);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShowsExists(shows.FranchiseNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FranchiseNo"] = new SelectList(_context.Franchise, "FranchiseNo", "FranchiseNo", shows.FranchiseNo);
            ViewData["HomeNo"]      = new SelectList(_context.Home, "HomeNo", "HomeAddress", shows.HomeNo);
            return(View(shows));
        }
Beispiel #22
0
        /// <summary>
        /// 设置显示文本
        /// </summary>
        /// <param name="strShowText"></param>
        public void SetShowText(String strShowText)
        {
            Shows        show        = new Shows(Start);
            IAsyncResult asyncResult = show.BeginInvoke(strShowText, null, null);

            show.EndInvoke(asyncResult);
        }
Beispiel #23
0
        public bool AddShow()
        {
            Show S1 = new Show();

            Console.WriteLine("Enter Theatre Name: ");
            S1.TName = Console.ReadLine();
            Console.WriteLine("Enter Movie Name: ");
            S1.MName = Console.ReadLine();
            if (S1.MName != "" && S1.TName != "")
            {
                foreach (Movie m in Movies)
                {
                    if (m.ThName == S1.TName && m.MovieName == S1.MName)
                    {
                        Console.WriteLine("Enter the Show Timing: ");
                        S1.ShowName = Console.ReadLine();
                        Shows.Add(S1);
                        Console.WriteLine(S1.ShowName + " show of " + S1.MName + " at " + S1.TName + " Theatre added.");
                        return(true);
                    }
                }
                Console.WriteLine(S1.MName + " Movie is not in " + S1.TName + " Theatre.");
                return(false);
            }
            else
            {
                Console.WriteLine("Theatre or Movie name cannot be null.");
                return(false);
            }
        }
Beispiel #24
0
        public List <ShowConfiguration> GetSortedShowItems()
        {
            List <ShowConfiguration> returnList = Shows.ToList();

            returnList.Sort(MediaConfiguration.CompareNames);
            return(returnList);
        }
Beispiel #25
0
        public long AddShows(Shows b)
        {
            long id = 0;

            try
            {
                var show = ctx.Shows.FirstOrDefault(x => x.ShowId == b.ShowId);
                if (show == null)
                {
                    ctx.Shows.Add(b);
                    id = ctx.SaveChanges();
                }
                else
                {
                    ctx.Shows.Update(b);
                    ctx.SaveChanges();
                }
            }
            catch (Exception ex)
            {
            }


            return(id);
        }
Beispiel #26
0
        public void HasContent_example()
        {
            Assert.That(browser, Shows.Content("This is what we are looking for"));
            Assert.That(browser.HasContent("This is not in the page"), Is.False);

            Assert.Throws <AssertionException>(() => Assert.That(browser, Shows.Content("This is not in the page")));
        }
Beispiel #27
0
 // Code to execute when the application is launching (eg, from Start)
 // This code will not execute when the application is reactivated
 private void Application_Launching(object sender, LaunchingEventArgs e)
 {
     if (LatestShows == null)
     {
         LatestShows = new Listings();
     }
     if (Torrents == null)
     {
         Torrents = new Torrents();
     }
     if (Shows == null)
     {
         Shows = new Shows();
     }
     if (db == null)
     {
         db = new DC();
     }
     if (!db.DatabaseExists())
     {
         db.CreateDatabase();
     }
     //pre load shows
     //if (!App.Shows.IsDataLoaded) {
     //    App.Shows.LoadData(false);
     //}
 }
Beispiel #28
0
 public void HasContentMatching_example()
 {
     Assert.That(Browser, Shows.Content(new Regex(@"This.is.what.we.are.looking.for")));
     Assert.That(Browser.HasContentMatch(new Regex(@"This.is.not.in.the.page")), Is.False);
     Assert.Throws <AssertionException>(() => Assert.That(Browser,
                                                          Shows.Content(new Regex(@"This.is.not.in.the.page"))));
 }
        public async Task <ActionResult <Shows> > PostShows(Shows shows)
        {
            _context.Shows.Add(shows);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetShows", new { id = shows.ShowId }, shows));
        }
Beispiel #30
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Year,Image,Price,IsAvailable,ActorListId,SeasonId,EpisodeId,GenreId")] Shows shows)
        {
            if (id != shows.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shows);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShowsExists(shows.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ActorListId"] = new SelectList(_context.Set <ActorList>(), "Id", "Name", shows.ActorListId);
            ViewData["EpisodeId"]   = new SelectList(_context.Set <Episode>(), "Id", "Name", shows.EpisodeId);
            ViewData["SeasonId"]    = new SelectList(_context.Set <Season>(), "Id", "Name", shows.SeasonId);
            ViewData["GenreId"]     = new SelectList(_context.Set <Genre>(), "Id", "Name", shows.GenreId);
            return(View(shows));
        }
 public EventEditForm(Shows s)
 {
     InitializeComponent();
     tempEvent = s;
     venuesList = Venue.LoadVenues();
     foreach (Venue v in venuesList)
         venueComboBox.Items.Add(v.Name);
     nameBox.Text = s.Name;
     priceBox.Text = s.Price.ToString();
     venueComboBox.SelectedItem = s.VenueName;
     Schedule.Value = s.Date;
     oldIndex = UserForm.showList.FindIndex(i => i.Name == s.Name);
     CreateEventButton.Text = "Save Info";
 }
        public UserShows SendMessage(EmailMessage EmailMessage)
        {
            UserShows us = null;
            try
            {
                // if entered show, send email saying entered show
                us = new UserShows(EmailMessage.UserShowId);
                User user = new User(us.Userid);

                if (user.EmailAddress.Length < 5) {
                    throw new Exception("NoEmai");
                }
                Shows thisShow = new Shows(us.ShowID);
                String htmlContents = readTemplate("AdminEmailHandler", "html", thisShow, null);
                String plainContents = readTemplate("AdminEmailHandler", "txt", thisShow, null);

                htmlContents = htmlContents.Replace("[BODY]", EmailMessage.body.Replace("\n", "<br>"));
                plainContents = plainContents.Replace("[BODY]", EmailMessage.body);
                MailMessage mm = new MailMessage();

                AlternateView htmlView = AlternateView.CreateAlternateViewFromString(htmlContents, null, MediaTypeNames.Text.Html);
                LinkedResource logoImage = new LinkedResource(HttpContext.Current.Server.MapPath("~/Assets/logo.gif"), MediaTypeNames.Image.Gif);
                logoImage.ContentId = "LogoImage";
                //htmlView.LinkedResources.Add(logoImage);

                AlternateView plainView = AlternateView.CreateAlternateViewFromString(plainContents, null, MediaTypeNames.Text.Plain);
                mm.Body = plainContents;
                mm.AlternateViews.Add(htmlView);

                SmtpClient client = new SmtpClient();
                mm.From = new MailAddress("*****@*****.**", "First Place Processing");
                mm.To.Add(new MailAddress(user.EmailAddress, user.Name));
                mm.Subject = EmailMessage.Subject;
                client.Send(mm);

                us.ContactStatus = 1;
                us.ContactDate = DateTime.Now;
                us.SaveContactDetails();
            }
            catch (Exception e)
            {
                AppException.LogEvent("SendMessage: "+ e.Message + " " + e.StackTrace);
            }
            return us;
        }
        public void SendEntryEmail(int ShowId, int UserId, String userRefNo)
        {
            Shows show = new Shows(ShowId);
            User currentUser = new User(UserId);

            //
            // if entered show, send email saying entered show
            String htmlContents = readTemplate("EnteredShow", "html", show, userRefNo);
            String plainContents = readTemplate("EnteredShow", "txt", show, userRefNo);

            MailMessage mm = new MailMessage();

            String Classes_entered_html = "<table>";
            String Classes_entered_plain = "";
            List<ShowClasses> classList = ShowClasses.GetAllClassesForShow(ShowId);
            List<Dogs> dogList = Dogs.GetAllDogsForHandler(UserId, show.ShowDate);

            var multiClasses = TeamPairsManager.GetTeamPairClasses(ShowId);
            var multiTeams = TeamPairsManager.GetTeamPairsForShow(ShowId, multiClasses);

            foreach (Dogs d in dogList)
            {
                DogClasses dogClasses = new DogClasses(d.ID, ShowId);
                dogClasses.getDogsClasses(ShowId);
                if (d.Grade != 0)
                {
                    bool dogEntered = false;
                    foreach (ShowClasses cls in classList)
                    {
                        int clsIndex = dogClasses.Classlist.IndexOf(cls.ID);
                        if (clsIndex > -1)
                        {
                            if (!dogEntered)
                            {
                                Classes_entered_html += String.Format("<tr style='font-weight:bold;'><td colspan='3'><b>{0} ({1}) {2}  </b></td></tr>", d.PetName, d.Grade,(dogClasses.Lho == 0 ? "": "Entered lower height option"));
                                Classes_entered_plain += String.Format("{1}{0}{1}--------------------------------{1} ({2}) {3}", d.PetName, Environment.NewLine, d.Grade, (dogClasses.Lho == 0 ? "" : "Entered lower height option"));
                            }
                            Classes_entered_html += "<tr>";

                            Classes_entered_html += String.Format("<td style='width:25px'></td><td>{0}</td><td>{1} {2} {3} {4} {5}</td>", cls.ClassNo, cls.NormalName(withClassNo:false));
                            Classes_entered_plain += String.Format("{0} - {1} {2} {3} {4} {5} {6}", cls.ClassNo, cls.NormalName(withClassNo:false), Environment.NewLine);
                            Classes_entered_html += "</tr>";
                            dogEntered = true;
                        }
                    }

                }
            }

            foreach (var team in multiTeams.Where( t => t.UserId == UserId ))
            {
                if (team.Team)
                {
                    Classes_entered_html += string.Format(@"
            <tr style='height:25px' ><td colspan='3'></td><tr>
            <td>Team Name<br>{0}</td>
            <td colspan='2'>Captain<br/>{1}</td>
            </tr>", team.TeamDetails.TeamName.Replace("&#39;", "'"), team.TeamDetails.Captain.Replace("&#39;", "'"));
                    Classes_entered_plain += string.Format(@"Team Name:{0}  Team Captain:{1}{2}", team.TeamDetails.TeamName.Replace("&#39;", "'"), team.TeamDetails.Captain.Replace("&#39;", "'"), Environment.NewLine);

                    foreach (var member in team.Members)
                    {

                        Classes_entered_html += string.Format(
            @"
            <tr>
            <td>&nbsp;&nbsp;&nbsp;{0}</td>
            <td colspan='2'>{1}</td>
            </tr><tr>
            ", member.HandlerName.Replace("&#39;", "'"), member.DogName.Replace("&#39;", "'"));
                        Classes_entered_plain += string.Format(
            @"
            {0}, {1}{2}", member.HandlerName.Replace("&#39;", "'"), member.DogName.Replace("&#39;", "'"), Environment.NewLine);

                    }
                }
            }

            Classes_entered_html += " </table>";
            Classes_entered_plain += Environment.NewLine;

            htmlContents = htmlContents.Replace("[CLOSING_DATE]", show.ClosingDate.ToString("ddd, dd MMM yyyy"));
            plainContents = plainContents.Replace("[CLOSING_DATE]", show.ClosingDate.ToString("ddd, dd MMM yyyy"));

            htmlContents = htmlContents.Replace("[CLASSES_ENTERED]", Classes_entered_html);
            plainContents = plainContents.Replace("[CLASSES_ENTERED]", Classes_entered_plain);

            string campingdetails_html = "";
            string campingdetails_plain = "";
            var usershowid = Convert.ToInt32(userRefNo);
            var uc = new UserCamping(usershowid);
            if (uc.ID > -1)
            {
                campingdetails_html = string.Format("<h3>Camping Details</h3><div>Party Name: <b>{0}</b><br>{1}</div>", uc.PitchDetails[0].PartyName, uc.PitchDetails[0].CampingDays);
                campingdetails_plain = string.Format("Party Name: {0}\n\r{1}", uc.PitchDetails[0].PartyName, uc.PitchDetails[0].CampingDays);
            }
            htmlContents = htmlContents.Replace("[CAMPING_DETAILS]", campingdetails_html);
            plainContents = plainContents.Replace("[CAMPING_DETAILS]", campingdetails_plain);

            string helpingdetails_html = "";
            string helpingdetails_plain = "";
            var helpersList = Helpers.HelperForShow(ShowId, UserId);
            if (helpersList.Count > 0)
            {
                helpingdetails_html += "<div id='helperdetails' class='infoText'><h3>Helping Details</h3>";
                helpingdetails_plain = "Helper Details";
                foreach (Helpers helper in helpersList)
                {
                    String judge = "";
                    if (helper.JudgeID > -1)
                    {
                        Judge j = new Judge(helper.JudgeID);
                        judge = "Judge: " + j.Name;
                    }
                    String ring = "";
                    if (helper.RingNo > 0)
                    {
                        ring = "Ring No:" + helper.RingNo.ToString();
                    }
                    helpingdetails_html += String.Format("<div >{0:ddd dd MMM} - {1} {2} {3}</div>", helper.HelpDate, helper.expandJob(), judge, ring);
                    helpingdetails_plain += String.Format("{0:ddd dd MMM} - {1} {2} {3}", helper.HelpDate, helper.expandJob(), judge, ring);
                }
                helpingdetails_html += "</div>";
                helpingdetails_html += "\n";
            }

            htmlContents = htmlContents.Replace("[HELPING_DETAILS]", helpingdetails_html);
            plainContents = plainContents.Replace("[HELPING_DETAILS]", helpingdetails_html);

            Decimal totals = 0;
            String table = CreateTotalsSummaryEmail(ShowId, UserId, ref totals);
            //htmlContents = htmlContents.Replace("[PAYMENT_NOTE]", table);

            AlternateView htmlView = AlternateView.CreateAlternateViewFromString(htmlContents, null, MediaTypeNames.Text.Html);
            LinkedResource logoImage = new LinkedResource(HttpContext.Current.Server.MapPath("~/Assets/logo.gif"), MediaTypeNames.Image.Gif);
            logoImage.ContentId = "LogoImage";
            //htmlView.LinkedResources.Add(logoImage);
            AlternateView plainView = AlternateView.CreateAlternateViewFromString(plainContents, null, MediaTypeNames.Text.Plain);

            mm.AlternateViews.Add(plainView);
            mm.AlternateViews.Add(htmlView);

            SmtpClient client = new SmtpClient();
            mm.From = new MailAddress("*****@*****.**", "First Place Processing");
            mm.To.Add(new MailAddress(currentUser.EmailAddress, currentUser.Name));
            mm.Subject = String.Format("Entry Confirmation {0} ({1:dd MMM yyyy})", show.ShowName, show.ShowDate);
            try
            {
                client.Send(mm);
            }
            catch (Exception e)
            {
                AppException.LogError("Error SendEntry:" + e.Message + "-" + e.StackTrace);
            }
        }
Beispiel #34
0
    protected void btnUpdateGuarantors_Click(object sender, EventArgs e)
    {
        Guid show_ID = new Guid(Show_ID);
        Shows show = new Shows(show_ID);
        if (ValidateGuarantors(show))
        {
            MembershipUser userInfo = Membership.GetUser();
            Guid user_ID = (Guid)userInfo.ProviderUserKey;

            Guid guarantor_ID = new Guid(Guarantor_ID);
            Guarantors guarantor = new Guarantors(guarantor_ID);
            if (HasChanges(guarantor, show))
            {
                guarantor.Chairman_Person_ID = new Guid(Chairman_ID);
                guarantor.Secretary_Person_ID = new Guid(Secretary_ID);
                guarantor.Treasurer_Person_ID = new Guid(Treasurer_ID);
                if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
                {
                    guarantor.Committee1_Person_ID = new Guid(Committee1_ID);
                    guarantor.Committee2_Person_ID = new Guid(Committee2_ID);
                    guarantor.Committee3_Person_ID = new Guid(Committee3_ID);
                }
                guarantor.DeleteGuarantor = false;

                if (guarantor.Update_Guarantor(guarantor_ID, user_ID))
                {
                    MessageLabel.Text = "Guarantors updated successfully.";
                    PopulateGuarantors(Show_ID, Guarantor_ID);
                }
            }
            else
            {
                MessageLabel.Text = "Update cancelled as no changes have been made.";
            }
        }
    }
Beispiel #35
0
    private bool HasChanges(Shows show)
    {
        bool Changed = false;

        if (show.Show_Year_ID.ToString() != lstShowYears.SelectedValue)
            Changed = true;
        if (show.Show_Type_ID.ToString() != lstShowTypes.SelectedValue)
            Changed = true;
        if (show.Venue_ID.ToString() != Venue_ID)
            Changed = true;
        if (show.Show_Opens != DateTime.Parse(Request.Form[txtShowDateTime.UniqueID]))
            Changed = true;
        if (show.Judging_Commences != DateTime.Parse(Request.Form[txtJudgingDateTime.UniqueID]))
            Changed = true;
        if (show.Closing_Date != DateTime.Parse(Request.Form[txtCloseDateTime.UniqueID]))
            Changed = true;
        short res;
        if (short.TryParse(MaxClassesPerDog, out res))
        {
            if (show.MaxClassesPerDog != short.Parse(MaxClassesPerDog))
                Changed = true;
        }
        else
        {
            if (res == 0)
                Changed = true;
        }

        return Changed;
    }
Beispiel #36
0
    private void PopulateShow(string show_ID)
    {
        Guid Show_ID = new Guid(show_ID);
        Shows show = new Shows(Show_ID);

        txtShowName.Text = show.Show_Name;
        Common.Show_Type_ID = show.Show_Type_ID.ToString();
        divGetShow.Visible = false;
        divShowDetails.Visible = true;
    }
Beispiel #37
0
    private void PopulateShow(string show_ID)
    {
        Guid Show_ID = new Guid(show_ID);
        Shows show = new Shows(Show_ID);

        txtShowName.Text = show.Show_Name;
        divShowList.Visible = false;
        divShowDetails.Visible = true;
    }
Beispiel #38
0
    private void PopulateChildShowGridView()
    {
        Guid club_ID = new Guid(Club_ID);
        int show_Year_ID = Int32.Parse(Show_Year_ID);
        List<Shows> tblShows;
        Shows show = new Shows();
        tblShows = show.GetShowsByClub_ID_And_Show_Year_ID(club_ID, show_Year_ID);
        List<LinkedShows> lnkLinkedShows;
        LinkedShows linkedShows = new LinkedShows();
        lnkLinkedShows = linkedShows.GetLinked_Shows();

        Guid parent_Show_ID = new Guid(Parent_Show_ID);
        List<Shows> childShowList = new List<Shows>();
        foreach (Shows row in tblShows)
        {
            if (lnkLinkedShows.Count == 0 && row.Show_ID != parent_Show_ID)
            {
                Shows childShow = new Shows((Guid)row.Show_ID);
                childShowList.Add(childShow);
            }
            else
            {
                foreach (LinkedShows linkedShowRow in lnkLinkedShows)
                {
                    if (row.Show_ID != parent_Show_ID && row.Show_ID != linkedShowRow.Parent_Show_ID && row.Show_ID != linkedShowRow.Child_Show_ID)
                    {
                        Shows childShow = new Shows((Guid)row.Show_ID);
                        childShowList.Add(childShow);
                    }
                }
            }
        }
        if (childShowList != null && childShowList.Count > 0)
        {
            ChildShowGridView.DataSource = childShowList;
            ChildShowGridView.DataBind();
        }
        else
        {
            MessageLabel.Text = "There is no second, unlinked show for this Club.";
        }
    }
Beispiel #39
0
        private void ExecuteAction(Shows.Action action)
        {
            ScheduleExecutor.Logging.Info("ExecuteAction: " + action.ShowItem.Name);
            if (State != StateType.Waiting)
            {
                ScheduleExecutor.Logging.Info("ExecuteAction: State != StateType.Waiting");
                if (!action.PreProcessingCompleted)
                {
                    ScheduleExecutor.AddSchedulerLogEntry(Show.Name, "Pre-processing action: " + action.ShowItem.Name);

                    // Do this in a task so we don't stop Vixen while pre-processing!
                    tokenSourcePreProcess = new CancellationTokenSource();
                    Task preProcessTask = new Task(() => action.PreProcess(), tokenSourcePreProcess.Token);
                    preProcessTask.ContinueWith(task =>
                        {
                            ScheduleExecutor.AddSchedulerLogEntry(Show.Name, "Starting action: " + action.ShowItem.Name);
                            action.Execute();
                            RunningActions.Add(action);
                        }
                    );

                    preProcessTask.Start();
                }
                else
                {
                    ScheduleExecutor.AddSchedulerLogEntry(Show.Name, "Starting action: " + action.ShowItem.Name);
                    action.Execute();
                    RunningActions.Add(action);
                }
            }
        }
Beispiel #40
0
 public Ticket(Shows s,int n)
 {
     show = s;
     seatnumber = n;
 }
Beispiel #41
0
    protected void btnAddGuarantors_Click(object sender, EventArgs e)
    {
        Guid show_ID = new Guid(Show_ID);
        Shows show = new Shows(show_ID);

        if (ValidateGuarantors(show))
        {
            MembershipUser userInfo = Membership.GetUser();
            Guid user_ID = (Guid)userInfo.ProviderUserKey;

            Guarantors guarantor = new Guarantors();
            guarantor.Show_ID = show_ID;
            guarantor.Chairman_Person_ID = new Guid(Chairman_ID);
            guarantor.Secretary_Person_ID = new Guid(Secretary_ID);
            guarantor.Treasurer_Person_ID = new Guid(Treasurer_ID);
            if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
            {
                guarantor.Committee1_Person_ID = new Guid(Committee1_ID);
                guarantor.Committee2_Person_ID = new Guid(Committee2_ID);
                guarantor.Committee3_Person_ID = new Guid(Committee3_ID);
            }
            Guid? guarantor_ID;
            guarantor_ID = guarantor.Insert_Guarantor(user_ID);
            if (!string.IsNullOrEmpty(guarantor_ID.ToString()))
            {
                Guarantor_ID = guarantor_ID.ToString();
                Common.Guarantor_ID = Guarantor_ID;
                Common.GuarantorsPopulated = true;
                divAddGuarantors.Visible = false;
                divUpdateGuarantors.Visible = true;
                MessageLabel.Text = "Guarantors added successfully.";
            }
        }
    }
Beispiel #42
0
 private void ShowCommittee()
 {
     if (!string.IsNullOrEmpty(Show_ID))
     {
         Guid show_ID = new Guid(Show_ID);
         Shows show = new Shows(show_ID);
         if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
         {
             TableRowC1.Visible = true;
             TableRowC2.Visible = true;
             TableRowC3.Visible = true;
         }
         else
         {
             TableRowC1.Visible = false;
             TableRowC2.Visible = false;
             TableRowC3.Visible = false;
         }
     }
 }
Beispiel #43
0
 private void PopulateShow(string show_ID)
 {
     Guid newShow_ID = new Guid(show_ID);
     Shows show = new Shows(newShow_ID);
     Show_Year_ID = show.Show_Year_ID.ToString();
     lstShowYears.SelectedValue = Show_Year_ID;
     Show_Type_ID = show.Show_Type_ID.ToString();
     lstShowTypes.SelectedValue = Show_Type_ID;
     Show_Name = show.Show_Name;
     txtShowName.Text = Show_Name;
     string format = "yyy-MM-dd hh:mm";
     Show_Opens = DateTime.Parse(show.Show_Opens.ToString()).ToString(format);
     txtShowDateTime.Text = Show_Opens;
     Judging_Commences = DateTime.Parse(show.Judging_Commences.ToString()).ToString(format);
     txtJudgingDateTime.Text = Judging_Commences;
     if (show.Closing_Date != null)
     {
         format = "yyy-MM-dd";
         Closing_Date = DateTime.Parse(show.Closing_Date.ToString()).ToString(format);
         txtCloseDateTime.Text = Closing_Date;
     }
     MaxClassesPerDog = show.MaxClassesPerDog.ToString();
     txtMaxClassesPerDog.Text = MaxClassesPerDog;
     divAddShow.Visible = false;
     divUpdateShow.Visible = true;
     divAddClasses.Visible = true;
     //StoreCommon();
 }
Beispiel #44
0
    private void PopulateGuarantors(string show_ID, string guarantor_ID)
    {
        Guid newShow_ID = new Guid(show_ID);
        Shows show = new Shows(newShow_ID);
        List<Guarantors> tblGuarantors = null;
        if (!string.IsNullOrEmpty(guarantor_ID))
        {
            Guid newGuarantor_ID = new Guid(guarantor_ID);
            Guarantors guarantor = new Guarantors(newGuarantor_ID);
            tblGuarantors = guarantor.GetGuarantorsByGuarantor_ID(newGuarantor_ID);
        }
        else
        {
            Guarantors guarantor = new Guarantors();
            tblGuarantors = guarantor.GetGuarantorsByShow_ID(newShow_ID);
        }
        if (tblGuarantors.Count > 0)
        {
            Guarantor_ID = tblGuarantors[0].Guarantor_ID.ToString();
            Common.Guarantor_ID = Guarantor_ID;
            Chairman_ID = tblGuarantors[0].Chairman_Person_ID.ToString();
            Common.Chairman_ID = Chairman_ID;
            PopulateChairman();
            Secretary_ID = tblGuarantors[0].Secretary_Person_ID.ToString();
            Common.Secretary_ID = Secretary_ID;
            PopulateSecretary();
            Treasurer_ID = tblGuarantors[0].Treasurer_Person_ID.ToString();
            Common.Treasurer_ID = Treasurer_ID;
            PopulateTreasurer();
            if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
            {

                if (!tblGuarantors[0].IsCommittee1_Person_IDNull)
                {
                    Committee1_ID = tblGuarantors[0].Committee1_Person_ID.ToString();
                    Common.Committee1_ID = Committee1_ID;
                    PopulateCommittee1();
                }
                if (!tblGuarantors[0].IsCommittee2_Person_IDNull)
                {
                    Committee2_ID = tblGuarantors[0].Committee2_Person_ID.ToString();
                    Common.Committee2_ID = Committee2_ID;
                    PopulateCommittee2();
                }
                if (!tblGuarantors[0].IsCommittee3_Person_IDNull)
                {
                    Committee3_ID = tblGuarantors[0].Committee3_Person_ID.ToString();
                    Common.Committee3_ID = Committee3_ID;
                    PopulateCommittee3();
                }
            }
            divAddGuarantors.Visible = false;
            divGuarantorList.Visible = true;
            ShowCommittee();
            Common.GuarantorsPopulated = true;
        }
    }
        private String readTemplate(String templateName, String type, Shows show, String UserRefNo)
        {
            String template = HttpContext.Current.Server.MapPath(@"~/Templates/" + templateName + "." + type);

            String contents = File.ReadAllText(template);
            contents = contents.Replace("[DATE_ENTERED]", DateTime.Now.ToString("dd MMM yyyy hh:mm:ss"));
            contents = contents.Replace("[SHOWNAME]", show.ShowName);
            contents = contents.Replace("[SHOWDATE]", show.ShowDate.ToString("dd MMM yyyy"));

            contents = contents.Replace("[USERREFNO]", UserRefNo);

            return contents;
        }
Beispiel #46
0
 private void PopulateLinkedShowGridView()
 {
     Guid club_ID = new Guid(Club_ID);
     int show_Year_ID = Int32.Parse(Show_Year_ID);
     LinkedShows linkedShows = new LinkedShows();
     List<LinkedShows> lnkLinkedShows;
     lnkLinkedShows = linkedShows.GetLinked_Shows();
     List<LinkedShows> linkedShowList = new List<LinkedShows>();
     foreach (LinkedShows linkedShowRow in lnkLinkedShows)
     {
         Shows parentShow = new Shows(linkedShowRow.Parent_Show_ID);
         Shows childShow = new Shows(linkedShowRow.Child_Show_ID);
         if (parentShow.Club_ID == club_ID && parentShow.Show_Year_ID == show_Year_ID)
         {
             LinkedShows newLinkedShow = new LinkedShows(linkedShowRow.Linked_Show_ID);
             newLinkedShow.Parent_Show_Name = parentShow.Show_Name;
             newLinkedShow.Parent_Show_Opens = parentShow.Show_Opens;
             newLinkedShow.Child_Show_Name = childShow.Show_Name;
             newLinkedShow.Child_Show_Opens = childShow.Show_Opens;
             linkedShowList.Add(newLinkedShow);
         }
     }
     if (linkedShowList != null && linkedShowList.Count > 0)
     {
         LinkedShowsGridView.DataSource = linkedShowList;
         LinkedShowsGridView.DataBind();
         divClubLinkedShows.Visible = true;
     }
     else
     {
         divClubLinkedShows.Visible = false;
     }
 }
Beispiel #47
0
 public void ExecuteBackgroundAction(Shows.Action action)
 {
     if (State == StateType.Running)
     {
         action.ActionComplete += OnBackgroundActionComplete;
         ExecuteAction(action);
     }
 }
Beispiel #48
0
 private void PopulateParentShow()
 {
     Guid parent_Show_ID = new Guid(Parent_Show_ID);
     Shows show = new Shows(parent_Show_ID);
     txtParentShowName.Text = show.Show_Name;
     divParentShowList.Visible = false;
     divParentShowDetails.Visible = true;
 }
Beispiel #49
0
    private bool ValidateGuarantors(Shows show)
    {
        bool valid = true;
        if (string.IsNullOrEmpty(Chairman_ID))
        {
            MessageChairman.Text = "You must specify the Chairman";
            divMessageChairman.Visible = true;
            valid = false;
        }
        else
            divMessageChairman.Visible = false;

        if (string.IsNullOrEmpty(Secretary_ID))
        {
            MessageSecretary.Text = "You must specify the Secretary";
            divMessageSecretary.Visible = true;
            valid = false;
        }
        else
            divMessageSecretary.Visible = false;

        if (string.IsNullOrEmpty(Treasurer_ID))
        {
            MessageTreasurer.Text = "You must specify the Treasurer";
            divMessageTreasurer.Visible = true;
            valid = false;
        }
        else
            divMessageTreasurer.Visible = false;

        if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
        {
            if (string.IsNullOrEmpty(Committee1_ID) || string.IsNullOrEmpty(Committee2_ID) || string.IsNullOrEmpty(Committee3_ID))
            {
                MessageCommittee.Text = "You must specify three Committee members";
                valid = false;
            }
        }
        return valid;
    }
Beispiel #50
0
    private void PopulateParentShowGridView()
    {
        List<LinkedShows> lnkLinkedShows;
        LinkedShows linkedShows = new LinkedShows();
        lnkLinkedShows = linkedShows.GetLinked_Shows();
        Guid club_ID = new Guid(Club_ID);
        int show_Year_ID = Int32.Parse(Show_Year_ID);
        List<Shows> tblShows;
        Shows show = new Shows();
        tblShows = show.GetShowsByClub_ID_And_Show_Year_ID(club_ID, show_Year_ID);

        List<Shows> parentShowList = new List<Shows>();
        foreach (Shows showRow in tblShows)
        {
            if (lnkLinkedShows.Count == 0)
            {
                Shows newShow = new Shows((Guid)showRow.Show_ID);
                parentShowList.Add(newShow);
            }
            else
            {
                foreach (LinkedShows linkedShowRow in lnkLinkedShows)
                {
                    if (showRow.Show_ID != linkedShowRow.Parent_Show_ID && showRow.Show_ID != linkedShowRow.Child_Show_ID)
                    {
                        Shows newShow = new Shows((Guid)showRow.Show_ID);
                        parentShowList.Add(newShow);
                    }
                }
            }
        }
        if (parentShowList != null && parentShowList.Count > 0)
        {
            ParentShowGridView.DataSource = parentShowList;
            ParentShowGridView.DataBind();
            divParentShowList.Visible = true;
            divParentShowDetails.Visible = false;
        }
        else
        {
            MessageLabel.Text = "There are no unlinked shows for this Club.";
        }
    }
Beispiel #51
0
    private bool HasChanges(Guarantors guarantor, Shows show)
    {
        bool Changed = false;

        if (guarantor.Chairman_Person_ID.ToString() != Chairman_ID)
            Changed = true;
        if (guarantor.Secretary_Person_ID.ToString() != Secretary_ID)
            Changed = true;
        if (guarantor.Treasurer_Person_ID.ToString() != Treasurer_ID)
            Changed = true;
        if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
        {
            if (guarantor.Committee1_Person_ID.ToString() != Committee1_ID)
                Changed = true;
            if (guarantor.Committee2_Person_ID.ToString() != Committee2_ID)
                Changed = true;
            if (guarantor.Committee3_Person_ID.ToString() != Committee3_ID)
                Changed = true;
        }

        return Changed;
    }
Beispiel #52
0
        private void SeatForm_Load(object sender, EventArgs e)
        {
            //currentCustomer = UserForm.selectedCustomer;

            currentShow = UserForm.selectedShow;
            foreach (Customer q in customerList)
            {
                if (q.Name == UserForm.selectedCustomer.Name)
                    currentCustomer = q;
            }
            customerIndex = customerList.IndexOf(currentCustomer);

            foreach (Venue q in venueList)
            {
                if (q.Name == currentShow.VenueName)
                    currentVenue = q;
            }
            venueIndex = venueList.IndexOf(currentVenue);
            CreateButtons();
            panel1.SendToBack();
        }
Beispiel #53
0
 private void PopulateShowGridView(string club_ID)
 {
     Guid Club_ID = new Guid(club_ID);
     Shows show = new Shows();
     List<Shows> tblShows = show.GetShowsByClub_ID(Club_ID);
     ShowGridView.DataSource = tblShows;
     ShowGridView.DataBind();
 }
        public void SendForRefund(int ShowID, int UserID)
        {
            Shows show = new Shows(ShowID);
            User user = new User(UserID);
            UserShows us = new UserShows(UserID, ShowID);
            var refcode = us.ID.ToString("000000");

            String htmlContents = readTemplate("Refund", "html", show, refcode);
            String plainContents = readTemplate("Refund", "txt", show, refcode);
            htmlContents = htmlContents.Replace("[PAYMENT_NOTE]", "Your payment will be refunded in the next 5 working days");
            plainContents = plainContents.Replace("[PAYMENT_NOTE]", "Your payment will be refunded in the next 5 working days");

            MailMessage mm = new MailMessage();
            AlternateView htmlView = AlternateView.CreateAlternateViewFromString(htmlContents, null, MediaTypeNames.Text.Html);
            LinkedResource logoImage = new LinkedResource(HttpContext.Current.Server.MapPath("~/Assets/logo.gif"), MediaTypeNames.Image.Gif);
            logoImage.ContentId = "LogoImage";
            //htmlView.LinkedResources.Add(logoImage);
            AlternateView plainView = AlternateView.CreateAlternateViewFromString(plainContents, null, MediaTypeNames.Text.Plain);

            mm.AlternateViews.Add(plainView);
            mm.AlternateViews.Add(htmlView);

            SmtpClient client = new SmtpClient();
            mm.From = new MailAddress("*****@*****.**", "First Place Processing");
            mm.To.Add(new MailAddress(user.EmailAddress, user.Name));
            mm.Bcc.Add(new MailAddress("*****@*****.**", "Accounts"));
            mm.Subject = String.Format("Refund of entry {0} ({1:dd MMM yyyy})", show.ShowName, show.ShowDate);
            client.Send(mm);

            if (us.Status == (int)UserShows.UserStatus.STATUS_ENTERED_AND_PAID)
            {
                mm = new MailMessage();
                mm.From = new MailAddress("*****@*****.**", "First Place Processing");
                mm.To.Add(new MailAddress("*****@*****.**", "First Place Processing"));
                mm.Subject = "Entry Refund Request";
                mm.Body = String.Format("Refund Request from {0}\r\n\r\nRefcode: {1}\r\n\r\nEmail: {2}\r\n\r\nShow: {3}\r\n",
                                        user.Name, refcode, user.EmailAddress, show.ShowName);
                client.Send(mm);
            }
        }
    private bool ValidEntry()
    {
        bool valid = true;
        Guid show_ID = new Guid(Show_ID);
        Shows show = new Shows(show_ID);
        List<DogClasses> tblDogClasses;
        DogClasses dogClasses = new DogClasses();
        Guid entrant_ID = new Guid(Entrant_ID);
        tblDogClasses = dogClasses.GetDog_ClassesByEntrant_ID(entrant_ID);
        short dogClassCount = 0;
        if (string.IsNullOrEmpty(Handler_ID) && lstClasses.SelectedItem.Text != "NFC")
        {
            MessageLabel.Text = "You must select the Handler.";
            valid = false;
        }
        if (!string.IsNullOrEmpty(Dog_ID) && lstClasses.SelectedItem.Text != "NFC")
        {
            Guid dog_ID = new Guid(Dog_ID);
            Dogs dog = new Dogs(dog_ID);
            if (!IsCorrectClassGender(dog))
            {
                MessageLabel.Text = "This dog is the wrong gender for this class.";
                valid = false;
            }
        }
        foreach (DogClasses row in tblDogClasses)
        {
            if (!row.IsShow_Entry_Class_IDNull && Dog_ID == row.Dog_ID.ToString())
            {
                if (Show_Entry_Class_ID == row.Show_Entry_Class_ID.ToString())
                {
                    MessageLabel.Text = string.Format("You have already entered this dog in {0}.", GetClassName((Guid)row.Show_Entry_Class_ID));
                    valid = false;
                }
                else if (lstClasses.SelectedItem.Text == "NFC" && GetClassName((Guid)row.Show_Entry_Class_ID) != "NFC")
                {
                    MessageLabel.Text = "This dog is already entered in other classes, so cannot be NFC";
                    valid = false;
                }
                else if (GetClassName((Guid)row.Show_Entry_Class_ID) == "NFC")
                {
                    MessageLabel.Text = "This dog is entered NFC so cannot be entered in other classes.";
                    valid = false;
                }
                if (valid)
                {
                    dogClassCount += 1;
                    if (dogClassCount >= show.MaxClassesPerDog)
                    {
                        MessageLabel.Text = string.Format("There is a maximum of {0} classes per dog for this show.", show.MaxClassesPerDog.ToString());
                        valid = false;
                    }
                }
            }
        }

        return valid;
    }
Beispiel #56
0
    protected void btnUpdateShow_Click(object sender, EventArgs e)
    {
        MembershipUser userInfo = Membership.GetUser();
        Guid user_ID = (Guid)userInfo.ProviderUserKey;

        ReadFormFields();
        if (!string.IsNullOrEmpty(Show_ID))
        {
            Guid show_ID = new Guid(Show_ID);
            Guid club_ID = new Guid(Club_ID);
            Guid venue_ID = new Guid(Venue_ID);

            if (ValidateShow())
            {
                Shows show = new Shows(show_ID);
                if (HasChanges(show))
                {
                    show.Club_ID = club_ID;
                    show.Show_Year_ID = Convert.ToInt32(lstShowYears.SelectedValue);
                    show.Show_Type_ID = Convert.ToInt32(lstShowTypes.SelectedValue);
                    show.Venue_ID = venue_ID;
                    show.Show_Name = txtShowName.Text;
                    show.Show_Opens = DateTime.Parse(Request.Form[txtShowDateTime.UniqueID]);
                    show.Judging_Commences = DateTime.Parse(Request.Form[txtJudgingDateTime.UniqueID]);
                    show.Closing_Date = DateTime.Parse(Request.Form[txtCloseDateTime.UniqueID]);
                    short res;
                    if (short.TryParse(txtMaxClassesPerDog.Text, out res))
                        show.MaxClassesPerDog = res;

                    if (show.Update_Show(show_ID, user_ID))
                    {
                        MessageLabel.Text = "The show was updated successfully";
                        PopulateShowGridView(Club_ID);
                        if (!string.IsNullOrEmpty(btnReturn.PostBackUrl))
                        {
                            DivReturn.Visible = true;
                            divAddClasses.Visible = true;
                        }
                    }
                }
                else
                {
                    MessageLabel.Text = "Update cancelled as no changes have been made.";
                }
            }
        }
    }
Beispiel #57
0
 private void PopulateChildShow()
 {
     Guid child_Show_ID = new Guid(Child_Show_ID);
     Shows show = new Shows(child_Show_ID);
     txtChildShowName.Text = show.Show_Name;
     divChildShowList.Visible = false;
     divChildShowDetails.Visible = true;
 }
 private void PopulateShow()
 {
     Guid show_ID = new Guid(Show_ID);
     Shows show = new Shows(show_ID);
     txtShowName.Text = show.Show_Name;
     MaxClassesPerDog = show.MaxClassesPerDog.ToString();
 }
Beispiel #59
0
    protected void btnAddShow_Click(object sender, EventArgs e)
    {
        ReadFormFields();
        StoreCommon();
        if(ValidateShow())
        {
            MembershipUser userInfo = Membership.GetUser();
            Guid user_ID = (Guid)userInfo.ProviderUserKey;

            if (!string.IsNullOrEmpty(Club_ID))
            {
                Guid club_ID = new Guid(Club_ID);
                Guid venue_ID = new Guid(Venue_ID);

                Shows show = new Shows();
                show.Club_ID = club_ID;
                show.Show_Year_ID = Convert.ToInt32(lstShowYears.SelectedValue);
                show.Show_Type_ID = Convert.ToInt32(lstShowTypes.SelectedValue);
                show.Venue_ID = venue_ID;
                show.Show_Name = txtShowName.Text;
                show.Show_Opens = DateTime.Parse(Request.Form[txtShowDateTime.UniqueID]);
                show.Judging_Commences = DateTime.Parse(Request.Form[txtJudgingDateTime.UniqueID]);
                show.Closing_Date = DateTime.Parse(Request.Form[txtCloseDateTime.UniqueID]);
                short res;
                if (short.TryParse(txtMaxClassesPerDog.Text, out res))
                    show.MaxClassesPerDog = res;

                Guid? show_ID = show.Insert_Show(user_ID);

                if (show_ID != null)
                {
                    Show_ID = show_ID.ToString();
                    Common.Show_ID = Show_ID;
                    MessageLabel.Text = "The show was added successfully";
                    //ClearEntryFields();
                    PopulateShowGridView(Club_ID);
                    if (!string.IsNullOrEmpty(btnReturn.PostBackUrl))
                    {
                        DivReturn.Visible = true;
                        divAddClasses.Visible = true;
                    }
                }
            }
        }
    }
Beispiel #60
0
 private void UserList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (editEventButton.Text == "Edit User")
     {
         try
         {
             selectedCustomer = UserForm.customerList.Find(item => item == UserList.SelectedItems[0]);
             tempIndex = UserForm.customerList.IndexOf(selectedCustomer);
             TicketBox.Items.Clear();
             foreach (Ticket t in selectedCustomer.Tickets)
                 TicketBox.Items.Add(t);
             TicketBox.DisplayMember = "ShowName";
             addTicketButton.Enabled = true;
             removeTicketButton.Enabled = false;
         }
         catch (Exception ex)
         {
             if (ex is NullReferenceException || ex is ArgumentOutOfRangeException)
                   selectedCustomer = new Customer();
         }
      }
      else
      {
         try
         {
             selectedShow = UserForm.showList.Find(item => item == UserList.SelectedItems[0]);
         }
         catch (Exception ex)
         {
             if (ex is NullReferenceException || ex is ArgumentOutOfRangeException)
                   selectedShow = new Shows();
         }
      }
 }