Ejemplo n.º 1
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 == 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();
                }
            }
        }
Ejemplo n.º 2
0
        private void calendar1_ItemDeleting(object sender, CalendarItemCancelEventArgs e)
        {
            Visit visit1 = new Visit(Convert.ToInt32(e.Item.ID), userID);

            if (!visit1.canEditPlan)
            {
                MessageBox.Show("Невозможно удалить план в прошлом", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                e.Cancel = true;
                return;
            }

            if ((visit1.CommRD != "") && (globalData.UserAccess > 4))
            {
                MessageBox.Show("С комментариями руководителя нельзя удалить план", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                e.Cancel = true;
            }
            else
            {
                visit1.Delete();
                globalData.update = true;
            }
        }