private void MainWindow_Closing(object sender, CancelEventArgs e) { ResponseRepository.WriteResponsivesInDoc(txbx_fisp.Text, "response.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_vsp.Text, "vsp.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_nsp.Text, "nsp.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_dsp.Text, "dsp.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_nfil.Text, "nfill.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_ncbu.Text, "ncbu.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_notd.Text, "notd.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_acc.Text, "acc.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_total_p.Text, "totalp.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_total_s.Text, "totals.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_nzp.Text, "nzp.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_npp.Text, "npp.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_dpp.Text, "dpp.txt"); TypeEnroledRepository.WriteInfoInDoc(txbx_contract.Text, "contract.txt"); }
public MainWindow() { InitializeComponent(); this.Closing += MainWindow_Closing; this.Loaded += MainWindow_Loaded; string fileText; txbx_vsp.Text = TypeEnroledRepository.GetInfo("vsp.txt"); txbx_nsp.Text = TypeEnroledRepository.GetInfo("nsp.txt"); txbx_dsp.Text = TypeEnroledRepository.GetInfo("dsp.txt"); txbx_nfil.Text = TypeEnroledRepository.GetInfo("nfill.txt"); txbx_ncbu.Text = TypeEnroledRepository.GetInfo("ncbu.txt"); txbx_notd.Text = TypeEnroledRepository.GetInfo("notd.txt"); txbx_acc.Text = TypeEnroledRepository.GetInfo("acc.txt"); txbx_total_p.Text = TypeEnroledRepository.GetInfo("totalp.txt"); txbx_total_s.Text = TypeEnroledRepository.GetInfo("totals.txt"); txbx_nzp.Text = TypeEnroledRepository.GetInfo("nzp.txt"); txbx_npp.Text = TypeEnroledRepository.GetInfo("npp.txt"); txbx_dpp.Text = TypeEnroledRepository.GetInfo("dpp.txt"); txbx_contract.Text = TypeEnroledRepository.GetInfo("contract.txt"); //txbx_fisp.Text = TypeEnroledRepository.GetInfo("response.txt"); StreamReader sr = new StreamReader(@"txtfile.txt"); try { fileText = sr.ReadLine().ToString(); txbx_way.Text = fileText; } catch { fileText = ""; txbx_way.Text = fileText; } sr.Close(); }