Esempio n. 1
0
        /// <summary>
        /// Добавить блок задачи на обработку входящих документов из сервиса обмена.
        /// </summary>
        /// <param name="stateView">Схема представления.</param>
        /// <returns>Новый блок.</returns>
        public Sungero.Core.StateBlock AddTaskBlock(Sungero.Core.StateView stateView)
        {
            // Создать блок задачи.
            var taskBlock = stateView.AddBlock();

            // Добавить ссылку на задачу и иконку.
            taskBlock.Entity = _obj;
            taskBlock.AssignIcon(StateBlockIconType.OfEntity, StateBlockIconSize.Large);

            // Определить схлопнутость.
            taskBlock.IsExpanded = _obj.Status == Workflow.Task.Status.InProcess;
            taskBlock.AddLabel(ExchangeDocumentProcessingTasks.Resources.StateViewTaskBlockHeader, Sungero.Docflow.PublicFunctions.Module.CreateHeaderStyle());
            taskBlock.AddLineBreak();

            // Добавить отправителя.
            var sender = _obj.Counterparty;

            taskBlock.AddLabel(ExchangeDocumentProcessingTasks.Resources.StateViewSender, Sungero.Docflow.PublicFunctions.Module.CreateNoteStyle());
            taskBlock.AddHyperlink(sender.Name, Hyperlinks.Get(sender));
            taskBlock.AddLineBreak();

            // Добавить получателя.
            var receiver = _obj.Box;

            taskBlock.AddLabel(ExchangeDocumentProcessingTasks.Resources.StateViewRecipient, Sungero.Docflow.PublicFunctions.Module.CreateNoteStyle());
            taskBlock.AddHyperlink(receiver.Name, Hyperlinks.Get(receiver));

            return(taskBlock);
        }
Esempio n. 2
0
        /// <summary>
        /// Добавить блок задачи на верификацию.
        /// </summary>
        /// <param name="stateView">Схема представления.</param>
        /// <returns>Новый блок.</returns>
        public Sungero.Core.StateBlock AddTaskBlock(Sungero.Core.StateView stateView)
        {
            // Создать блок задачи.
            var taskBlock = stateView.AddBlock();

            // Добавить ссылку на задачу и иконку.
            taskBlock.Entity = _obj;
            taskBlock.AssignIcon(StateBlockIconType.OfEntity, StateBlockIconSize.Large);

            // Определить схлопнутость.
            taskBlock.IsExpanded = _obj.Status == Workflow.Task.Status.InProcess;
            taskBlock.AddLabel(Resources.VerificationTaskThreadSubject, Sungero.Docflow.PublicFunctions.Module.CreateHeaderStyle());

            return(taskBlock);
        }
Esempio n. 3
0
        /// <summary>
        /// Добавить блок задачи согласования.
        /// </summary>
        /// <param name="stateView">Схема представления.</param>
        /// <returns>Новый блок.</returns>
        public Sungero.Core.StateBlock AddTaskBlock(Sungero.Core.StateView stateView)
        {
            var taskBlock = stateView.AddBlock();

            var isDraft     = _obj.Status == Workflow.Task.Status.Draft;
            var headerStyle = Docflow.PublicFunctions.Module.CreateHeaderStyle(isDraft);
            var labelStyle  = Docflow.PublicFunctions.Module.CreateStyle(false, isDraft, false);
            var noteStyle   = Functions.Module.CreateNoteStyle(isDraft);

            taskBlock.Entity = _obj;
            taskBlock.AssignIcon(OfficialDocuments.Info.Actions.SendForFreeApproval, StateBlockIconSize.Large);
            taskBlock.IsExpanded = _obj.Status == Workflow.Task.Status.InProcess;
            taskBlock.AddLabel(FreeApprovalTasks.Resources.StateViewFreeApproval, headerStyle);
            taskBlock.AddLineBreak();
            var deadline = _obj.MaxDeadline.HasValue ?
                           Functions.Module.ToShortDateShortTime(_obj.MaxDeadline.Value.ToUserTime()) :
                           OfficialDocuments.Resources.StateViewWithoutTerm;

            taskBlock.AddLabel(string.Format("{0}: {1}", OfficialDocuments.Resources.StateViewDeadline, deadline), noteStyle);

            this.AddStatusInfoToRight(taskBlock, labelStyle);

            return(taskBlock);
        }
Esempio n. 4
0
        /// <summary>
        /// Добавить блок задачи на ознакомление.
        /// </summary>
        /// <param name="stateView">Схема представления.</param>
        /// <returns>Новый блок.</returns>
        public Sungero.Core.StateBlock AddTaskBlock(Sungero.Core.StateView stateView)
        {
            // Стили.
            var isDraft     = _obj.Status == Workflow.Task.Status.Draft;
            var headerStyle = Docflow.PublicFunctions.Module.CreateHeaderStyle(isDraft);
            var labelStyle  = Docflow.PublicFunctions.Module.CreateStyle(false, isDraft, false);
            var noteStyle   = Docflow.PublicFunctions.Module.CreateNoteStyle(isDraft);

            // Блок задачи.
            var taskBlock = stateView.AddBlock();

            taskBlock.Entity     = _obj;
            taskBlock.IsExpanded = _obj.Status == Workflow.Task.Status.InProcess;

            // Иконка.
            taskBlock.AssignIcon(AcquaintanceTasks.Resources.AcquaintanceTaskIco, StateBlockIconSize.Large);

            // Заголовок.
            var header = AcquaintanceTasks.Resources.StateViewDocumentSelfSignAcquaintance;

            if (_obj.IsElectronicAcquaintance == true)
            {
                header = AcquaintanceTasks.Resources.StateViewDocumentElectonicAcquaintance;
            }
            taskBlock.AddLabel(header, headerStyle);
            taskBlock.AddLineBreak();

            // Срок.
            var deadline = _obj.Deadline.HasValue ?
                           Docflow.PublicFunctions.Module.ToShortDateShortTime(_obj.Deadline.Value.ToUserTime()) :
                           Docflow.OfficialDocuments.Resources.StateViewWithoutTerm;

            taskBlock.AddLabel(string.Format("{0}: {1}", Docflow.OfficialDocuments.Resources.StateViewDeadline, deadline), noteStyle);

            // Статус.
            var status = string.Empty;

            if (_obj.Status == Workflow.Task.Status.InProcess)
            {
                status = Docflow.ApprovalTasks.Resources.StateViewInProcess;
                var onReview = AcquaintanceFinishAssignments.GetAll()
                               .Where(a => Equals(a.Task, _obj))
                               .Where(a => a.Created >= _obj.Started)
                               .Any();
                if (onReview)
                {
                    status = AcquaintanceTasks.Resources.StateViewFinish;
                }
            }
            else if (_obj.Status == Workflow.Task.Status.Completed)
            {
                status = Docflow.ApprovalTasks.Resources.StateViewCompleted;
            }
            else if (_obj.Status == Workflow.Task.Status.Aborted)
            {
                status = Docflow.ApprovalTasks.Resources.StateViewAborted;
            }
            else if (_obj.Status == Workflow.Task.Status.Suspended)
            {
                status = Docflow.ApprovalTasks.Resources.StateViewSuspended;
            }
            else if (_obj.Status == Workflow.Task.Status.Draft)
            {
                status = Docflow.ApprovalTasks.Resources.StateViewDraft;
            }

            Docflow.PublicFunctions.Module.AddInfoToRightContent(taskBlock, status, labelStyle);

            return(taskBlock);
        }