コード例 #1
0
 public override void Refresh(Sungero.Presentation.FormRefreshEventArgs e)
 {
     // Проверить, что у пользователя есть сертификат сервиса обмена, если задачу еще не переадресовывали.
     if (e.IsValid && ExchangeDocumentProcessingTasks.As(_obj.Task).Addressee == null &&
         !Functions.Module.HasCurrentUserExchangeServiceCertificate(_obj.BusinessUnitBox))
     {
         e.AddWarning(ExchangeDocumentProcessingAssignments.Resources.CertificateNotFound);
     }
     _obj.State.Properties.NewDeadline.IsEnabled = _obj.Addressee != null;
 }
コード例 #2
0
 public bool AreAllDocumentsSendToWork()
 {
     foreach (Sungero.Docflow.IOfficialDocument document in _obj.NeedSigning.All)
     {
         var docTypeGuid = Guid.Parse(document.DocumentKind.DocumentType.DocumentTypeGuid);
         if (!Sungero.Workflow.Tasks
             .GetAll(t => !ExchangeDocumentProcessingTasks.Is(t))
             .Any(t => t.AttachmentDetails.Any(att => att.AttachmentId == document.Id &&
                                               att.EntityTypeGuid == docTypeGuid)))
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #3
0
        public virtual void ReAddress(Sungero.Workflow.Client.ExecuteResultActionArgs e)
        {
            // Не давать переадресовать, если адресат или срок не заполнены.
            if (_obj.Addressee == null || _obj.NewDeadline == null)
            {
                e.AddError(ExchangeDocumentProcessingAssignments.Resources.CantReAddressWithoutAddresseeAndDeadline);
                return;
            }

            // Не давать переадресовывать на срок меньше, чем сейчас.
            if (_obj.NewDeadline.HasValue)
            {
                if (!Docflow.PublicFunctions.Module.CheckDeadline(_obj.Addressee, _obj.NewDeadline, Calendar.Now))
                {
                    e.AddError(ExchangeDocumentProcessingAssignments.Resources.ImpossibleSpecifyDeadlineLessThenToday);
                    return;
                }
            }

            if (!Sungero.Docflow.PublicFunctions.Module.ShowConfirmationDialog(e.Action.ConfirmationMessage, null, null,
                                                                               Constants.ExchangeDocumentProcessingTask.ExchangeDocumentProcessingAssignmentConfirmDialogID.ReAddress))
            {
                e.Cancel();
                return;
            }

            if (!Functions.ExchangeDocumentProcessingAssignment.SendDeliveryConfirmation(_obj, null))
            {
                e.Cancel();
                return;
            }

            // Прокинуть новый срок и исполнителя в задачу.
            var task = ExchangeDocumentProcessingTasks.As(_obj.Task);

            task.Addressee = _obj.Addressee;
            task.Deadline  = _obj.NewDeadline;
            task.Save();
        }
コード例 #4
0
        public virtual void Complete(Sungero.Workflow.Client.ExecuteResultActionArgs e)
        {
            if (_obj.AllAttachments.Any(d => Sungero.Docflow.ExchangeDocuments.Is(d)))
            {
                e.AddError(ExchangeDocumentProcessingTasks.Resources.NotAllDocumentTypesAreChanged);
                return;
            }

            var areAllDocumentsInWork = Functions.ExchangeDocumentProcessingTask.Remote.AreAllDocumentsSendToWork(ExchangeDocumentProcessingTasks.As(_obj.Task));
            var dialogText            = e.Action.ConfirmationMessage;
            var dialogID = Constants.ExchangeDocumentProcessingTask.ExchangeDocumentProcessingAssignmentConfirmDialogID.Complete;

            if (!areAllDocumentsInWork)
            {
                dialogText = ExchangeDocumentProcessingTasks.Resources.NotAllDocumentsSendedForProcessing;
                dialogID   = Constants.ExchangeDocumentProcessingTask.ExchangeDocumentProcessingAssignmentConfirmDialogID.CompleteWithoutAllDocumentsSendedForProcessing;
            }

            if (!Sungero.Docflow.PublicFunctions.Module.ShowConfirmationDialog(dialogText, null, null, dialogID))
            {
                e.Cancel();
                return;
            }

            if (!Functions.ExchangeDocumentProcessingAssignment.SendDeliveryConfirmation(_obj, null))
            {
                e.Cancel();
                return;
            }
        }
コード例 #5
0
        public virtual bool CanAbort(Sungero.Workflow.Client.CanExecuteResultActionArgs e)
        {
            var isIncoming = ExchangeDocumentProcessingTasks.As(_obj.Task).IsIncoming == true;

            return(_obj.Addressee == null && isIncoming && Docflow.OfficialDocuments.AccessRights.CanSendByExchange());
        }