예제 #1
0
        public virtual void RequireReport(Sungero.Domain.Client.ExecuteActionArgs e)
        {
            var task = Functions.StatusReportRequestTask.Remote.CreateStatusReportRequest(_obj);

            if (task == null)
            {
                e.AddWarning(ActionItemExecutionTasks.Resources.NoActiveChildActionItems);
            }
            else
            {
                task.Show();
            }
        }
        public virtual void CheckConnection(Sungero.Domain.Client.ExecuteActionArgs e)
        {
            // Проверка адреса сервиса Ario.
            var arioUrlValidationMessage = Functions.SmartProcessingSetting.ValidateArioUrl(_obj);

            if (arioUrlValidationMessage != null)
            {
                if (arioUrlValidationMessage.Type == MessageTypes.Error)
                {
                    e.AddError(arioUrlValidationMessage.Text);
                }

                if (arioUrlValidationMessage.Type == MessageTypes.SoftError)
                {
                    e.AddWarning(arioUrlValidationMessage.Text);
                }

                return;
            }

            // Проверка логина и пароля.
            var loginResult = Functions.SmartProcessingSetting.Remote.Login(_obj, _obj.Password, true);

            if (!string.IsNullOrEmpty(loginResult.Error))
            {
                e.AddError(loginResult.Error);
                return;
            }

            Dialogs.NotifyMessage(SmartProcessingSettings.Resources.ArioConnectionEstablished);

            // Проверка классификаторов.
            var classifiersValidationMessage = Functions.SmartProcessingSetting.ValidateClassifiers(_obj);

            if (classifiersValidationMessage != null)
            {
                e.AddWarning(classifiersValidationMessage.Text);
            }
        }
예제 #3
0
 public virtual void CreateSupAgreement(Sungero.Domain.Client.ExecuteActionArgs e)
 {
     if (Docflow.PublicFunctions.Module.Remote.IsModuleAvailableForCurrentUserByLicense(Sungero.Contracts.Constants.Module.ContractsUIGuid))
     {
         var supAgreement = Functions.Module.Remote.CreateSupAgreemnt();
         supAgreement.LeadingDocument = _obj;
         supAgreement.Show();
     }
     else
     {
         e.AddWarning(Sungero.Contracts.Contracts.Resources.NoLicenceCreateSupAgreement);
     }
 }
예제 #4
0
        public virtual void Login(Sungero.Domain.Client.ExecuteActionArgs e)
        {
            if (!e.Validate())
            {
                return;
            }

            var errors = Functions.BusinessUnitBox.Remote.CheckProperties(_obj);

            foreach (var error in errors)
            {
                e.AddError(error);
            }

            if (errors.Any())
            {
                return;
            }

            var dialog   = Dialogs.CreateInputDialog(BusinessUnitBoxes.Resources.LoginActionTitle);
            var password = dialog.AddPasswordString(_obj.Info.Properties.Password.LocalizedName, true);

            password.MaxLength(Constants.BusinessUnitBox.PasswordMaxLength);
            dialog.Buttons.AddOkCancel();
            dialog.Buttons.Default = DialogButtons.Ok;

            dialog.SetOnButtonClick(
                x =>
            {
                if (x.Button == DialogButtons.Ok && x.IsValid)
                {
                    var loginResult = Functions.BusinessUnitBox.Remote.Login(_obj, password.Value);
                    if (loginResult != string.Empty)
                    {
                        x.AddError(loginResult);
                    }
                    else
                    {
                        Dialogs.NotifyMessage(BusinessUnitBoxes.Resources.ConnectionEstablished);
                        Functions.BusinessUnitBox.Remote.UpdateExchangeServiceCertificates(_obj);
                    }

                    if (!Functions.BusinessUnitBox.Remote.CheckAllResponsibleCertificates(_obj, _obj.Responsible))
                    {
                        e.AddWarning(BusinessUnitBoxes.Resources.CertificateNotFound);
                    }
                }
            });
            dialog.Show();
        }
예제 #5
0
        public virtual void CheckConnection(Sungero.Domain.Client.ExecuteActionArgs e)
        {
            if (!e.Validate())
            {
                return;
            }

            if (string.IsNullOrEmpty(_obj.Password))
            {
                Dialogs.NotifyMessage(BusinessUnitBoxes.Resources.EnterPasswordToCheckConnection);
                return;
            }

            var result = Functions.BusinessUnitBox.Remote.CheckConnection(_obj);

            if (string.IsNullOrWhiteSpace(result))
            {
                Dialogs.NotifyMessage(BusinessUnitBoxes.Resources.ConnectionEstablished);

                Functions.BusinessUnitBox.Remote.UpdateExchangeServiceCertificates(_obj);
            }
            else
            {
                Dialogs.NotifyMessage(result);
            }

            if (!Functions.BusinessUnitBox.Remote.CheckAllResponsibleCertificates(_obj, _obj.Responsible))
            {
                e.AddWarning(BusinessUnitBoxes.Resources.CertificateNotFound);
            }

            if (!Functions.BusinessUnitBox.Remote.CheckBusinessUnitTinTRRC(_obj))
            {
                e.AddWarning(BusinessUnitBoxes.Resources.OrganizationFailed);
            }
        }
예제 #6
0
        public virtual void CreateOrShowAgenda(Sungero.Domain.Client.ExecuteActionArgs e)
        {
            var agendas = Functions.Meeting.Remote.GetOrCreateAgenda(_obj);

            if (agendas.Count == 1)
            {
                agendas.Single().Show();
            }
            else if (!agendas.Any() && !Docflow.PublicFunctions.Module.Remote.IsModuleAvailableForCurrentUserByLicense(Sungero.Meetings.Constants.Module.MeetingsUIGuid))
            {
                e.AddWarning(Sungero.Meetings.Meetings.Resources.NoLicenceToCreateAgenda);
            }
            else
            {
                agendas.Show();
            }
        }
예제 #7
0
        public virtual void RequireReport(Sungero.Domain.Client.ExecuteActionArgs e)
        {
            if (!Functions.ActionItemExecutionAssignment.Remote.IsCoAssigneeAssignamentCreated(_obj))
            {
                Dialogs.NotifyMessage(ActionItemExecutionAssignments.Resources.AssignmentsNotCreated);
                return;
            }

            var task = Functions.StatusReportRequestTask.Remote.CreateStatusReportRequest(_obj);

            if (task == null)
            {
                e.AddWarning(ActionItemExecutionTasks.Resources.NoActiveChildActionItems);
            }
            else
            {
                task.Show();
            }
        }
예제 #8
0
        public virtual void CreateVersion(Sungero.Domain.Client.ExecuteActionArgs e)
        {
            if (Functions.ApprovalRuleBase.Remote.GetNextVersion(_obj) != null)
            {
                e.AddWarning(ApprovalRuleBases.Resources.NewVersionNotAllowed, _obj.Info.Actions.ShowAllVersions);
                return;
            }

            var message     = e.Action.ConfirmationMessage;
            var description = (_obj.Status == ApprovalRuleBase.Status.Closed)
        ? ApprovalRuleBases.Resources.Action_CreateVersionConfirmationDescriptionStatusClosed
        : ApprovalRuleBases.Resources.Action_CreateVersionConfirmationDescriptionStatusNotClosed;
            var dialog = Dialogs.CreateTaskDialog(message, string.IsNullOrEmpty(description) ? null : description, MessageType.Question);

            dialog.Buttons.AddYesNo();
            dialog.Buttons.Default = DialogButtons.Yes;
            if (dialog.Show() == DialogButtons.Yes)
            {
                var version = Functions.ApprovalRuleBase.Remote.GetOrCreateNextVersion(_obj);
                e.CloseFormAfterAction = true;
                version.Show();
            }
        }