public void ImportFile() { handlingStatus.Text = "Solution File"; dataStatus.Text = "Question File"; handlingData = JsonConvert.DeserializeObject <HandlingData>(File.ReadAllText(handlingFileLocation, Encoding.UTF8)); importedData = JsonConvert.DeserializeObject <ReportingData>(File.ReadAllText(dataFileLocation, Encoding.UTF8)); if (importedData != null) { dataStatus.Foreground = Brushes.Green; } else { dataStatus.Foreground = Brushes.Red; } if (handlingData != null) { handlingStatus.Foreground = Brushes.Green; } else { handlingStatus.Text = "No Solution File"; handlingStatus.Foreground = Brushes.Red; handlingData = new HandlingData(); } }
public void ImportFile() { handlingData = JsonConvert.DeserializeObject <HandlingData>(File.ReadAllText(handlingFileLocation, Encoding.UTF8)); importedData = JsonConvert.DeserializeObject <ReportingData>(File.ReadAllText(dataFileLocation, Encoding.UTF8)); if (importedData == null) { MessageBox.Show("Question File is either corrupted or not setup. \nSetup a new file or Contact Admin"); } if (handlingData == null) { MessageBox.Show("Solution File is either corrupted or not setup. \nSetup a new file or Contact Admin"); } }