public void UpdateLastFile(HM.Resources.FileType fileType, string fileName) { bool FileExists = false; string currentDate = DateTime.Now.ToString(HM.Resources.Constants.Chpp.HMDateFormat); //Try and update an exisiting field for (int i = 0; i < lastFileListField.Count; i++) { LastFiles file = lastFileListField[i]; if (file.fileTypeField == fileType) { file.fileNameField = fileName; file.dateField = currentDate; FileExists = true; break; } } // Create New Last File Field if (!FileExists) { LastFiles newFile = new LastFiles(); newFile.fileTypeField = fileType; newFile.fileNameField = fileName; newFile.dateField = currentDate; lastFileListField.Add(newFile); } }
public string GetLastFileName(HM.Resources.FileType fileType) { string filename = string.Empty; //Try and update an exisiting field for (int i = 0; i < lastFileListField.Count; i++) { LastFiles file = lastFileListField[i]; if (file.fileTypeField == fileType) { filename = file.fileNameField; break; } } return(filename); }