private void dataGridView1_RowHeaderMouseDoubleClick_1(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (!_mdiForm.Jarvis.CurrentUser.UserHasPermissionForAction("Appointment", "Edit"))
            {
                return;
            }

            int             index = e.RowIndex;
            int             apId  = (int)dgAppointment.Rows[e.RowIndex].Cells[0].Value;
            AppointmentBase ap    = _appointmentSearchClassBase.GetAppointment(apId);

            if (ap != null)
            {
                //if (Application.OpenForms["StudentAddEdit"] as StudentAddEdit != null)
                //{
                //    StudentAddEdit frm1 = (StudentAddEdit)Application.OpenForms["StudentAddEdit"];
                //    frm1.Close();
                //}
                AddEditAppointment frm = new AddEditAppointment(ap);
                //frm.MdiParent = _mdiForm;
                //frm.Dock = DockStyle.Fill;
                //frm.FormBorderStyle = FormBorderStyle.None;
                frm.ShowDialog();
                LoadAppointments();
            }
        }
        //public DoctorAppointmentClass(AddEditAppointment appointmentAddEdit, AppointmentBase ap) :base(appointmentAddEdit,ap)
        //{
        //    _frm.PopulateDoctors();
        //    _frm.cmbSpecialistId.SelectedValue = ((DoctorAppointment)_ap).Doctor.PersonId;
        //    _frm.cmbResidentId.SelectedValue = _ap.Student.PersonId;
        //    _frm.cmbStaffAccompanyingId.SelectedValue = _ap.StaffAccompanying.PersonId;
        //    _frm.cmbKeyCode.SelectedText = ((DoctorAppointment)_ap).KeyCode;
        //    _frm.cmbAddSpecialist.Enabled = true;
        //    _frm.cmbKeyCode.Enabled = true;
        //    base.AddIndexChangedEvent();

        //}

        public NewDoctorAppointmentClass(AddEditAppointment appointmentAddEdit) : base(appointmentAddEdit)
        {
            _frm.cmbSpecialistId.SelectedIndexChanged -= _frm.cmbSpecialistId_SelectedIndexChanged;
            _frm.PopulateDoctors();
            _frm.cmbKeyCode.Enabled                    = true;
            _frm.cmbKeyCode.SelectedIndex              = -1;
            _frm.cmbSpecialistId.SelectedIndex         = -1;
            _frm.cmbSpecialistId.SelectedIndexChanged += _frm.cmbSpecialistId_SelectedIndexChanged;
        }
Пример #3
0
        //public NewAppointmentClass(AddEditAppointment appointmentAddEdit, AppointmentBase ap) :base(appointmentAddEdit,ap)
        //{
        //    //_frm.PopulateCmboBoxes();
        //    _frm.cmbAddSpecialist.Enabled = false;
        //    _frm.cmbKeyCode.Enabled = false;
        //    base.AddIndexChangedEvent();
        //}

        public NewAppointmentClass(AddEditAppointment appointmentAddEdit) : base(appointmentAddEdit)
        {
            _frm.cmbAddSpecialist.Enabled         = false;
            _frm.cmbKeyCode.Enabled               = false;
            _frm.cmbSpecialistId.SelectedIndex    = -1;
            _frm.cmbAppointmentType.SelectedIndex = -1;
            _frm.cmbResidentId.SelectedIndex      = -1;
            _frm.lblHeader.Text = "Add Appointment";
            _frm.cmbStaffAccompanyingId.SelectedIndex = -1;
        }
        private void addNewStudentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!_mdiForm.Jarvis.CurrentUser.UserHasPermissionForAction("Appointment", "Add"))
            {
                return;
            }
            AddEditAppointment frm = new AddEditAppointment(new NewAppointment());

            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK)
            {
                LoadAppointments();
                //SetDataSource();
            }
        }
        //public SpecialistAppointmentClass(AddEditAppointment appointmentAddEdit, AppointmentBase ap) :base(appointmentAddEdit,ap)
        //{
        //    //_frm.PopulateCmboBoxes();
        //    //_frm.cmbAppointmentType.SelectedValue = _frm._
        //    _frm.cmbAppointmentType.SelectedValue = ap.ProfessionalServiceProviderTypeId;
        //    _frm.PopulateSpecialists();
        //    _frm.cmbSpecialistId.SelectedValue = ((SpecialistAppointment)_ap).Specialist.PersonId;
        //    _frm.cmbResidentId.SelectedValue = _ap.Student.PersonId;
        //    _frm.cmbStaffAccompanyingId.SelectedValue = _ap.StaffAccompanying.PersonId;
        //    _frm.cmbSpecialistId.SelectedIndex = -1;
        //    _frm.cmbAddSpecialist.Enabled = true;
        //    _frm.cmbKeyCode.Enabled = false;
        //    base.AddIndexChangedEvent();
        //}

        public SpecialistAppointmentClass(AddEditAppointment appointmentAddEdit) : base(appointmentAddEdit)
        {
            //_frm.cmbAppointmentType.SelectedValue = _frm._
            _frm.cmbSpecialistId.SelectedIndexChanged -= _frm.cmbSpecialistId_SelectedIndexChanged;
            _frm.cmbAppointmentType.SelectedValue      = _frm._appointmentBase.ProfessionalServiceProviderTypeId;
            _frm.PopulateSpecialists();
            SpecialistAppointment ap = (SpecialistAppointment)_frm._appointmentBase;

            _frm.cmbSpecialistId.SelectedValue = ap.Specialist.PersonId;
            base.setComboBoxValues();
            //_frm.cmbAddSpecialist.Enabled = true;
            _frm.cmbKeyCode.Enabled = false;
            //_frm.btnAddAppontment.Text = "Edit Appointment";
            _frm.lblHeader.Text = "Edit Appointment";
            _frm.Text           = "Edit Appointment";
            _frm.cmbSpecialistId.SelectedIndexChanged += _frm.cmbSpecialistId_SelectedIndexChanged;
        }
        //public DoctorAppointmentClass(AddEditAppointment appointmentAddEdit, AppointmentBase ap) :base(appointmentAddEdit,ap)
        //{
        //    _frm.PopulateDoctors();
        //    _frm.cmbSpecialistId.SelectedValue = ((DoctorAppointment)_ap).Doctor.PersonId;
        //    _frm.cmbResidentId.SelectedValue = _ap.Student.PersonId;
        //    _frm.cmbStaffAccompanyingId.SelectedValue = _ap.StaffAccompanying.PersonId;
        //    _frm.cmbKeyCode.SelectedText = ((DoctorAppointment)_ap).KeyCode;
        //    _frm.cmbAddSpecialist.Enabled = true;
        //    _frm.cmbKeyCode.Enabled = true;
        //    base.AddIndexChangedEvent();

        //}

        public DoctorAppointmentClass(AddEditAppointment appointmentAddEdit) : base(appointmentAddEdit)
        {
            _frm.cmbSpecialistId.SelectedIndexChanged -= _frm.cmbSpecialistId_SelectedIndexChanged;
            _frm.cmbAppointmentType.SelectedValue      = _frm._appointmentBase.ProfessionalServiceProviderTypeId;
            _frm.PopulateDoctors();
            DoctorAppointment ap = (DoctorAppointment)_frm._appointmentBase;

            //if(ap.Doctor !=null)
            _frm.cmbSpecialistId.SelectedValue = ap.Doctor.PersonId;
            _frm.cmbKeyCode.Text = ap.KeyCode;
            base.setComboBoxValues();
            //_frm.cmbAddSpecialist.Enabled = true;
            _frm.cmbKeyCode.Enabled = true;
            _frm.lblHeader.Text     = "Edit Appointment";
            _frm.Text = "Edit Appointment";
            _frm.cmbSpecialistId.SelectedIndexChanged += _frm.cmbSpecialistId_SelectedIndexChanged;
            //_frm.cmbKeyCode.SelectedIndex = -1;
        }
Пример #7
0
 public AppointmentClassBase(AddEditAppointment appointmentAddEdit)
 {
     _frm = appointmentAddEdit;
     _frm.cmbKeyCode.Enabled = false;
     //_frm.cmbKeyCode.SelectedIndex = -1;
 }