コード例 #1
0
        public virtual void DocumentKindValueInput(Sungero.Docflow.Client.OfficialDocumentDocumentKindValueInputEventArgs e)
        {
            if (e.NewValue != e.OldValue && _obj.RegistrationState == RegistrationState.Registered)
            {
                e.AddWarning(Docflow.Resources.DocumentKindWasChanged);
            }

            // Проверка доступности нумерации.
            if (e.NewValue != null &&
                e.NewValue.AutoNumbering == true &&
                !Functions.OfficialDocument.IsObsolete(_obj, _obj.LifeCycleState))
            {
                var setting = Docflow.PublicFunctions.RegistrationSetting.GetSettingForKind(_obj, Docflow.RegistrationSetting.SettingType.Numeration, e.NewValue);
                if (setting == null)
                {
                    e.AddWarning(_obj.Info.Properties.DocumentKind, Sungero.Docflow.Resources.NumberingSettingsRequiredForSave, _obj.Info.Properties.LifeCycleState);
                }
                else
                {
                    e.AddInformation(_obj.Info.Properties.DocumentKind, Sungero.Docflow.Resources.DocumentNumberAutomaticallyGeneratedOnSave, _obj.Info.Properties.LifeCycleState);
                }
            }

            if (_obj.AccessRights.CanUpdate() && !Functions.Module.IsLockedByOther(_obj))
            {
                var hasReservationSetting = PublicFunctions.RegistrationSetting.GetAvailableSettingsByParams(Docflow.RegistrationSetting.SettingType.Reservation, _obj.BusinessUnit, e.NewValue, _obj.Department).Any();
                e.Params.AddOrUpdate(Sungero.Docflow.Constants.OfficialDocument.HasReservationSetting, hasReservationSetting);
            }
        }
コード例 #2
0
 public override void DocumentKindValueInput(Sungero.Docflow.Client.OfficialDocumentDocumentKindValueInputEventArgs e)
 {
     base.DocumentKindValueInput(e);
     if (Functions.IncomingLetter.HaveDuplicates(_obj, e.NewValue, _obj.BusinessUnit, _obj.InNumber, _obj.Dated, _obj.Correspondent))
     {
         e.AddWarning(IncomingLetters.Resources.DuplicateDetected,
                      _obj.Info.Properties.DocumentKind,
                      _obj.Info.Properties.BusinessUnit,
                      _obj.Info.Properties.InNumber,
                      _obj.Info.Properties.Dated,
                      _obj.Info.Properties.Correspondent);
     }
 }
コード例 #3
0
 public override void DocumentKindValueInput(Sungero.Docflow.Client.OfficialDocumentDocumentKindValueInputEventArgs e)
 {
     base.DocumentKindValueInput(e);
     if (Functions.IncomingInvoice.HaveDuplicates(_obj, e.NewValue, _obj.Number, _obj.Date, _obj.TotalAmount, _obj.Currency, _obj.Counterparty))
     {
         e.AddWarning(IncomingInvoices.Resources.DuplicateDetected,
                      _obj.Info.Properties.DocumentKind,
                      _obj.Info.Properties.Number,
                      _obj.Info.Properties.Date,
                      _obj.Info.Properties.TotalAmount,
                      _obj.Info.Properties.Currency,
                      _obj.Info.Properties.Counterparty);
     }
 }