private void SetAtaChapters(ATAChapterCollection ataChaptersCollection) { for (int i = 0; i < ataChaptersCollection.Count; i++) { checkedListBoxATAChapter.Items.Add(ataChaptersCollection[i].FullName, true); } }
/* * Перегруженные методы */ #region public override void ApplyChanges() /// <summary> /// Применить к объекту сделанные изменения на контроле. /// Если не все данные удовлетворяют формату ввода (например при вводе чисел), свойства объекта не изменяются, возвращается false /// Вызов base.ApplyChanges() обязателен /// </summary> /// <returns></returns> public override void ApplyChanges() { if (Discrepancy != null) { Discrepancy.FilledBy = radioCrew.Checked ? DiscrepancyFilledByEnum.Crew : DiscrepancyFilledByEnum.MaintenanceStaff; // Если ATA глава не задана задаем N/A АТА главу Discrepancy.ATAChapter = ATAChapterCollection.GetATAChapterByName(textATA.Text); if (Discrepancy.ATAChapter == null) { Discrepancy.ATAChapter = ATAChapterCollection.Instance.NotApplicableATAChapter; } Discrepancy.CorrectiveAction.ADDNo = textADDNo.Text; Discrepancy.CorrectiveAction.Status = radioClose.Checked ? CorrectiveActionStatus.Close : CorrectiveActionStatus.Open; Discrepancy.Description = textDescription.Text; Discrepancy.CorrectiveAction.Description = textCorrectiveAction.Text; Discrepancy.CorrectiveAction.PartNumberOn = textPNOn.Text; Discrepancy.CorrectiveAction.PartNumberOff = textPNOff.Text; Discrepancy.CorrectiveAction.SerialNumberOn = textSNOn.Text; Discrepancy.CorrectiveAction.SerialNumberOff = textSNOff.Text; Discrepancy.CertificateOfReleaseToService.Station = textStation.Text; Discrepancy.CertificateOfReleaseToService.Date = UsefulMethods.StringToDate(textRTSDate.Text).Value; Discrepancy.CertificateOfReleaseToService.AuthorizationNo = textAuthNo.Text; } // base.ApplyChanges(); }
private ATAChapterFilter GetATAChapterFillter() { SelectCheckListBoxATAChapterByFilter(textBoxATAChapter.Text); bool[] typesAppliance = new bool[checkedListBoxATAChapter.Items.Count]; ATAChapterCollection ataChapters = ATAChapterCollection.Instance; for (int i = 0; i < typesAppliance.Length; i++) { typesAppliance[i] = ATAChapterAppliance[ataChapters[i].ShortName + " " + ataChapters[i].FullName]; } return(new ATAChapterFilter(typesAppliance)); }
private void LoadAtaChapters() { ATAChapterCollection ataChapters = ATAChapterCollection.Instance; int count = ataChapters.Count; ATAChapterAppliance = new Dictionary <string, bool>(); for (int i = 0; i < count; i++) { ATAChapterAppliance.Add(ataChapters[i].ShortName + " " + ataChapters[i].FullName, false); checkedListBoxATAChapter.Items.Add(ataChapters[i].ShortName + " " + ataChapters[i].FullName, false); } }
/// <summary> /// Создает экземпляр отображатора информации об агрегате /// </summary> /// <param name="currentDetail"></param> public DetailGeneralInformationControl(Detail currentDetail) : this() { if (null == currentDetail) { throw new ArgumentNullException("currentDetail", "Argument cannot be null"); } if (!(currentDetail.GetType() == typeof(Detail))) { throw new ArgumentException("Argument must be explicitly of type Detail", "currentDetail"); } this.currentDetail = currentDetail; maintananceCollection = MaintananceTypeCollection.Instance; ataChapterCollection = ATAChapterCollection.Instance; UpdateMode(); }
private void SetGroupsOrder() { groups.Clear(); ItemsListView.Groups.Clear(); ATAChapterCollection ataChapterCollection = ATAChapterCollection.Instance; groups.Add(enginesGroupName); groups.Add(apuGroupName); groups.Add(landingGearsGroupName); for (int i = 0; i < ataChapterCollection.Count; i++) { groups.Add(ataChapterCollection[i].ShortName + " " + ataChapterCollection[i].FullName); } groups.Add(consumablePartsGroupName); groups.Add(kitsGroupName); for (int i = 0; i < groups.Count; i++) { AddGroup(groups[i]); } }
private void SelectCheckListBoxATAChapterByFilter(bool[] appliance) { SetAllCheckListBoxATAChapterValuesBy(false); bool[] typesAppliance = appliance; ATAChapterCollection ataChapters = ATAChapterCollection.Instance; for (int i = 0; i < typesAppliance.Length; i++) { ATAChapterAppliance[ataChapters[i].ShortName + " " + ataChapters[i].FullName] = typesAppliance[i]; } for (int i = 0; i < checkedListBoxATAChapter.Items.Count; i++) { if (ATAChapterAppliance.ContainsKey(checkedListBoxATAChapter.Items[i].ToString())) { checkedListBoxATAChapter.SetItemChecked(i, ATAChapterAppliance[checkedListBoxATAChapter.Items[i].ToString()]); } else { checkedListBoxATAChapter.SetItemChecked(i, false); } } CheckTextBoxATAOnContained(); }
/// <summary> /// Создается элемент отображения фильтра по типу технического обслуживания /// </summary> /// <param name="ataChaptersCollection">Отображаемые главы</param> public ATAChapterFilterControl(ATAChapterCollection ataChaptersCollection) : this() { SetAtaChapters(ataChaptersCollection); }