Example #1
0
        public void DeleteEmpFromFile(string nameOfEmploymentToDel)
        {
            string employmentToDel = FindEmploymentByName(nameOfEmploymentToDel);

            DataManagement.DeleteLineFromFile(employmentToDel, $"Employments\\{EmpType}");
            WriteEmploymentToFile(employmentToDel, true);
        }
Example #2
0
        public void WriteEmploymentToFile(string employmentLine, bool writeToArchive = false)    //запись в файл
        {
            string filePath = $"Employments\\{EmpType}";

            if (writeToArchive)
            {
                filePath = $"Employments\\Archive\\{EmpType}";
            }

            DataManagement.WriteLineToFile(employmentLine, filePath);
        }
Example #3
0
        public static void AddGame(ComboBox GamesComboBox, string gameName)
        {
            bool gameAlreadyAdded = false;

            foreach (string line in GamesComboBox.Items)
            {
                if (line == gameName)
                {
                    gameAlreadyAdded = true;
                }
            }

            if (gameAlreadyAdded)
            {
                MessageBox.Show("Игра с таким именем уже добавлена!", "Уже готово!");
            }
            else
            {
                DataManagement.WriteLineToFile(gameName, GamesListFileName);
            }
        }
Example #4
0
 public static void DelGame(string gameName)
 {
     DataManagement.DeleteLineFromFile(gameName, "GamesList");
 }