public SpecialistInfo(ISpecialist spec, IEnumerable <string> SpecialisationsList) { InitializeComponent(); this.spec = spec; this.specialisationsList = SpecialisationsList; InitializeSpecialistInfo(); }
private void lstSpecialistList_SelectedIndexChanged(object sender, EventArgs e) { if (lstSpecialistList.SelectedIndex == -1 && SpecialistList == null) { return; } SelectedSpecialist = (ISpecialist)lstSpecialistList.SelectedItem; }
private void ActivateEditMode(ISpecialist specialistInfo) { specialistInfoCard.Spec = specialistInfo; grpSelectSpecialist.Enabled = false; grpSelectSpecialist.Visible = false; grpEditMode.Visible = true; grpEditMode.Enabled = true; specialistInfoCard.Enabled = true; }
private void txtSpecialistName_TextChanged(object sender, EventArgs e) { ISpecialist curSpec = null; curSpec = specList.FindSpecialistByPartialName(txtSpecialistName.Text); if (curSpec != null) { lstSpecialistList.SelectedItem = curSpec; } else { lstSpecialistList.SelectedIndex = -1; } }
private void cmbSpecialist_SelectedIndexChanged(object sender, EventArgs e) { if (cmbSpecialist.SelectedIndex == -1) { return; } ISpecialist currentSpec = (ISpecialist)cmbSpecialist.SelectedItem; currentSpecialistCosts = currentSpec.GetCosts(); cmbSpecialisation.DataSource = null; cmbSpecialisation.Items.Clear(); cmbSpecialisation.DataSource = currentSpec.Specialisations.ToArray(); ActualizePrice(); }
private void txtSpecialistName_TextChanged(object sender, EventArgs e) { if (doNothing) { return; } ISpecialist curSpec = null; curSpec = specList.List.FirstOrDefault(s => s.Name == txtSpecialistName.Text) ?? specList.FindSpecialistByPartialName(txtSpecialistName.Text); doNothing = true; if (curSpec != null) { lstSpecialistList.SelectedItem = curSpec; } else { lstSpecialistList.SelectedIndex = -1; } doNothing = false; }
private ISpecialist DeactivateEditMode() { ISpecialist result = specialistInfoCard.Spec; if (result != null) //если значение не установилось - пользователь отменил закрытие. { grpSelectSpecialist.Visible = true; grpSelectSpecialist.Enabled = true; grpEditMode.Visible = false; grpEditMode.Enabled = false; specialistInfoCard.Enabled = false; if (!specList.List.Contains(result)) { specList.List.Add(result); } lstSpecialistList.SelectedItem = result; } return(result); }
private void btnAddSpecialist_Click(object sender, EventArgs e) { ISpecialist newSpec = entityFactory.NewSpecialist(); ActivateEditMode(newSpec); }