Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Action action = new Action(textBox1.Text, int.Parse(textBox2.Text), checkBox1.Checked);

            ActionAdministrator.AddAction(action);
            this.Close();
        }
Example #2
0
        private void черговийІнститутуToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BinaryFormatter formatter = new BinaryFormatter();

            using (FileStream fs = new FileStream(FormAdministrator.CategoriesFolder + "cherg.bin", FileMode.OpenOrCreate))
            {
                if (fs.Length != 0)
                {
                    List <Action> bufer = (List <Action>)formatter.Deserialize(fs);
                    foreach (Action a in bufer)
                    {
                        ActionAdministrator.AddAction(a);
                    }
                }
            }
        }