Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DoctorForm form = new DoctorForm();

            form.ShowDialog();
            dataGridView1.DataSource = ConnectDb.GetDoctors();
        }
Пример #2
0
 public Dashboard(int key)
 {
     InitializeComponent();
     this.key  = key;
     dtDoctors = new DataTable();
     dtNurses  = new DataTable();
     dtDoctors = ConnectDb.GetDoctors();
     dtNurses  = ConnectDb.GetNurses();
     dataGridView1.DataSource = dtDoctors;
     dataGridView2.DataSource = dtNurses;
     dataGridView2.Columns["Type"].Visible     = false;
     dataGridView2.Columns["Password"].Visible = false;
     dataGridView1.Columns["Type"].Visible     = false;
     dataGridView1.Columns["Password"].Visible = false;
     dataGridView2.Columns["PwzNo"].Visible    = false;
     btnNewDoctor.Visible = false;
     btnNewNurse.Visible  = false;
     btnNewAdmin.Visible  = false;
     if (key == 1)
     {
         dataGridView1.ContextMenuStrip = contextMenuStrip1;
         dataGridView2.ContextMenuStrip = contextMenuStrip2;
         btnNewDoctor.Visible           = true;
         btnNewNurse.Visible            = true;
         btnNewAdmin.Visible            = true;
     }
 }
Пример #3
0
 private void Dashboard_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Control && e.KeyCode == Keys.S)
     {
         ConnectDb.UpdateDoctors(doctor);
         dataGridView1.DataSource = ConnectDb.GetDoctors();
     }
 }
Пример #4
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");
        }