Ejemplo n.º 1
0
        public Form5(ref manager man, string s)
        {
            InitializeComponent();

            m = man;

            int x = int.Parse(s);

            //

            temp = m.arr[x];

            //

            st = new Queue <History>(temp.MedicalCase);

            f = false;
            //

            textBox1.Text = temp.PatientName;
            textBox2.Text = (temp.Age).ToString();
            textBox3.Text = temp.Address;
            textBox4.Text = (temp.id).ToString();
            textBox5.Text = temp.PhoneNumber;

            //
            textBox6.Text = st.Peek().date;
            textBox7.Text = st.Peek().Case;
            textBox8.Text = st.Peek().Prescribed_Medications;


            q.Enqueue(st.Dequeue());
        }
Ejemplo n.º 2
0
        public manager()
        {
            // arr = new NewPatient[1000];

            arr = new Dictionary <int, NewPatient>();

            ID = 1000;

            f = new FileStream("data.txt", FileMode.OpenOrCreate, FileAccess.Read);
            StreamReader sr2 = new StreamReader(f);

            if (f.Length != 0)
            {
                string[] arr2;


                arr2    = sr2.ReadLine().Split('=');
                this.ID = int.Parse(arr2[1]);


                arr2 = sr2.ReadLine().Split('=');
                this.num_patients = int.Parse(arr2[1]);



                for (int i = 0; i < num_patients; i++)
                {
                    NewPatient p = new NewPatient();
                    p.load_data(sr2);

                    arr[p.id] = p;
                }



                f.Close();
                sr2.Close();
            }


            f.Close();
            sr2.Close();
        }
Ejemplo n.º 3
0
        public void Append(string _name, int _age, string _address, string _phone, string _date, string _case, string _medical)
        {
            NewPatient p = new NewPatient();

            p.PatientName = _name;
            p.Age         = _age;
            p.Address     = _address;
            p.PhoneNumber = _phone;
            p.id          = ID;


            History h = new History(_date, _case, _medical);


            p.MedicalCase.Push(h);


            arr[ID] = p;
            ID++;
            num_patients++;
        }