private void button1_Click(object sender, EventArgs e) { Law l = new Law(); l.AddLaw(textBox1.Text, comboBox1.Text, richTextBox1.Text); MessageBox.Show("Added"); }
private void button1_Click(object sender, EventArgs e) { Law l = new Law(); l.DeleteLaw(comboBox1.Text); MessageBox.Show("Deleted"); }
private void button3_Click(object sender, EventArgs e) { Law d = new Law(); d.Update(comboBox1.Text, richTextBox1.Text); MessageBox.Show("Updated"); }
public void AddLaw(string id, string t, string txt) { Law a = new Law(id, t, txt); Law.Lawslist.Add(a); Data.writeFile(); }
public void read_Law() { FileStream fs = new FileStream("Law.txt", FileMode.Open); StreamReader sr = new StreamReader(fs); while (sr.Peek() != -1) { string s = sr.ReadLine(); string[] arr = s.Split(','); string id = arr[0]; string type = arr[1]; string txt = arr[2]; Law cc = new Law(id, type, txt); Law.Lawslist.Add(cc); } fs.Close(); }