Esempio n. 1
0
        // Custom: Save referee data
        public void SaveRefereeData()
        {
            // For each row in the grid
            foreach (DataGridViewRow row in RefereeData.Rows)
            {
                // skip new entry row
                if (row.IsNewRow)
                {
                    continue;
                }

                // Get the Referee written in the grid
                var tRefName = row.Cells[0].Value.ToString();

                // Check if he is already in the database
                var found = false;
                foreach (var j in ApplicationData.Refs)
                {
                    // Found in File Database
                    if (j.name == tRefName)
                    {
                        found = true;
                    }
                }

                // We found them in the database therefore he exists so go to the next grid entry
                if (found)
                {
                    continue;
                }

                // He's not in, so add him.
                ApplicationData.AddRef(new Core.Referee {
                    name = tRefName
                });
            }

            ApplicationData.SaveData();
        }