Beispiel #1
0
        private void linkLabelAddNew_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var newCaa = new SpecialistCAA {
                SpecialistLicenseId = _license.ItemId, CaaType = CaaType.Other
            };

            _license.CaaLicense.Add(newCaa);
            AddCaaControl(newCaa);
        }
Beispiel #2
0
        private void AddCaaControl(SpecialistCAA caa)
        {
            var control = new EmployeeLicenceCaaControl {
                ShowButtonDelete = true
            };

            control.Deleted += Control_Deleted;

            control.UpdateControl(caa);

            flowLayoutPanelCaa.Controls.Remove(linkLabelAddNewCAA);
            flowLayoutPanelCaa.Controls.Add(control);
            flowLayoutPanelCaa.Controls.Add(linkLabelAddNewCAA);
            flowLayoutPanelCaa.Height += 30;
        }
Beispiel #3
0
        public void UpdateControl(SpecialistCAA specialistCaa)
        {
            _specialistCaa = specialistCaa;

            comboBoxCAA.Items.Clear();
            foreach (var o in Citizenship.Items)
            {
                comboBoxCAA.Items.Add(o);
            }

            comboBoxCAA.SelectedItem       = _specialistCaa.Caa;
            textBoxCAANumber.Text          = _specialistCaa.CAANumber;
            dateTimePickerValidToCAA.Value = _specialistCaa.ValidToDate;
            dateTimePickerIssueDate.Value  = _specialistCaa.IssueDate;
            lifelengthViewer1.Lifelength   = _specialistCaa.NotifyLifelength;

            documentControl1.CurrentDocument = _specialistCaa.Document;
            documentControl1.Added          += DocumentControl1_Added;
        }
Beispiel #4
0
        public void UpdateControl(SpecialistLicense license, PersonnelCategory personnelCategory, List <AircraftModel> aircraftModels)
        {
            _license = license;
            UpdateLicenceCombobox(personnelCategory);

            //CAA
            var licenseCaa = _license.CaaLicense.FirstOrDefault(c => c.CaaType == CaaType.Licence);

            if (licenseCaa != null)
            {
                employeeLicenceLicenseCaaControl.UpdateControl(licenseCaa);
            }
            else
            {
                var newCaaLicense = new SpecialistCAA {
                    CaaType = CaaType.Licence
                };
                employeeLicenceLicenseCaaControl.UpdateControl(newCaaLicense);
                _license.CaaLicense.Add(newCaaLicense);
            }

            foreach (var caa in _license.CaaLicense.Where(c => c.CaaType == CaaType.Other))
            {
                AddCaaControl(caa);
            }

            //Detail
            foreach (var licenseDetail in _license.LicenseDetails)
            {
                AddDetailControl(licenseDetail);
            }

            //Rating
            foreach (var licenseRating in _license.LicenseRatings)
            {
                AddRatingControl(licenseRating);
            }

            //InstrumentRating
            foreach (var instrumentRating in _license.SpecialistInstrumentRatings)
            {
                AddInstrumentRatingControl(instrumentRating);
            }

            //Remark
            foreach (var instrumentRating in _license.LicenseRemark)
            {
                AddRemarkControl(instrumentRating);
            }

            comboBoxCategory.Items.Clear();
            foreach (var aircraftModel in aircraftModels)
            {
                comboBoxCategory.Items.Add(aircraftModel);
            }

            comboBoxCategory.Items.Add(AircraftModel.Unknown);


            flowLayoutPanelCaa.Enabled = _license.Confirmation;


            UpdateInformation();
        }