Example #1
0
        private void button1_Click_2(object sender, EventArgs e)
        {
            IFormatter formatter = new BinaryFormatter();
            Stream     stream    = new FileStream("doctors.txt", FileMode.Create, FileAccess.Write);

            formatter.Serialize(stream, ConnectDb.GetDoctors());
            stream.Close();
            formatter = new BinaryFormatter();
            stream    = new FileStream("nurses.txt", FileMode.Create, FileAccess.Write);
            formatter.Serialize(stream, dtNurses);
            stream.Close();
            formatter = new BinaryFormatter();
            stream    = new FileStream("scedule.txt", FileMode.Create, FileAccess.Write);
            formatter.Serialize(stream, ConnectDb.getScedule());
            stream.Close();
            MessageBox.Show("Serialization successfull");
        }
 private void SeeScedule_Load(object sender, EventArgs e)
 {
     dataGridView1.DataSource = ConnectDb.getScedule();
 }