public async override Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)
        {
            // update of path.vii required ???
            bool bUpdatePathVii = !entity.IsLoaded ||
                                  entity.IsDeleted() ||
                                  entity.Columns["UID_Profile"].IsChanged ||
                                  entity.Columns["Ident_InstTypeAlso"].IsChanged ||
                                  entity.Columns["Ident_OSAlso"].IsChanged;

            if (bUpdatePathVii)
            {
                IEntityForeignKey fkProfile = await entity.GetFkAsync(parameters.Session, "UID_Profile", cancellationToken : cancellationToken).ConfigureAwait(false);

                if (!fkProfile.IsEmpty())
                {
                    IEntity eProfile = await fkProfile.GetParentAsync(EntityLoadType.Default, cancellationToken).ConfigureAwait(false);

                    if (!eProfile.GetValue <bool>("UpdatePathVII"))
                    {
                        await eProfile.PutValueAsync("UpdatePathVII", true, cancellationToken).ConfigureAwait(false);

                        await parameters.UnitOfWork.PutAsync(eProfile, cancellationToken).ConfigureAwait(false);
                    }
                }
            }

            await base.OnSavedAsync(entity, parameters, cancellationToken).ConfigureAwait(false);
        }
Exemplo n.º 2
0
        public async override Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters,
                                                CancellationToken cancellationToken)
        {
            await _FillOsInsttype(parameters.Session, entity, parameters.UnitOfWork, cancellationToken).ConfigureAwait(false);

            await base.OnSavedAsync(entity, parameters, cancellationToken).ConfigureAwait(false);
        }
Exemplo n.º 3
0
        public override async Task <Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)
        {
            LogicParameter lp = new LogicParameter(entity, parameters, cancellationToken);

            await _SyncOSInheritance(lp).ConfigureAwait(false);

            return(await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false));
        }
        public override async Task <Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, System.Threading.CancellationToken cancellationToken)
        {
            var ret = await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false);

            await RemoveBaseTreeHasLicence(entity, parameters.Session, parameters.UnitOfWork, cancellationToken)
            .ConfigureAwait(false);

            return(ret);
        }
Exemplo n.º 5
0
        public override async Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)
        {
            if (entity.Columns["DisableVIClient"].IsDifferent)
            {
                await SetUpdateCNameInPC(parameters.Session, entity, parameters.UnitOfWork, cancellationToken).ConfigureAwait(false);
            }

            await base.OnSavedAsync(entity, parameters, cancellationToken).ConfigureAwait(false);
        }
Exemplo n.º 6
0
        public override async Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)
        {
            LogicParameter lp = new LogicParameter(entity, parameters, cancellationToken);

            if (!entity.IsDeleted())
            {
                await Handle_ApplicationProfiles(lp).ConfigureAwait(false);
            }

            await base.OnSavedAsync(entity, parameters, cancellationToken).ConfigureAwait(false);
        }
Exemplo n.º 7
0
        public override async Task <Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)
        {
            LogicParameter lp = new LogicParameter(entity, parameters, cancellationToken);

            if (!entity.IsDeleted())
            {
                await _HandleTroubleProduct(lp).ConfigureAwait(false);
            }

            return(await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false));
        }
Exemplo n.º 8
0
        public override async Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)
        {
            LogicParameter lp = new LogicParameter(entity, parameters, cancellationToken);

            // autocreate workdesk
            if (entity.IsLoaded)
            {
                // Workdesk / Hardware Ident_OS - Inheritance
                await _SyncOSInheritance(lp).ConfigureAwait(false);
            }

            await base.OnSavedAsync(entity, parameters, cancellationToken).ConfigureAwait(false);
        }
        public override async Task <Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)
        {
            LogicParameter lp = new LogicParameter(entity, parameters, cancellationToken);

            if (!entity.IsLoaded &&
                DbVal.IsEmpty(entity.GetValue <int>("OrderNumber"), ValType.Int))
            {
                await _SetRightOrderNumber(lp).ConfigureAwait(false);;
            }

            if (!entity.IsLoaded)
            {
                await ModProfile.IsUniqueAKProfile(lp).ConfigureAwait(false);
            }

            if (!entity.IsDeleted())
            {
                await _HandleTroubleProduct(lp).ConfigureAwait(false);
            }

            return(await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false));
        }
Exemplo n.º 10
0
        public override async Task <Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters,
                                                        CancellationToken cancellationToken)
        {
            ISession session = parameters.Session;

            if (!entity.IsDeleted())
            {
                await _IsValidSectionNamePrefix(session, entity, cancellationToken).ConfigureAwait(false);

                if (!entity.IsLoaded)
                {
                    if (await session.Source().ExistsAsync("SectionName", session.SqlFormatter()
                                                           .Comparison("Ident_SectionName", entity.GetValue <string>("Ident_SectionName"), ValType.String,
                                                                       CompareOperator.Equal, FormatterOptions.IgnoreCase), ct: cancellationToken).ConfigureAwait(false))
                    {
                        throw new ViException(2116031, ExceptionRelevance.EndUser, entity.GetValue <string>("Ident_SectionName"));
                    }
                }
            }

            return(await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false));
        }
Exemplo n.º 11
0
        public override async Task <bool> OnGenerate(IEntity entity, string eventname, LogicReadWriteParameters parameters, CancellationToken cancellationToken)
        {
            Hashtable param = new Hashtable(StringComparer.OrdinalIgnoreCase);
            long      ulCo  = 0;

            Query qProfileCanUsedAlso = Query.From("ProfileCanUsedAlso")
                                        .Where(c => c.Column("UID_Profile") == entity.GetValue <string>("UID_Profile"))
                                        .SelectAll();

            IEntityCollection colAlso = await parameters.Session.Source().GetCollectionAsync(qProfileCanUsedAlso, EntityCollectionLoadType.Bulk, cancellationToken).ConfigureAwait(false);

            foreach (IEntity colElem in colAlso)
            {
                IEntityWalker w = colElem.CreateWalker(parameters.Session);
                param.Add("ProfileCUA_Ident_InstTypeAlso" + ulCo, w.GetValue <string>("Ident_InstTypeAlso"));
                param.Add("ProfileCUA_Ident_OSAlso" + ulCo, w.GetValue <string>("Ident_OSAlso"));
                param.Add("ProfileCUA_UID_InstTypeAlso" + ulCo, w.GetValue <string>("UID_InstallationType"));
                param.Add("ProfileCUA_UID_OSAlso" + ulCo, w.GetValue <string>("UID_OS"));
                ulCo++;
            }

            return(await base.OnGenerate(entity, eventname, parameters, cancellationToken).ConfigureAwait(false));
        }