コード例 #1
0
ファイル: Visits_View.cs プロジェクト: Vl4d1k/Med_centr
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            Visit visit   = (Visit)dataGridView1.CurrentRow.Tag;
            var   patient = visit.GetPatient();
            var   doctor  = visit.GetDoctor();
            var   servis  = visit.GetServise();
            var   treat   = visit.GetTreatment();

            if (e.ColumnIndex == 4)
            {
                new AddEditVisits(visit, doctor, patient, servis, treat).ShowDialog();
            }
            if (e.ColumnIndex == 5)
            {
                if (MessageBox.Show("Удалить записть пациента  " + patient.Name + " " + patient.Surname + "?", "Подтвердить", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
                {
                    visit.Delete();
                    ReloadData();
                }
            }
        }
コード例 #2
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            Visit visit   = (Visit)dataGridView1.CurrentRow.Tag;
            var   patient = visit.GetPatient();
            var   doctor  = visit.GetDoctor();
            var   servis  = visit.GetServise();
            var   treat   = visit.GetTreatment();

            if (e.ColumnIndex == 6)
            {
                new SetTherapy(patient, treat, visit).ShowDialog();
            }
            if (e.ColumnIndex == 7)
            {
                var his = Patient_histories.Records().Get();
                foreach (var pat_his in his)
                {
                    if (pat_his.Client_ID == patient.Pasport_ID)
                    {
                        new PatientHistory(patient, pat_his).ShowDialog();
                    }
                }
            }
        }