Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Law l = new Law();

            l.AddLaw(textBox1.Text, comboBox1.Text, richTextBox1.Text);
            MessageBox.Show("Added");
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Law l = new Law();

            l.DeleteLaw(comboBox1.Text);
            MessageBox.Show("Deleted");
        }
Esempio n. 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            Law d = new Law();

            d.Update(comboBox1.Text, richTextBox1.Text);
            MessageBox.Show("Updated");
        }
Esempio n. 4
0
        public void AddLaw(string id, string t, string txt)
        {
            Law a = new Law(id, t, txt);

            Law.Lawslist.Add(a);
            Data.writeFile();
        }
Esempio n. 5
0
        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();
        }