private void buttonadd_Click(object sender, EventArgs e)
        {
            openminiformaddpatient(new Addpatient());
            Addpatient formAddPatient = new Addpatient("add");

            formAddPatient.ShowDialog();
            if (Addpatient.patient != null)
            {
                Patientcs p = new Patientcs(Addpatient.patient);
                // value type: int, double, char, string, boolean
                // reference type: Doctor, Patient, ...

                //AddDoctor.doctor; trong bộ nhớ address : 123
                //d trong bộ nhớ address: 234
                //d= AddDoctor.doctor; address của d = address của AddDoctor.doctor;

                if (string.IsNullOrEmpty(p.idp.ToString()) || string.IsNullOrEmpty(p.phone.ToString()) || string.IsNullOrEmpty(p.name.ToString()) || string.IsNullOrEmpty(p.gender.ToString()) || string.IsNullOrEmpty(p.address.ToString()) || string.IsNullOrEmpty(p.age.ToString()) || string.IsNullOrEmpty(p.cccd.ToString()) || string.IsNullOrEmpty(p.domicle.ToString()) || string.IsNullOrEmpty(p.idbhxh.ToString()) || string.IsNullOrEmpty(p.job.ToString()) || string.IsNullOrEmpty(p.nation.ToString()))
                {
                    // không có gì thay đổi vì thông tin nhập vào không đầy dủ
                }
                else
                {
                    listPatient.Add(p);
                    MessageBox.Show("Add successful");
                    LoadPatient();
                }
            }
        }
        private void buttonupdate_Click(object sender, EventArgs e)
        {
            openminiformaddpatient(new Addpatient());
            Addpatient formUpdate = new Addpatient("Update");
            int        index      = Patient.listPatient.IndexOf(this.patientSelected);

            Addpatient.patient.idp     = patientSelected.idp;
            Addpatient.patient.name    = patientSelected.name;
            Addpatient.patient.phone   = patientSelected.phone;
            Addpatient.patient.gender  = patientSelected.gender;
            Addpatient.patient.age     = patientSelected.age;
            Addpatient.patient.cccd    = patientSelected.cccd;
            Addpatient.patient.domicle = patientSelected.domicle;
            Addpatient.patient.idbhxh  = patientSelected.idbhxh;
            Addpatient.patient.nation  = patientSelected.nation;
            Addpatient.patient.address = patientSelected.address;
            Addpatient.patient.note    = patientSelected.note;
            Addpatient.patient.job     = patientSelected.job;
            formUpdate.ShowDialog();

            Patientcs p = (Patientcs)listPatient[index];

            p.idp              = Addpatient.patient.idp;
            p.name             = Addpatient.patient.name;
            p.gender           = Addpatient.patient.gender;
            p.phone            = Addpatient.patient.phone;
            p.cccd             = Addpatient.patient.cccd;
            p.address          = Addpatient.patient.address;
            p.idbhxh           = Addpatient.patient.idbhxh;
            p.age              = Addpatient.patient.age;
            p.domicle          = Addpatient.patient.domicle;
            p.nation           = Addpatient.patient.nation;
            p.note             = Addpatient.patient.note;
            p.job              = Addpatient.patient.job;
            Addpatient.patient = null;
            LoadPatient();
            MessageBox.Show("Update successful");
        }