public static void GenerateUserReport(Student student) { tempStudent = student; Type officeType = Type.GetTypeFromProgID(Constants.ExcelApplication); if (officeType == null) { new CustomMessageBox(Constants.MessageIfNoExcelInstalled).Show(); FileManager.WriteToLogFile(Constants.MessageIfNoExcelInstalled); } else { SaveFileDialog saveFile = new SaveFileDialog(); saveFile.Filter = Constants.ExcelFileTypeFilter; if (saveFile.ShowDialog() == true) { fullPath = saveFile.FileName; CreateTimer(); } } }
public static User CreateSubUserObject(String line) //Returns a user object based on an input String { User tempUser; String[] properties = line.Split(Constants.SemiColon); if (properties[0].Equals(Convert.ToString(Constants.UserTypeStudent))) { tempUser = new Student(properties[1], properties[2], properties[3], properties[4], properties[5], Convert.ToInt32(properties[6]), Convert.ToInt32(properties[7])); } else { tempUser = new Teacher(properties[1], properties[2], properties[3], properties[4], properties[5]); } return tempUser; }
private void GeneratePreviousResults(Student tempStudent) { List<UserResult> resultsList = FileManager.ReadUserResultsFile(tempStudent); resultsTextBlock.Text = String.Empty; foreach (UserResult result in resultsList) { resultsTextBlock.Text += String.Concat(result.ToString(),Environment.NewLine); } }