Example #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));
        }
Example #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];
        }