public void DeleteEmpFromFile(string nameOfEmploymentToDel) { string employmentToDel = FindEmploymentByName(nameOfEmploymentToDel); DataManagement.DeleteLineFromFile(employmentToDel, $"Employments\\{EmpType}"); WriteEmploymentToFile(employmentToDel, true); }
public void WriteEmploymentToFile(string employmentLine, bool writeToArchive = false) //запись в файл { string filePath = $"Employments\\{EmpType}"; if (writeToArchive) { filePath = $"Employments\\Archive\\{EmpType}"; } DataManagement.WriteLineToFile(employmentLine, filePath); }
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); } }
public static void DelGame(string gameName) { DataManagement.DeleteLineFromFile(gameName, "GamesList"); }