public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            // Заполнить формат номера по умолчанию началом строки и порядковым номером.
            if (!_obj.NumberFormatItems.Any())
            {
                var beginningOfLine = _obj.NumberFormatItems.AddNew();
                beginningOfLine.Number  = 0;
                beginningOfLine.Element = DocumentRegisterNumberFormatItems.Element.BegginingOfLine;

                var number = _obj.NumberFormatItems.AddNew();
                number.Number  = 1;
                number.Element = DocumentRegisterNumberFormatItems.Element.Number;
            }

            if (!_obj.State.IsCopied)
            {
                _obj.RegisterType     = RegisterType.Registration;
                _obj.NumberingPeriod  = NumberingPeriod.Year;
                _obj.NumberingSection = NumberingSection.NoSection;
            }

            var userRegistrationGroups = Functions.DocumentRegister.GetUsersRegistrationGroups(_obj);

            if (userRegistrationGroups.Count() == 1)
            {
                _obj.RegistrationGroup = userRegistrationGroups.FirstOrDefault();
            }
        }
Beispiel #2
0
 public override void Created(Sungero.Domain.CreatedEventArgs e)
 {
     if (!_obj.State.IsCopied)
     {
         _obj.IsDefault = false;
     }
 }
Beispiel #3
0
 public override void Created(Sungero.Domain.CreatedEventArgs e)
 {
     // Получить ресурсы в культуре тенанта.
     using (TenantInfo.Culture.SwitchTo())
         _obj.ActiveText = CheckReturnTasks.Resources.TaskActiveText;
     _obj.NeedsReview = false;
 }
Beispiel #4
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            if (_obj.ResponsibleEmployee == null)
            {
                _obj.ResponsibleEmployee = Company.Employees.As(_obj.Author);
            }

            if (_obj.IsAdjustment == null)
            {
                _obj.IsAdjustment = false;
            }

            if (_obj.IsRevision == null)
            {
                _obj.IsRevision = false;
            }

            if (_obj.State.IsInserted && _obj.Corrected != null)
            {
                _obj.Relations.AddFrom(Constants.Module.CorrectionRelationName, _obj.Corrected);
            }

            if (_obj.State.IsInserted && _obj.LeadingDocument != null)
            {
                _obj.Relations.AddFrom(Contracts.PublicConstants.Module.AccountingDocumentsRelationName, _obj.LeadingDocument);
            }
        }
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            if (!_obj.State.IsCopied)
            {
                _obj.Limit = Limit.NoLimit;

                if (CallContext.CalledFrom(PowerOfAttorneys.Info))
                {
                    _obj.Reason = Sungero.Docflow.SignatureSetting.Reason.PowerOfAttorney;
                    var powerOfAttorney = PowerOfAttorneys.Get(CallContext.GetCallerEntityId(PowerOfAttorneys.Info));
                    if (powerOfAttorney.LifeCycleState != Docflow.OfficialDocument.LifeCycleState.Obsolete && powerOfAttorney.ValidTill >= Calendar.UserToday)
                    {
                        _obj.Document = powerOfAttorney;
                    }
                }
                else
                {
                    _obj.Reason = Sungero.Docflow.SignatureSetting.Reason.Duties;
                }

                _obj.DocumentFlow = SignatureSetting.DocumentFlow.All;
                _obj.Priority     = 0;
            }

            _obj.IsSystem = false;
        }
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            _obj.LowerConfidenceLimit = 40;
            _obj.UpperConfidenceLimit = 80;

            _obj.Name = SmartProcessingSettings.Resources.SmartProcessingSettings;
            _obj.LimitsDescription = SmartProcessingSettings.Resources.LimitsDecriptionValue;
        }
Beispiel #7
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            var taskDeadlineInDays = 1;
            var assignee           = _obj.Assignee ?? Users.Current;

            _obj.MaxDeadline = Calendar.Now.AddWorkingDays(assignee, taskDeadlineInDays);
            _obj.NeedsReview = false;
        }
Beispiel #8
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            if (_obj.State.IsInserted && _obj.LeadingDocument != null)
            {
                _obj.Relations.AddFrom(Constants.Module.SupAgreementRelationName, _obj.LeadingDocument);
            }
        }
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            var activeBusinessUnits = Company.BusinessUnits.GetAll().Where(oc => oc.Status == CoreEntities.DatabookEntry.Status.Active);

            if (activeBusinessUnits.Count() == 1)
            {
                _obj.BusinessUnit = activeBusinessUnits.FirstOrDefault();
            }
        }
Beispiel #10
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            _obj.ActionItemType = ActionItemType.Main;

            if (!_obj.State.IsCopied)
            {
                _obj.NeedsReview          = false;
                _obj.IsUnderControl       = false;
                _obj.IsCompoundActionItem = false;
                _obj.Subject = Docflow.Resources.AutoformatTaskSubject;

                var employee = Employees.As(_obj.Author);
                if (employee != null)
                {
                    var settings = Docflow.PublicFunctions.PersonalSetting.GetPersonalSettings(employee);
                    if (settings != null)
                    {
                        _obj.IsUnderControl = settings.FollowUpActionItem;
                        var resolutionAuthor = Docflow.PublicFunctions.PersonalSetting.GetResolutionAuthor(settings);
                        _obj.AssignedBy = Docflow.PublicFunctions.Module.Remote.IsUsersCanBeResolutionAuthor(_obj.DocumentsGroup.OfficialDocuments.SingleOrDefault(), resolutionAuthor) ?
                                          resolutionAuthor :
                                          null;
                    }
                }
            }
            else
            {
                if (_obj.Author != null && _obj.AssignedBy != null && !_obj.Author.Equals(_obj.AssignedBy))
                {
                    _obj.Author = Users.As(_obj.AssignedBy);
                }

                // Сброс отметок о создании заданий соисполнителям.
                if (_obj.CoAssignees.Count > 0)
                {
                    foreach (var assignee in _obj.CoAssignees)
                    {
                        assignee.AssignmentCreated = false;
                    }
                }

                // Сброс отметок о создании заданий по частям составного поручения.
                if (_obj.IsCompoundActionItem == true)
                {
                    foreach (var part in _obj.ActionItemParts)
                    {
                        part.AssignmentCreated = false;
                    }
                }
            }

            var subjectTemplate = _obj.IsCompoundActionItem == true ?
                                  ActionItemExecutionTasks.Resources.ComponentActionItemExecutionSubject :
                                  ActionItemExecutionTasks.Resources.TaskSubject;

            _obj.Subject = Functions.ActionItemExecutionTask.GetActionItemExecutionSubject(_obj, subjectTemplate);
        }
Beispiel #11
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            if (_obj.IsDeleted == null)
            {
                _obj.IsDeleted = false;
            }
        }
Beispiel #12
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            var currentEmployee = Sungero.Company.Employees.Current;

            if (currentEmployee != null && currentEmployee.IsSystem != true && !_obj.State.IsCopied)
            {
                _obj.Secretary = currentEmployee;
            }
        }
Beispiel #13
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            if (!_obj.State.IsCopied)
            {
                _obj.Meeting = Functions.Meeting.GetContextMeeting();
            }
        }
Beispiel #14
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            // Заполнить свойство "переходящее" по умолчанию.
            _obj.LongTerm = false;

            if (_obj.BusinessUnit == null)
            {
                _obj.BusinessUnit = Functions.Module.GetDefaultBusinessUnit(Company.Employees.Current);
            }
        }
 public override void Created(Sungero.Domain.CreatedEventArgs e)
 {
   base.Created(e);
   
   // Очистить поля Подразделение и НОР, заполненные в предке.
   if (!_obj.State.IsCopied)
   {
     _obj.Department = null;
     _obj.BusinessUnit = null;
   }
 }
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            _obj.LifeCycleState = LifeCycleState.Draft;

            if (!_obj.State.IsCopied)
            {
                _obj.DeliveryMethod = MailDeliveryMethods.GetAll(m => m.Sid == Constants.MailDeliveryMethod.Exchange).FirstOrDefault();
            }
        }
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            _obj.IsStandard = false;

            if (_obj.ResponsibleEmployee == null)
            {
                _obj.ResponsibleEmployee = Company.Employees.As(_obj.Author);
            }
        }
Beispiel #18
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            if (_obj.State.IsInserted && _obj.Contract != null)
            {
                _obj.Relations.AddFrom(Constants.Module.AccountingDocumentsRelationName, _obj.Contract);
            }

            _obj.ResponsibleEmployee = null;
        }
Beispiel #19
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            if (_obj.LifeCycleState == null || _obj.LifeCycleState == LifeCycleState.Draft)
            {
                _obj.LifeCycleState = LifeCycleState.Active;
            }

            _obj.ResponsibleEmployee = null;
        }
 public override void Created(Sungero.Domain.CreatedEventArgs e)
 {
     if (_obj.DocumentFlow == null)
     {
         _obj.DocumentFlow = Docflow.RegistrationSetting.DocumentFlow.Incoming;
     }
     if (_obj.SettingType == null)
     {
         _obj.SettingType = SettingType.Registration;
     }
 }
Beispiel #21
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            _obj.NeedsReview = false;
            _obj.Iteration   = 0;
            if (!_obj.State.IsCopied)
            {
                _obj.Subject = Docflow.Resources.AutoformatTaskSubject;

                using (TenantInfo.Culture.SwitchTo())
                    _obj.ActiveText = ApprovalTasks.Resources.ApprovalText;
            }
        }
Beispiel #22
0
 public override void Created(Sungero.Domain.CreatedEventArgs e)
 {
     base.Created(e);
     if (!_obj.State.IsCopied)
     {
         _obj.RepeatType = Sungero.Docflow.RetentionPolicy.RepeatType.WhenJobStart;
     }
     else
     {
         _obj.NextRetention = Functions.RetentionPolicy.GetNextRetentionDate(_obj.RepeatType, _obj.IntervalType, _obj.Interval, Calendar.Now);
     }
 }
Beispiel #23
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            // Заполнить "Подписал".
            var employee = Company.Employees.Current;

            if (_obj.OurSignatory == null)
            {
                _obj.OurSignatory = employee;
            }
        }
Beispiel #24
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            _obj.IsElectronicAcquaintance = true;

            if (!_obj.State.IsCopied)
            {
                _obj.Subject = Docflow.Resources.AutoformatTaskSubject;

                // Получить ресурсы в культуре тенанта.
                using (TenantInfo.Culture.SwitchTo())
                    _obj.ActiveText = AcquaintanceTasks.Resources.TaskAutoText;
            }
        }
 public override void Created(Sungero.Domain.CreatedEventArgs e)
 {
     base.Created(e);
     if (!_obj.State.IsCopied)
     {
         _obj.IsAutomaticRenewal = false;
         var availableDocuments = Docflow.PublicFunctions.DocumentGroupBase.GetAvailableDocumentGroup(_obj.DocumentKind).Where(g => ContractCategories.Is(g));
         if (availableDocuments.Count() == 1)
         {
             _obj.DocumentGroup = availableDocuments.FirstOrDefault();
         }
     }
 }
Beispiel #26
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            // Если персона создается из выпадающего списка (см. 56654),
            // то введенные в контрол ФИО будут доступны в e.Filter.
            if (string.IsNullOrWhiteSpace(_obj.FirstName) &&
                string.IsNullOrWhiteSpace(_obj.MiddleName) &&
                string.IsNullOrWhiteSpace(_obj.LastName) &&
                !string.IsNullOrWhiteSpace(e.Filter))
            {
                _obj.LastName = e.Filter;
            }
        }
 public override void Created(Sungero.Domain.CreatedEventArgs e)
 {
     _obj.IsAutoCalcSupervisor       = true;
     _obj.IsAutoCalcResolutionAuthor = true;
     _obj.FollowUpActionItem         = false;
     _obj.Period                                     = null;
     _obj.ShowRegPane                                = true;
     _obj.MyContractsNotification                    = true;
     _obj.MySubordinatesContractsNotification        = true;
     _obj.PrintSender                                = true;
     _obj.ShowNotApproveSign                         = false;
     _obj.MyPowersOfAttorneyNotification             = true;
     _obj.MySubordinatesPowersOfAttorneyNotification = true;
 }
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);

            if (_obj.State.IsCopied)
            {
                foreach (var conditionsList in _obj.Conditions)
                {
                    var newCondition = Conditions.Copy(Conditions.As(conditionsList.Condition));
                    newCondition.Save();
                    conditionsList.Condition = newCondition;
                }
            }
        }
Beispiel #29
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            if (_obj.GrantRightsOnLeadingDocument == null)
            {
                _obj.GrantRightsOnLeadingDocument = false;
            }

            if (_obj.GrantRightsOnExistingDocuments == null)
            {
                _obj.GrantRightsOnExistingDocuments = true;
            }

            _obj.Modified = Calendar.Now;
        }
Beispiel #30
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            _obj.NeedsReview = false;

            if (!_obj.State.IsCopied)
            {
                _obj.ReceiveOnCompletion = ReceiveOnCompletion.Assignment;
                _obj.ReceiveNotice       = true;
                _obj.Subject             = Docflow.Resources.AutoformatTaskSubject;

                // Получить ресурсы в культуре тенанта.
                using (TenantInfo.Culture.SwitchTo())
                    _obj.ActiveText = FreeApprovalTasks.Resources.ApprovalText;
            }
        }