private void buttonAdd_Click(object sender, EventArgs e) { if (workPackageEmployeeListViewAll.SelectedItems.Count == 0) { return; } foreach (var selectedItem in workPackageEmployeeListViewAll.SelectedItems) { if (_wpSpecialists.Any(s => s.ItemId == selectedItem.ItemId)) { MessageBox.Show($"{selectedItem.FirstName} {selectedItem.LastName} alredy added!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2); continue; } try { var wpSpecialist = new WorkPackageSpecialists { SpecialistId = selectedItem.ItemId, WorkPackageId = _currentWorkPackage.ItemId }; _wpSpecialists.Add(selectedItem); GlobalObjects.CasEnvironment.NewKeeper.Save(wpSpecialist); _workPackageSpecialists.Add(wpSpecialist); } catch (Exception ex) { Program.Provider.Logger.Log("Error while save bind task record", ex); } } workPackageEmployeeListView2.SetItemsArray(_wpSpecialists.ToArray()); }
private void BackgroundWorkerRunWorkerLoadCompleted(object sender, RunWorkerCompletedEventArgs e) { if (_addedChecks.Any(i => i.CheckUIType == CheckUIType.Iosa)) { _fromcheckListView = new CheckListView(); _tocheckListView = new CheckListView(); } else if (_addedChecks.Any(i => i.CheckUIType == CheckUIType.Safa)) { _fromcheckListView = new CheckListSAFAView(); _tocheckListView = new CheckListSAFAView(); } else if (_addedChecks.Any(i => i.CheckUIType == CheckUIType.Icao)) { _fromcheckListView = new CheckListICAOView(); _tocheckListView = new CheckListICAOView(); } // // _fromcheckListView // this._fromcheckListView.Location = new System.Drawing.Point(5, 53); this._fromcheckListView.Name = "_fromcheckListView"; this._fromcheckListView.Size = new System.Drawing.Size(1510, 306); // // _tocheckListView // this._tocheckListView.Location = new System.Drawing.Point(5, 406); this._tocheckListView.Name = "_tocheckListView"; this._tocheckListView.Size = new System.Drawing.Size(1510, 346); this.Controls.Add(this._tocheckListView); this.Controls.Add(this._fromcheckListView); UpdateInformation(); }
private void BackgroundWorkerRunWorkerLoadCompleted(object sender, RunWorkerCompletedEventArgs e) { if (_addedChecks.Any(i => i.CheckUIType == CheckUIType.Iosa)) { _tocheckRevisionListView = new AuditPelRecordListView(); _fromcheckRevisionListView = new PelItemListView(); } else if (_addedChecks.Any(i => i.CheckUIType == CheckUIType.Safa)) { _tocheckRevisionListView = new AuditPelRecordSafaListView(); _fromcheckRevisionListView = new PelItemSafaListView(); } else if (_addedChecks.Any(i => i.CheckUIType == CheckUIType.Safa)) { _tocheckRevisionListView = new AuditPelRecordICAOListView(); _fromcheckRevisionListView = new PelItemICAOListView(); } // // _fromcheckRevisionListView // _fromcheckRevisionListView.Location = new System.Drawing.Point(5, 53); _fromcheckRevisionListView.Name = "_fromcheckRevisionListView"; _fromcheckRevisionListView.Size = new System.Drawing.Size(1419, 317); // // _tocheckRevisionListView // _tocheckRevisionListView.Location = new System.Drawing.Point(5, 417); _tocheckRevisionListView.Name = "_tocheckRevisionListView"; _tocheckRevisionListView.Size = new System.Drawing.Size(1419, 346); Controls.Add(_tocheckRevisionListView); Controls.Add(_fromcheckRevisionListView); UpdateInformation(); }
private void ButtonAdd_Click(object sender, EventArgs e) { if (_fromcheckRevisionListView.SelectedItems.Count > 0) { if (comboBoxOccupation.SelectedItem == null) { MessageBox.Show("Please select Occupation!", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2); return; } if (comboBoxPriority.SelectedItem == null) { MessageBox.Show("Please select Priority!", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2); return; } var occupation = comboBoxOccupation.SelectedItem as Occupation; var priority = comboBoxPriority.SelectedItem as EducationPriority; foreach (var item in _fromcheckRevisionListView.SelectedItems.ToArray()) { if (_updateChecks.Any(i => i.TaskId == item.ItemId && i.OccupationId == occupation.ItemId && i.Priority.ItemId == priority.ItemId)) { continue; } var newItem = new SmartCore.CAA.CAAEducation.CAAEducation() { OperatorId = _operatorId, Occupation = occupation, OccupationId = occupation.ItemId, Priority = priority, Task = item, TaskId = item.ItemId, }; GlobalObjects.CaaEnvironment.NewKeeper.Save(newItem); _updateChecks.Add(newItem); } _fromcheckRevisionListView.SetItemsArray(_addedChecks.ToArray()); _tocheckRevisionListView.SetItemsArray(_updateChecks.ToArray()); } }
private void ButtonAddClick(object sender, EventArgs e) { if (_initialDocumentArray.Any(i => i.Type == RevisionType.Edition && i.Status == EditionRevisionStatus.Temporary)) { MessageBox.Show("Edition in status Temporary already exist!", "Exclamation", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } var form = new EditionForm(new CheckListRevision { OperatorId = _operatorId, Type = RevisionType.Edition, Status = EditionRevisionStatus.Temporary, ManualId = _manual.ItemId }); if (form.ShowDialog() == DialogResult.OK) { AnimatedThreadWorker.RunWorkerAsync(); } }