Esempio n. 1
0
        /// <summary>
        /// Delete Team-Section from .ini-File
        /// </summary>
        /// <param name="i_deleteTeam"></param>
        public void deleteSignedUpTeam(SignedUpTeam i_deleteTeam)
        {
            INIFile sutIni    = new INIFile(iniPath);
            int     suTeamCnt = Convert.ToInt32(sutIni.GetValue(Const.fileSec, SignedUpTeam.fsX_suTeamCnt));

            if (suTeamCnt == i_deleteTeam.suTeamId)
            {
                //Last Team in ini-File! No switching needed
                string o_deleteString = "[" + SignedUpTeam.suTeamSec + i_deleteTeam.suTeamId + "]";
                sutIni.DeleteFromIni(iniPath, o_deleteString, suTeamSec_Length);
            }
            else
            {
                SignedUpTeam switch_Team = new SignedUpTeam();

                for (int i = i_deleteTeam.suTeamId; i < suTeamCnt; i++)
                {
                    switch_Team.Getter(i + 1);
                    switch_Team.suTeamId = i;
                    switch_Team.Setter();
                }


                string o_deletestring = "[" + SignedUpTeam.suTeamSec + Convert.ToInt32(suTeamCnt) + "]";
                sutIni.DeleteFromIni(iniPath, o_deletestring, suTeamSec_Length);
            }

            sutIni.SetValue(Const.fileSec, fsX_suTeamCnt, Convert.ToString(suTeamCnt - 1));
        }
Esempio n. 2
0
        /// <summary>
        /// Fills AddTeam-Usercontrol with data from selected previous signed up team
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmbx_signedUpTeams_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            preSignedUpTeam = new SignedUpTeam();
            preSignedUpTeam.Getter(cmbx_signedUpTeams.SelectedIndex + 1);

            tbx_iTAP1Firstname.Text = preSignedUpTeam.suTeamPlayerFirstNames[0];
            tbx_iTAP1Lastname.Text  = preSignedUpTeam.suTeamPlayerLastNames[0];
            tbx_iTAP2Firstname.Text = preSignedUpTeam.suTeamPlayerFirstNames[1];
            tbx_iTAP2Lastname.Text  = preSignedUpTeam.suTeamPlayerLastNames[1];
        }
Esempio n. 3
0
        private void SignUpTeams_Loaded(object sender, RoutedEventArgs e)
        {
            INIFile tIni = new INIFile(SignedUpTeam.iniPath);

            newTeam = new SignedUpTeam(true);

            gB_sSignUpTeam.Header = "Team-Nummer " + Convert.ToString(newTeam.suTeamId);

            tbx_iSUTP1Firstname.Focus();
        }
Esempio n. 4
0
        public void Setter(SignedUpTeam i_suTeam)
        {
            INIFile sutIni = new INIFile(iniPath);
            string  strId  = Convert.ToString(i_suTeam.suTeamId);

            sutIni.SetValue(suTeamSec + strId, sutS_suTId, strId);
            sutIni.SetValue(suTeamSec + strId, sutS_suTName, i_suTeam.suTeamName);
            sutIni.SetValue(suTeamSec + strId, sutS_suTPlayer1Firstname, i_suTeam.suTeamPlayerFirstNames[0]);
            sutIni.SetValue(suTeamSec + strId, sutS_suTPlayer1Lastname, i_suTeam.suTeamPlayerLastNames[0]);
            sutIni.SetValue(suTeamSec + strId, sutS_suTPlayer2Firstname, i_suTeam.suTeamPlayerFirstNames[1]);
            sutIni.SetValue(suTeamSec + strId, sutS_suTPlayer2Lastname, i_suTeam.suTeamPlayerLastNames[1]);
        }
Esempio n. 5
0
        /// <summary>
        /// Saves Multiple Teams from entered Data with identifining postfix added to the teamname
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <param name="i_multiCreate"></param>
        private void SaveSignedUpTeam(object sender, RoutedEventArgs e, int i_multiCreate)
        {
            string teamName = "";

            if (CheckInput())
            {
                btn_MultiCreate.Visibility    = Visibility.Visible;
                tbx_iMultiCreate.Visibility   = Visibility.Hidden;
                lbl_sMultiCreate.Visibility   = Visibility.Hidden;
                btn_ClsMultiCreate.Visibility = Visibility.Hidden;
                for (int i = 1; i <= multiCreate; i++)
                {
                    if (i == 1)
                    {
                        newTeam.suTeamPlayerFirstNames[0] = tbx_iSUTP1Firstname.Text;
                        newTeam.suTeamPlayerLastNames[0]  = tbx_iSUTP1Lastname.Text;
                        newTeam.suTeamPlayerFirstNames[1] = tbx_iSUTP2Firstname.Text;
                        newTeam.suTeamPlayerLastNames[1]  = tbx_iSUTP2Lastname.Text;
                        teamName           = newTeam.suTeamName;
                        newTeam.suTeamName = newTeam.suTeamName + Convert.ToString(i);
                        newTeam.Setter();
                    }
                    else
                    {
                        SignedUpTeam multiTeam = new SignedUpTeam(true);
                        for (int member = 0; member < 2; member++)
                        {
                            multiTeam.suTeamPlayerFirstNames[member] = newTeam.suTeamPlayerFirstNames[member];
                            multiTeam.suTeamPlayerLastNames[member]  = newTeam.suTeamPlayerLastNames[member];
                        }
                        multiTeam.suTeamName = teamName + Convert.ToString(i);
                        multiTeam.Setter();
                    }
                }
                ClearTbx();
                btn_MultiCreate.Visibility  = Visibility.Visible;
                tbx_iMultiCreate.Visibility = Visibility.Hidden;
                lbl_sMultiCreate.Visibility = Visibility.Hidden;
                SignUpTeams_Loaded(sender, e);
            }
            else
            {
                mainWindow.MessageBar(MainWindow.ErrorMessage,
                                      "Fehlende Informationen",
                                      "Einige Informationen die zur Voranmeldung eines Teams benötigt werden fehlen!" +
                                      "\nBitte verfolständigen Sie diese!");
            }
        }