Exemple #1
0
        private void RequestReject_Click(object sender, RoutedEventArgs e)
        {
            var    rw = new RejectionWindow();
            string rejectionReason;

            MessageBoxResult messageBoxResult = rw.ShowDialog(out rejectionReason);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                IList <Request> request = _requestBusinessComponent.GetByStatus(RequestStatus.Created);
                foreach (var req in request)
                {
                    if (req.RequestId == Convert.ToInt32(RequestRequestId.Text))
                    {
                        Request request2 = new Request()
                        {
                            RequestId = req.RequestId, ClientId = req.ClientId, OperatorId = _operatorId, Status = RequestStatus.Denied, Note = rejectionReason
                        };
                        _requestBusinessComponent.Update(request2 /*req.ClientId, _operatorId, null, RequestStatus.ConfirmedByOperator*/);
                        _requestBusinessComponent = _ninjectKernel.Get <IRequestBusinessComponent>(); // if not re-created will fail on 2nd update

                        this.TabRequestClear();                                                       // added by ilya
                        RequestReject.IsEnabled      = false;
                        RequestSendRequest.IsEnabled = false;
                    }
                }
            }
        }
        private void RequestReject_Click(object sender, RoutedEventArgs e)
        {
            var rw = new RejectionWindow();
            string rejectionReason;

            MessageBoxResult messageBoxResult = rw.ShowDialog(out rejectionReason);
            if (messageBoxResult == MessageBoxResult.Yes)
            {
                IList<Request> request = _requestBusinessComponent.GetByStatus(RequestStatus.Created);
                foreach (var req in request)
                {
                    if (req.RequestId == Convert.ToInt32(RequestRequestId.Text))
                    {
                        Request request2 = new Request() {RequestId = req.RequestId, ClientId = req.ClientId, OperatorId = _operatorId, Status = RequestStatus.Denied, Note = rejectionReason };
                        _requestBusinessComponent.Update(request2/*req.ClientId, _operatorId, null, RequestStatus.ConfirmedByOperator*/);
                        _requestBusinessComponent = _ninjectKernel.Get<IRequestBusinessComponent>(); // if not re-created will fail on 2nd update

                        this.TabRequestClear(); // added by ilya
                        RequestReject.IsEnabled = false;
                        RequestSendRequest.IsEnabled = false;
                    }
                }
            }
        }