private void save_button_Click_1(object sender, EventArgs e) { string name = name_textBox.Text; string description = descrption_textBox.Text; string working = wording_textBox.Text; if (name != "" && description != "" && working != "") { Clause obj = new Clause(name, description, working); objects.Add(new Clause(obj)); string filename = "Clauses.txt"; FileStream s = File.Open(filename, FileMode.Truncate); foreach (Clause clause in objects) { BinaryFormatter b = new BinaryFormatter(); b.Serialize(s, clause); } s.Close(); MessageBox.Show("Clause Updated!"); Contractible form = new Contractible(); form.Show(); this.Hide(); } else { MessageBox.Show("Please Fill all the details!"); } }
private void cancel_button_Click(object sender, EventArgs e) { Contractible form = new Contractible(); form.Show(); this.Hide(); }