public void cmbAppointmentType_SelectedIndexChanged(object sender, EventArgs e) { AppointmentBase ap; if (cmbAppointmentType.SelectedIndex == 0) { ap = new DoctorAppointment(); _appointmentClassBase = new NewDoctorAppointmentClass(this); } else { ap = new SpecialistAppointment(); _appointmentBase.ProfessionalServiceProviderTypeId = (int)cmbAppointmentType.SelectedValue; _appointmentClassBase = new NewSpecialistAppointmentClass(this); } CommonFunctions.TransferPropertyValues(_appointmentBase, ap); _appointmentBase = ap; //_appointmentBase.ProfessionalServiceProviderTypeId = (int)cmbAppointmentType.SelectedValue; }
private void SetAppointmentValues() { if (_appointmentBase is NewAppointment) { _appointmentClassBase = new NewAppointmentClass(this);//, appointmentBase); } else { if (_appointmentBase is DoctorAppointment) { //this.cmbAppointmentType.SelectedItem = ((DoctorAppointment)appointmentBase).Doctor; _appointmentClassBase = new DoctorAppointmentClass(this);//, appointmentBase); } else { _appointmentClassBase = new SpecialistAppointmentClass(this);//, appointmentBase); } } }