示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                string machineNameV = listBox1.SelectedItem.ToString();
                machineNames.Remove(machineNameV);
                name = listBox2.SelectedItem.ToString();
                string nameOnly = name.Split('-')[0];
                string date     = name.Split('-')[3];
                Console.WriteLine("PATIENT INDEX IN NAME: " + names.IndexOf(name));
                //Console.WriteLine("PATIENTNAMES AMOUNT: " + patientNames.Count);
                Patient p = patients.ElementAt(names.IndexOf(name));
                names.Remove(name);
                doctor.SendCombo(machineNameV, nameOnly, date);

                bc = new BikeClientInfo(machineNameV, tabControl1, doctor, nameOnly, date, p);
                doctor.GetOldData(nameOnly);
                bc.Dock = DockStyle.Fill;
                TabPage tp = new TabPage();

                tp.Text = nameOnly + tabControl1.TabCount;

                tp.Controls.Add(bc);
                tabControl1.TabPages.Add(tp);
                tabControl1.SelectedTab = tp;
                UpdateForm(machineNames, patientNames);
                this.doctor.StartSession(60);
                this.tabControl1.SelectedTab = tp;
                bc.LoadItems();
            }
            catch
            {
                MessageBox.Show("Please select a machinename and a patient!", "Warning");
            }
        }
        public AvansAstrand(ClientDoctor clientDoc, string name, Patient p, BikeClientInfo bikeInfo)
        {
            InitializeComponent();
            this.Vo2            = VO2Max;
            this.machineName    = name;
            this.time           = "";
            this.doctor         = clientDoc;
            this.Chart          = DataChart;
            this.infoScreen     = InfoBox;
            this.UpdateText     = UpdateLabel;
            this.HeartBeatLabel = HartslagLabel;
            this.RPMLabel       = RPMlabel;
            this.PowerLabel     = WeerstandLabel;
            Patient patient = p;

            //this.exercise = new Exercise(this, doctor, name, patient, bikeInfo);
            this.hasBeen0            = false;
            this.doctor.AvansAstrand = this;
        }