Пример #1
0
        private void Confirm_Click(object sender, RoutedEventArgs e)
        {
            int newEmployeeID = EmployeeRepository.GetEmployeeID(EmployeeCB.SelectedValue.ToString());
            int oldEmployeeID = EmployeeRepository.GetEmployeeID(DutyLabel.Content.ToString().Substring(16));
            int dutyID        = DutyRepository.GetDuty(DutyLabel.Content.ToString().Substring(0, 10), DutyLabel.Content.ToString().Substring(16)).DutyID;

            DBDutyController.UpdateDuty(newEmployeeID, DutyID);
            DBDutyExchangeController.DeleteDutyExchange(dutyID, oldEmployeeID);
            DutyExchangeRepository.RemoveDutyExchange(dutyID, oldEmployeeID);
            ExchangeDutyWindow.Close();
            this.Close();
        }
Пример #2
0
        private void Confirm_Click(object sender, RoutedEventArgs e)
        {
            int newEmployeeID = EmployeeRepository.GetEmployeeID(EmployeeCB.SelectedValue.ToString());
            int oldEmployeeID = EmployeeRepository.GetEmployeeID(EmployeeRepository.GetEmployeeName(DutyExchangeListView.Duty.EmployeeID));

            try
            {
                DBDutyController.UpdateDuty(newEmployeeID, DutyExchangeListView.Duty.DutyID);
            }
            catch (Exception t)
            {
                MessageBox.Show(t.Message);
            }
            DBDutyExchangeController.DeleteDutyExchange(DutyExchangeListView.Duty.DutyID);
            DutyExchangeRepository.RemoveDutyExchange(DutyExchangeListView.Duty.DutyID);
            this.Close();
        }