예제 #1
0
 public SpecialistInfo(ISpecialist spec, IEnumerable <string> SpecialisationsList)
 {
     InitializeComponent();
     this.spec = spec;
     this.specialisationsList = SpecialisationsList;
     InitializeSpecialistInfo();
 }
예제 #2
0
 private void lstSpecialistList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lstSpecialistList.SelectedIndex == -1 && SpecialistList == null)
     {
         return;
     }
     SelectedSpecialist = (ISpecialist)lstSpecialistList.SelectedItem;
 }
예제 #3
0
        private void ActivateEditMode(ISpecialist specialistInfo)
        {
            specialistInfoCard.Spec = specialistInfo;

            grpSelectSpecialist.Enabled = false;
            grpSelectSpecialist.Visible = false;

            grpEditMode.Visible        = true;
            grpEditMode.Enabled        = true;
            specialistInfoCard.Enabled = true;
        }
예제 #4
0
        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;
            }
        }
예제 #5
0
        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();
        }
예제 #6
0
        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;
        }
예제 #7
0
        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);
        }
예제 #8
0
        private void btnAddSpecialist_Click(object sender, EventArgs e)
        {
            ISpecialist newSpec = entityFactory.NewSpecialist();

            ActivateEditMode(newSpec);
        }