Пример #1
0
 private void RejectSelectedInvoice(RejectInput rejectInputDetails, string postData)
 {
     try
     {
         if (Source == Model.Base.Source.INVOICE_MULTI_REJECT_CONFIRMATION)
         {
             ServiceInvoker.InvokeServiceUsingPost("/api/t360/Invoice/RejectMultipleInvoice", postData, false, delegate(object a, ServiceEventArgs serviceEventArgs)
             {
                 ServiceResponse result = serviceEventArgs.Result;
                 if (result.Status)
                 {
                     Deployment.Current.Dispatcher.BeginInvoke(() =>
                     {
                         RedirectToInvoiceList();
                     });
                 }
                 else
                 {
                     handleRejectError(result.ErrorDetails, Constants.RejectInvoiceError);
                 }
             });
         }
         else if (Source == Model.Base.Source.INVOICE_SINGLE_REJECT)
         {
             ServiceInvoker.InvokeServiceUsingPost("/api/t360/Invoice/RejectInvoice", postData, false, delegate(object a, ServiceEventArgs serviceEventArgs)
             {
                 ServiceResponse result = serviceEventArgs.Result;
                 if (result.Status)
                 {
                     Deployment.Current.Dispatcher.BeginInvoke(() =>
                     {
                         NavigationService.RemoveBackEntry();
                         NavigationService.GoBack();
                     });
                 }
                 else
                 {
                     List <Error> resultError = result.ErrorDetails;
                     ShowError(new AppException(resultError), Constants.RejectInvoiceError);
                     if (resultError[0] != null && T360ErrorCodes.NotInReviewerQueue == resultError[0].Code)
                     {
                         Deployment.Current.Dispatcher.BeginInvoke(() =>
                         {
                             RedirectToInvoiceList();
                         });
                     }
                 }
             });
         }
     }
     catch (Exception ex)
     {
         ShowError((AppException)ex);
     }
 }
Пример #2
0
        // 批准驳回
        public async Task <int> SetApproveReject(RejectInput input)
        {
            long jdyid = (long)AbpSession.UserId;
            var  user  = await _userManager.GetUserByIdAsync(jdyid);

            string strSQL = @"update SJCL_CHYQ set PZYJ = @PZYJ,PZRID=@PZRID,PZR=@PZR,JDZT = 111 where ID=@ID";
            var    param  = new
            {
                ID    = input.ID,
                PZRID = jdyid,
                PZR   = user.Surname,
                PZYJ  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ";" + input.Info
            };

            return(_zshDapperRepository.Execute(strSQL, param));
        }
Пример #3
0
        private void RejectSelectedItem(RejectInput rejectInputDetails)
        {
            BaseValidator    validator = new BaseValidator();
            MessageBoxResult msgResult;
            bool             isValid = Source == Model.Base.Source.INVOICE_MULTI_REJECT_CONFIRMATION
                ? validator.RejectInvoice((RejectInputMultipleInvoice)rejectInputDetails)
                : validator.RejectInvoice((RejectInputDetails)rejectInputDetails);

            if (!isValid)
            {
                if (Source == Model.Base.Source.LINE_ITEM_SINGLE_REJECT || Source == Model.Base.Source.LINE_ITEM_MULTI_REJECT_CONFIRMATION)
                {
                    ShowError(validator.ClientException, Constants.RejectLineItemError);
                }
                else
                {
                    ShowError(validator.ClientException, Constants.RejectInvoiceError);
                }
                return;
            }
            if (Source == Model.Base.Source.LINE_ITEM_SINGLE_REJECT || Source == Model.Base.Source.LINE_ITEM_MULTI_REJECT_CONFIRMATION)
            {
                string message = LineItemRejectDetails.SelectedLineItemIds.Count == 1
                                   ? "Are you sure you want to reject this line item?"
                                   : "Are you sure you want to reject these line items?";

                msgResult = MessageBox.Show(message, "Rejection Confirmation", MessageBoxButton.OKCancel);
            }
            else if (Source == Model.Base.Source.INVOICE_MULTI_REJECT_CONFIRMATION)
            {
                string message = InvoiceInputDetails.SelectedInvoiceIds.Count == 1
                                    ? "Are you sure you want to reject this invoice?"
                                    : "Are you sure you want to reject these invoices?";

                msgResult = MessageBox.Show(message, "Rejection Confirmation", MessageBoxButton.OKCancel);
            }
            else
            {
                msgResult = MessageBox.Show("Are you sure you want to reject this invoice?", "Rejection Confirmation", MessageBoxButton.OKCancel);
            }

            if (msgResult == MessageBoxResult.Cancel)
            {
                return;
            }

            string postData = JsonConvert.SerializeObject(rejectInputDetails);

            if (Source == Source.LINE_ITEM_MULTI_REJECT_CONFIRMATION || Source == Source.LINE_ITEM_SINGLE_REJECT)
            {
                RejectSelectedLineItem(rejectInputDetails, postData);
            }
            try
            {
                if (Source == Source.INVOICE_MULTI_REJECT_CONFIRMATION || Source == Source.INVOICE_SINGLE_REJECT)
                {
                    RejectSelectedInvoice(rejectInputDetails, postData);
                }
            }
            catch (Exception ex)
            {
                ShowError((AppException)ex);
            }
        }