private void stationControl_modifyClicked(object sender, EventArgs e) { if (lineControl.dgItem.SelectedIndex == -1) { MessageBox.Show("Please Select Line", "Info", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (stationControl.dgItem.SelectedIndex == -1) { MessageBox.Show("Please Select Station", "Info", MessageBoxButton.OK, MessageBoxImage.Information); return; } stationInfo stationInfo = new stationInfo(); stationInfo.LineIndex = lineControl.dgItem.SelectedIndex; stationInfo.ItemIndex = stationControl.dgItem.SelectedIndex; stationInfo.ID = lines[lineControl.dgItem.SelectedIndex].Stations[stationControl.dgItem.SelectedIndex].ID; stationInfo.Name = lines[lineControl.dgItem.SelectedIndex].Stations[stationControl.dgItem.SelectedIndex].Name; stationInfo.CycleTime = lines[lineControl.dgItem.SelectedIndex].Stations[stationControl.dgItem.SelectedIndex].CycleTime; stationInfo.BottleNeckTime = lines[lineControl.dgItem.SelectedIndex].Stations[stationControl.dgItem.SelectedIndex].BottleNeckTime; stationInfoPage = new StationInfo(stationInfo); stationInfoPage.allowModification(); NavigationService.Navigate(stationInfoPage); stationInfoPage.Return += new ReturnEventHandler <stationInfo>(stationInfoPage_Return); }
private void stationControl_addClicked(object sender, EventArgs e) { if (lineControl.dgItem.SelectedIndex == -1) { MessageBox.Show("Please Select Line", "Info", MessageBoxButton.OK, MessageBoxImage.Information); return; } stationInfo stationInfo = new stationInfo(); stationInfo.LineIndex = lineControl.dgItem.SelectedIndex; stationInfoPage = new StationInfo(stationInfo); NavigationService.Navigate(stationInfoPage); stationInfoPage.Return += new ReturnEventHandler <stationInfo>(stationInfoPage_Return); }