private void button1_Click(object sender, EventArgs e) { try { okFileOprosnikOpen = false; openFileDialog1.ShowDialog(); if (okFileOprosnikOpen) { oprosnik temp = new oprosnik(); temp.Load(openFileDialog1.FileName); editOprosnik ed = new editOprosnik(temp); ed.ShowDialog(); } } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void button2newOpros_Click(object sender, EventArgs e) { try { okFileOprosnikOpen = false; okFileOprosSave = false; openFileDialog1.ShowDialog(); if (okFileOprosnikOpen) { oprosnik temp = new oprosnik(); temp.Load(openFileDialog1.FileName); //создание опроса editOprosMini em = new editOprosMini(temp); em.ShowDialog(); if (em.DialogResult == DialogResult.OK) { anketa ank = new anketa(em.result); if (em.result.IsAnonimus == false) { ank.ShowDialog(); if (ank.DialogResult != DialogResult.OK) return; } saveFileDialog1.ShowDialog(); if (okFileOprosSave) { ank.res.save(saveFileDialog1.FileName); MessageBox.Show("Сохранено"); } } else return; //создали. сохреняем. } } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }