private void ActualizeMetaData(UserConnection userConnection, MetaDataInfo metaDataInfo, bool isParentActualize = false)
        {
            var entityId         = isParentActualize ? metaDataInfo.ParentId : metaDataInfo.EntityId;
            var entitySchemaName = isParentActualize ? metaDataInfo.ParentSchemaName : metaDataInfo.EntitySchemaName;
            var syncAction       = isParentActualize ? SyncAction.Update : metaDataInfo.SyncAction;

            if (syncAction == SyncAction.Create && !IsDetailSchemaName(entitySchemaName))
            {
                return;
            }
            var actualizeMetaData = new Update(userConnection, "SysSyncMetaData")
                                    .Set("Version", Column.Parameter(metaDataInfo.ModifiedOn))
                                    .Set("ModifiedOn", Column.Parameter(metaDataInfo.ModifiedOn))
                                    .Set("ModifiedInStoreId", Column.Parameter(ExchangeConsts.LocalStoreId))
                                    .Set("LocalState", Column.Parameter(syncAction))
                                    .Where("LocalId").IsEqual(Column.Parameter(entityId))
                                    .And("RemoteStoreId").IsEqual(Column.Parameter(StoreId))
                                    .And("SyncSchemaName").IsEqual(Column.Parameter(entitySchemaName));

            if (syncAction != SyncAction.Delete)
            {
                actualizeMetaData = actualizeMetaData
                                    .And("CreatedById").IsEqual(Column.Parameter(metaDataInfo.UserContactId)) as Update;
            }
            actualizeMetaData.Execute();
        }
        private void AddResetChangedStateConditions(Update tranlationsResetQuery, IEnumerable <ISysCultureInfo> sysCulturesInfo)
        {
            tranlationsResetQuery.Where(TranslationErrorColumnName).IsEqual(Column.Parameter(string.Empty));
            var changedLanguagesCondition = GetLanguageConditions(sysCulturesInfo);

            if (changedLanguagesCondition != null)
            {
                tranlationsResetQuery.And(changedLanguagesCondition);
            }
        }
Exemple #3
0
        /// <summary>
        /// Returns base query for <see cref="SequenceFlowElement"/>
        /// </summary>
        /// <param name="sourceRefUId">Unique identifier of the sequence's source element.</param>
        /// <param name="targetRefUId">Unique identifier of the sequence's target element.</param>
        /// <returns>Query with base logic of <see cref="SequenceFlowElement"/>.</returns>
        protected virtual Update GetSequenceFlowBaseUpdate(Guid sourceRefUId, Guid targetRefUId)
        {
            var result = new Update(UserConnection, CampaignParticipantTable)
                         .Set("CampaignItemId", Column.Parameter(targetRefUId))
                         .Set("StepModifiedOn", Column.Parameter(DateTime.UtcNow))
                         .Set("StepCompletedOn", Column.Parameter(null, "DateTime"))
                         .Set("StepCompleted", Column.Parameter(false))
                         .Where("StatusId").IsEqual(Column.Parameter(CampaignConstants.CampaignParticipantParticipatingStatusId))
                         .And("CampaignItemId")
                         .IsEqual(Column.Parameter(sourceRefUId)) as Update;

            if (!SessionId.Equals(default(Guid)))
            {
                result.And(CampaignParticipantTable, "SessionId").IsEqual(Column.Parameter(SessionId));
            }
            result.WithHints(new RowLockHint());
            return(result);
        }