示例#1
0
        public void initialiseFileWithoutDialog(int dayNr, String folderData, Compet Compet)
        {
            _dayNr = dayNr;
            _c     = Compet;
            _file  = Path.Combine(folderData, String.Format("ExtraShamrock{0}.json", _dayNr));

            _c.getDaybyNr(_dayNr).initialiseEmptyExtra();
            File.WriteAllText(_file, JsonConvert.SerializeObject(_c.getDaybyNr(_dayNr).extras));
        }
示例#2
0
 public void save()
 {
     _c.getDaybyNr(_dayNr).extras.extras.Clear();
     foreach (playerExtraForDisplay ctPS in playerExtrasForDisplay)
     {
         _c.getDaybyNr(_dayNr).extras.extras.Add(ctPS.playerName, ctPS.ptShamrock);
     }
     File.WriteAllText(_file, JsonConvert.SerializeObject(_c.getDaybyNr(_dayNr).extras));
 }
示例#3
0
        public void initialiseFileWithoutDialog(int dayNr, String folderData, Compet Compet)
        {
            _dayNr = dayNr;
            _c     = Compet;
            _file  = Path.Combine(folderData, String.Format("MatchScores{0}.json", _dayNr));

            _c.getDaybyNr(_dayNr).matchScores.initialise(_c.getDaybyNr(_dayNr).flights);
            File.WriteAllText(_file, JsonConvert.SerializeObject(_c.getDaybyNr(_dayNr).matchScores));
        }
示例#4
0
        public void display()
        {
            initialiseForDisplay(_c.getDaybyNr(_dayNr).flights, _c.getDaybyNr(_dayNr).matchScores);

            var bindingListP = new BindingList <matchScoreForDisplay>(matchScoresForDisplay);
            var sourceP      = new BindingSource(bindingListP, null);

            dataGridView1.DataSource      = sourceP;
            dataGridView1.CellValidating += new DataGridViewCellValidatingEventHandler(dataGridView1_CellValidating);
            //dataGridView1.CellEndEdit += new DataGridViewCellEventHandler(dataGridView1_CellEndEdit);
            dataGridView1.RowPostPaint += OnRowPostPaint;
            //dataGridView1.Rows[1].DefaultCellStyle.BackColor = Color.Red;
        }
示例#5
0
        public void ShowDialog(int dayNr, String folderData, Compet Compet)
        {
            _dayNr = dayNr;
            _c     = Compet;
            _file  = Path.Combine(folderData, String.Format("ExtraShamrock{0}.json", _dayNr));

            if (File.Exists(_file))
            {
                _c.getDaybyNr(_dayNr).extras = JsonConvert.DeserializeObject <dailyExtras>(File.ReadAllText(_file));
            }
            else
            {
                _c.getDaybyNr(_dayNr).initialiseEmptyExtra();
            }

            display();
            this.Text = "Extra Shamrock input for round " + _dayNr.ToString();

            this.ShowDialog();
        }
示例#6
0
        public void ShowDialog(int dayNr, String folderData, Compet Compet)
        {
            _dayNr = dayNr;
            _c     = Compet;
            _file  = Path.Combine(folderData, String.Format("MatchScores{0}.json", _dayNr));

            if (File.Exists(_file))
            {
                _c.getDaybyNr(_dayNr).matchScores = JsonConvert.DeserializeObject <MatchScores>(File.ReadAllText(_file));
            }
            else
            {
                _c.getDaybyNr(_dayNr).matchScores.initialise(_c.getDaybyNr(_dayNr).flights);
            }

            display();
            this.Text = "Match Results input for round " + _dayNr.ToString();

            this.ShowDialog();
        }
示例#7
0
 public void save()
 {
     _c.getDaybyNr(_dayNr).scores.holeResults.Clear();
     foreach (playerScoreForDisplay ctPS in playerScoresForDisplay)
     {
         if (ctPS.playerName != "par" && ctPS.playerName != "hcp")
         {
             List <int> ctHoleResults = new List <int>();
             foreach (hole ctHole in _c.getDaybyNr(_dayNr).courseDefinition.holes)
             {
                 String s  = ctPS.GetType().GetProperty(String.Format("_{0}", ctHole.nr)).GetValue(ctPS).ToString();
                 int    hr = 0;
                 if (int.TryParse(s, out hr))
                 {
                     ctHoleResults.Add(hr);
                 }
                 else
                 {
                     ctHoleResults.Add(0);
                 }
             }
             _c.getDaybyNr(_dayNr).scores.holeResults.Add(ctPS.playerName, ctHoleResults);
         }
     }
     File.WriteAllText(_file, JsonConvert.SerializeObject(_c.getDaybyNr(_dayNr).scores));
 }