public FrmOfficialsUndo(TeamOfficial official)
        {
            InitializeComponent();

            this.Official = official;

            lblOfficialName.Text = this.Official.Name;
            txtWarning.Text = this.Official.Warning.ToString();
            txtSuspension.Text = this.Official.Suspension.ToString();
            txtDisqualification.Text = this.Official.Disqualification.ToString();
        }
        private void dataOfficialsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if(this.HomeClub.ClubId != 0 && this.GuestClub.ClubId != 0)
            {
                FrmAddOfficials dataAddOfficials = new FrmAddOfficials(this.HomeClub.ClubId, this.GuestClub.ClubId, this.HomeClubOfficials, this.GuestClubOfficials);
                dataAddOfficials.ShowDialog();

                if (dataAddOfficials.OfficialsAddSuccess)
                {
                    Thread loadingThread = new Thread(new ThreadStart(showLoadingForm));
                    loadingThread.Start();

                    this.HomeManages = new BindingList<Manage>();
                    this.GuestManages = new BindingList<Manage>();

                    this.HomeClubOfficials = dataAddOfficials.HomeOfficialsManage;
                    this.GuestClubOfficials = dataAddOfficials.GuestOfficialsManage;

                    this.HomeTeamOfficials.Clear();
                    this.GuestTeamOfficials.Clear();

                    using (var db = new MatchReporterEntities())
                    {
                        List<Manage> previousManages = new List<Manage>(db.Manage.Where<Manage>(m => m.MatchId == this.Match.MatchId).ToList<Manage>());
                        foreach (Manage manage in previousManages)
                        {
                            db.Manage.Remove(manage);
                        }
                        db.SaveChanges();
                    }

                    foreach (ClubOfficial official in this.HomeClubOfficials)
                    {
                        TeamOfficial teamOfficial = new TeamOfficial(official.ClubOfficialId, official.FirstName, official.LastName);
                        this.HomeTeamOfficials.Add(teamOfficial);

                        Manage manage = new Manage(this.Match.MatchId, official.ClubOfficialId);
                        this.HomeManages.Add(manage);
                    }

                    foreach (ClubOfficial official in this.GuestClubOfficials)
                    {
                        TeamOfficial teamOfficial = new TeamOfficial(official.ClubOfficialId, official.FirstName, official.LastName);
                        this.GuestTeamOfficials.Add(teamOfficial);

                        Manage manage = new Manage(this.Match.MatchId, official.ClubOfficialId);
                        this.GuestManages.Add(manage);
                    }

                    using (var db = new MatchReporterEntities())
                    {
                        foreach (Manage manage in this.HomeManages)
                        {
                            db.Manage.Add(manage);
                        }

                        foreach (Manage manage in this.GuestManages)
                        {
                            db.Manage.Add(manage);
                        }
                        db.SaveChanges();

                        this.SavedManages = true;
                    }

                    dgvHomeOfficials.DataSource = this.HomeTeamOfficials;
                    dgvGuestOfficials.DataSource = this.GuestTeamOfficials;
                    dgvHomeOfficials.Refresh();
                    dgvGuestOfficials.Refresh();

                    btnHomeOfficialWarning.Enabled = true;
                    btnGuestOfficialWarning.Enabled = true;
                    btnHomeOfficialSuspension.Enabled = true;
                    btnGuestOfficialSuspension.Enabled = true;
                    btnHomeOfficialDisqualification.Enabled = true;
                    btnGuestOfficialDisqualification.Enabled = true;
                    btnHomeOfficialUndo.Enabled = true;
                    btnGuestOfficialUndo.Enabled = true;

                    loadingThread.Abort();
                }
                //dataAddOfficials.Dispose();
            }
            else
            {
                MessageBox.Show(this, "Da biste dodali službene osobe, prvo je potrebno dodati momčadi.", "Greška",
                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }