private void Page_Loaded(object sender, RoutedEventArgs e) { App.BaseClass.GetServiceEquipmentClass(ref _sec); App.BaseClass.GetCatalogClass(ref _cc); _workSubSectionConverter = new IdToWorkSubSectionConverter(); _workUnitConverter = new IdToWorkUnitConverter(); _workSectionConverter = new IdToWorkSectionConverter(); BindingData(); if (_enteringLoad) { RequestTypeComboBox.IsEnabled = false; GroupComboBox.IsEnabled = false; FactoryComboBox.IsEnabled = false; WorkUnitsComboBox.IsEnabled = false; WorkSectionsComboBox.IsEnabled = false; WorkSubSectionsComboBox.IsEnabled = false; } if (_requestType == ServiceEquipmentClass.RequestType.Crash) { if (RequestTypeComboBox.Items.Count != 0) { RequestTypeComboBox.SelectedIndex = 0; } } else { if (RequestTypeComboBox.Items.Count > 1) { RequestTypeComboBox.SelectedIndex = 1; } else if (RequestTypeComboBox.Items.Count != 0) { RequestTypeComboBox.SelectedIndex = 0; } } }
private void OnReceiveButtonClick(object sender, RoutedEventArgs e) { var request = MainDataGrid.SelectedItem as DataRowView; if (request == null) { return; } var globalId = request["GlobalID"].ToString(); var taskName = new IdToWorkSectionConverter().Convert(request["WorkSectionID"], typeof(string), null, CultureInfo.InvariantCulture).ToString(); var taskDescription = request["RequestNotes"].ToString(); const TaskClass.SenderApplications senderApplication = TaskClass.SenderApplications.TechnologyProblem; var addNewTaskWindow = new AddNewTask(globalId, taskName, taskDescription, senderApplication); var mainWindow = Window.GetWindow(this) as MainWindow; if (mainWindow != null) { mainWindow.ShowCatalogGrid(addNewTaskWindow, "Выбрать исполнителей"); } }