/// <summary>
        /// <see cref="ExchangeSyncProvider.FillItemsFilterCollection"/>
        /// </summary>
        protected override void FillItemsFilterCollection()
        {
            _itemsFilterCollection = new Exchange.SearchFilter.SearchFilterCollection(Exchange.LogicalOperator.And);
            var draftFilter = new Exchange.SearchFilter.IsNotEqualTo(Exchange.ItemSchema.IsDraft, true);

            _itemsFilterCollection.Add(draftFilter);
            if (_userConnection.GetIsFeatureEnabled("SetEmailSynchronizedInExchange"))
            {
                var customPropSetFilter    = new Exchange.SearchFilter.Exists(ExchangeUtilityImpl.LocalIdProperty);
                var notCustomPropSetFilter = new Exchange.SearchFilter.Not(customPropSetFilter);
                _itemsFilterCollection.Add(notCustomPropSetFilter);
            }
            DateTime loadEmailsFromDate = LoadEmailsFromDate != DateTime.MinValue
                                ? LoadEmailsFromDate
                                : UserSettings.LastSyncDate;

            LogError($"LoadEmailsFromDate = '{LoadEmailsFromDate}', LastSyncDate = '{UserSettings.LastSyncDate}', result = '{loadEmailsFromDate}'");
            if (loadEmailsFromDate != DateTime.MinValue)
            {
                var localLastSyncDate = GetLastSyncDate(loadEmailsFromDate);
                var itemsFilter       = new Exchange.SearchFilter.IsGreaterThan(Exchange.ItemSchema.LastModifiedTime,
                                                                                localLastSyncDate);
                _itemsFilterCollection.Add(itemsFilter);
                LogError($"LoadEmailsFromDate filter adedd, filter date '{localLastSyncDate}'");
                AddLessThanSyncDateFilter(localLastSyncDate);
            }
        }
Ejemplo n.º 2
0
 /// <summary>Returns certain <see cref="IEmailClient"/> class instance.</summary>
 /// <returns>Certain <see cref="IEmailClient"/> class instance.</returns>
 protected IEmailClient GetCertainEmailClient()
 {
     if (UserConnection.GetIsFeatureEnabled("EmailIntegrationV2"))
     {
         return(ClassFactory.Get <IEmailClient>(new ConstructorArgument("userConnection", UserConnection)));
     }
     return(null);
 }
 private string GetMessageChannelBody()
 {
     _messageHistoryId = _userConnection.GetIsFeatureEnabled("CanUpdateHistoryMessage")
                         ? _notifier.MessageInfo.NotifierRecordId
                         : _messageHistoryId;
     return(string.Format(SimpleMessageBody,
                          _notifier.MessageInfo.ListenersData[ListenerSchemaUId], _messageHistoryId));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns exicting record rights for mailbox record.
 /// </summary>
 /// <param name="mailboxId"><see cref="MailboxSyncSettings"/> instance unique identifier.</param>
 /// <returns>List of exicting record rights for mailbox record.</returns>
 private List <RecordRightsParams> GetRecordRightsWithoutLookups(Guid mailboxId)
 {
     if (!_userConnection.GetIsFeatureEnabled("EditableEmailDefRights"))
     {
         return(LoadRightsFromDb(_mailboxRightsSchemaName, mailboxId));
     }
     return(LoadRightsFromDb("EmailDefRights", mailboxId).Union(GetFullRightsForCurrentUser()).ToList());
 }
Ejemplo n.º 5
0
 /// <summary>
 /// <see cref="ExchangeSyncProvider.GetCurrentActionIgnored"/>
 /// </summary>
 protected override bool GetCurrentActionIgnored(SyncAction action)
 {
     if (_userConnection.GetIsFeatureEnabled("SyncDeletedAppointments"))
     {
         return(false);
     }
     return(base.GetCurrentActionIgnored(action));
 }
 private bool GetIsFeatureDisabled()
 {
     if (_isFeatureEnabled == null)
     {
         _isFeatureEnabled = _userConnection.GetIsFeatureEnabled(ENABLE_PUSHSERVICE_FEATURE_CODE) &&
                             _userConnection.GetIsFeatureEnabled(ENABLE_HANDLER_FEATURE_CODE);
     }
     return(_isFeatureEnabled != true);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Returns existing email ids select, selected by <paramref name="hashes"/>.
        /// </summary>
        /// <param name="userConnection"><see cref="UserConnection"/> instance.</param>
        /// <param name="hashes">Email hashes collection.</param>
        /// <returns>Existing email ids select.</returns>
        private static Select GetEmailIdsSelect(UserConnection userConnection, IEnumerable <string> hashes)
        {
            var tableName  = userConnection.GetIsFeatureEnabled("UseViewForEmailHash") ? "VwSynchronizeEmailHash" : "Activity";
            var columnName = userConnection.GetIsFeatureEnabled("UseViewForEmailHash") ? "ActivityId" : "Id";

            return(new Select(userConnection)
                   .Column(columnName)
                   .From(tableName)
                   .Where("MailHash").In(Column.Parameters(hashes)) as Select);
        }
Ejemplo n.º 8
0
        public ForecastItemResponse GetForecastData(Guid forecastId, string[] periods)
        {
            var response = new ForecastItemResponse();

            try {
                if (UserConnection.GetIsFeatureEnabled("ForecastV2"))
                {
                    var data = ForecastProvider.GetData(forecastId, periods.Select(e => new Guid(e)));
                    response.ColumnCaptions = GetColumns(data);
                    response.Collection     = GetDataCollection(data);
                }
                else
                {
                    Guid forecastPeriodTypeId = ForecastHelper.GetForecastPeriodType(forecastId);
                    response.ColumnCaptions = ForecastHelper.GetHeaderColumnCaptions(periods, forecastPeriodTypeId);
                    response.Collection     = ForecastHelper.GetForecastItemResultCollection(forecastId,
                                                                                             forecastPeriodTypeId, periods, null);
                }
                response.Success = true;
            } catch (Exception ex) {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
        /// <summary>
        /// <see cref="ISynchronizationUCManager.GetSynchronizationUsers(Entity, SyncAction, UserConnection)"/>
        /// </summary>
        public IEnumerable <Guid> GetSynchronizationUsers(Entity entity, SyncAction action, UserConnection userConnection)
        {
            var result = new List <Guid>();

            if (!userConnection.GetIsFeatureEnabled("ExchangeCalendarWithoutMetadata"))
            {
                return(result);
            }
            var entityId = GetRelatedEntityId(entity);

            if (entityId.IsEmpty())
            {
                return(result);
            }
            if (action == SyncAction.Delete)
            {
                return(GetUsersForDeleteAction(entityId, userConnection));
            }
            var select = GetUsersSelect(userConnection, entityId);

            if (select != null)
            {
                using (DBExecutor dbExecutor = userConnection.EnsureDBConnection()) {
                    using (IDataReader reader = select.ExecuteReader(dbExecutor)) {
                        while (reader.Read())
                        {
                            result.AddIfNotExists(reader.GetColumnValue <Guid>("CreatedById"));
                        }
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 10
0
        private static EntitySchemaQuery GetFolderESQ(string schemaName, string folderSchemaName, Guid folderId,
                                                      UserConnection userConnection)
        {
            EntitySchemaQuery result;
            Entity            folderInfoEntity = GetFolderInfo(folderSchemaName, folderId, userConnection, false);

            if (folderInfoEntity == null)
            {
                return(null);
            }
            Guid folderTypeId = folderInfoEntity.GetTypedColumnValue <Guid>("FolderTypeId");

            if (folderTypeId == MarketingConsts.FolderTypeDynamicId)
            {
                byte[] searchData = folderInfoEntity.GetBytesValue("SearchData");
                if (searchData == null || searchData.Length == 0)
                {
                    return(null);
                }
                result = GetDynamicFolderESQ(schemaName, searchData, userConnection);
                if (userConnection.GetIsFeatureEnabled("UseQueryOptimize"))
                {
                    var optimizarionType = folderInfoEntity.GetTypedColumnValue <int>("OptimizationType");
                    result.QueryOptimize = GetQueryOptimize((OptimizationType)optimizarionType);;
                }
            }
            else
            {
                result = GetStaticFolderESQ(schemaName, folderId, userConnection, out var recordIdColumn);
            }
            return(result);
        }
 public virtual void Synchronize()
 {
     if (string.IsNullOrEmpty(SenderEmailAddress))
     {
         FormatResult(NeedSetUserAddress);
         return;
     }
     if (UserConnection.GetIsFeatureEnabled("EmailIntegrationV2"))
     {
         var syncSession = ClassFactory.Get <ISyncSession>("Email", new ConstructorArgument("uc", UserConnection),
                                                           new ConstructorArgument("senderEmailAddress", SenderEmailAddress));
         syncSession.Start();
         return;
     }
                         #if NETFRAMEWORK
     string resultMessage;
     int    localChangesCount, remoteChangesCount;
     ExchangeUtility.SyncExchangeItems(UserConnection, SenderEmailAddress,
                                       () => ClassFactory.Get <BaseExchangeSyncProvider>("ExchangeEmailSyncProvider",
                                                                                         new ConstructorArgument("userConnection", UserConnection),
                                                                                         new ConstructorArgument("senderEmailAddress", SenderEmailAddress),
                                                                                         new ConstructorArgument("loadEmailsFromDate", LoadEmailsFromDate),
                                                                                         new ConstructorArgument("userSettings", null)),
                                       out resultMessage, out localChangesCount, out remoteChangesCount,
                                       ExchangeUtility.MailSyncProcessName);
     if (!string.IsNullOrEmpty(resultMessage))
     {
         FormatResult(resultMessage);
         return;
     }
                         #endif
     return;
 }
        /// <summary>
        /// Notifies contacts via multilanguage templates.
        /// </summary>
        /// <param name="userConnection">User connection.</param>
        /// <param name="parameters">Parameters.</param>
        public virtual void Execute(UserConnection userConnection, IDictionary <string, object> parameters)
        {
            if (EmailWithMacrosManager == null)
            {
                EmailWithMacrosManager = new EmailWithMacrosManager(userConnection);
            }
            EmailData emailData = new EmailData();

            emailData.ParseParameters(parameters);
            if (userConnection.GetIsFeatureEnabled("EmailMessageMultiLanguageV2"))
            {
                SendEmail(emailData, emailData.TplId);
            }
            else
            {
                if (TemplateLoader == null)
                {
                    TemplateLoader = new EmailTemplateStore(userConnection);
                }
                if (EmailTemplateLanguageHelper == null)
                {
                    EmailTemplateLanguageHelper = new EmailTemplateLanguageHelper(emailData.CaseId, userConnection);
                }
                Guid   languageId     = EmailTemplateLanguageHelper.GetLanguageId(emailData.TplId, TemplateLoader);
                Entity templateEntity = TemplateLoader.GetTemplate(emailData.TplId, languageId);
                SendEmail(emailData, templateEntity.PrimaryColumnValue);
            }
        }
        ///<inheritdoc cref="IPrimaryEntityFinder"/>
        public void LoadPrimaryEntity(ImportParameters parameters, IEnumerable <ImportColumn> keysImportColumns)
        {
            var primaryEntities = PrimaryImportEntitiesGetter.Get(parameters, keysImportColumns);

            if (_userConnection.GetIsFeatureEnabled("HighestSpeedFileImport") &&
                _userConnection.GetIsFeatureEnabled("UsePersistentFileImport"))
            {
                var persistentPrimaryImportEntitiesSetter = ClassFactory
                                                            .Get <PersistentPrimaryImportEntitiesSetter>(new ConstructorArgument("userConnection", _userConnection));
                persistentPrimaryImportEntitiesSetter.Set(parameters, primaryEntities);
            }
            else
            {
                PrimaryImportEntitiesSetter.Set(parameters, primaryEntities, keysImportColumns);
            }
        }
Ejemplo n.º 14
0
        private Select GetBaseSelect(string anniversarySchemaName)
        {
            var    isAccountAnniversary = IsAccountAnniversary(anniversarySchemaName);
            string usingSchemaName      = isAccountAnniversary ? "AccountAnniversary" : "Contact";
            string column             = isAccountAnniversary ? "Date" : "BirthDate";
            var    targetEntitySchema = GetTargetEntitySchema(anniversarySchemaName);
            Select select             =
                new Select(UserConnection)
                .Column(SchemaName, "OwnerId").As("ReceiverId")
                .Column(anniversarySchemaName, "Id")
                .Column(Column.Parameter(targetEntitySchema.UId)).As("SubjectId")
                .Column(Func.CustomFunction("fn_CastDateToString", Column.SourceColumn(usingSchemaName, column)))
                .As("SubjectCaption")
                .Column(Column.Parameter(DateTime.UtcNow)).As("RemindTime")
                .Column(Column.Parameter(RemindingConsts.NotificationTypeAnniversaryId)).As("NotificationTypeId")
                .Column(Column.Parameter(0)).As("ProcessListeners")
                .Column(SchemaName, "Id").As("SenderId")
                .Column(Column.Parameter(SourceId)).As("SourceId")
                .From(SchemaName);

            if (UserConnection.GetIsFeatureEnabled("NotificationV2"))
            {
                select = select.Column(anniversarySchemaName, "Name")
                         .Column(usingSchemaName, column).As("AnniversaryBaseDate");
            }
            select = AddDefaultAnniversaryFilters(select, anniversarySchemaName);
            if (RecordId.IsNotEmpty())
            {
                select.And(SchemaName, "Id").IsEqual(Column.Parameter(RecordId));
            }
            return(select);
        }
Ejemplo n.º 15
0
 private static bool IsLoggingEnabled(UserConnection userConnection)
 {
     return(userConnection.SessionCache.WithLocalCaching()
            .GetValue <bool>(TermCalculationLogStore.CalculationLogEnabledCacheName,
                             false) &&
            userConnection.GetIsFeatureEnabled("TermCalculationLogging"));
 }
 private void ClearBufferedTable(Guid importSessionId)
 {
     if (UserConnection.GetIsFeatureEnabled("HighestSpeedFileImport"))
     {
         ImportEntitiesDataProvider.CleanBufferedImportEntities(importSessionId);
     }
 }
Ejemplo n.º 17
0
        /// <summary>
        /// Builds an HTML table cell (<td>) containing image link.
        /// </summary>
        /// <param name="id">Record id.</param>
        /// <param name="point">Point.</param>
        /// <param name="imageData">Binary image data.</param>
        /// <param name="mimeType">Image mime-type.</param>
        /// <param name="divStyle">Custom div style.</param>
        /// <returns>Table cell HTML-code.</returns>
        protected override string GetLinkCell(Guid id, int point, byte[] imageData, string mimeType,
                                              string divStyle = null)
        {
            string appRootUrl  = GetApplicationUrl();
            string linkFormat  = UserConnection.GetIsFeatureEnabled("SecureEstimation") ? TokenLinkFormat : LinkFormat;
            string link        = string.Format(linkFormat, appRootUrl, id, point);
            string encodedData = Convert.ToBase64String(imageData);
            var    sb          = new StringBuilder(1024);

            string tdColor             = "";
            string satisfactionCaption = "";

            switch (point)
            {
            case 1:
            {
                tdColor             = "#FFCCCC";
                satisfactionCaption = LocalizableStringHelper.GetValue(UserConnection,
                                                                       "ICLEstimateLinksGenerator", "FirstLevelSatisfaction");
            } break;

            case 2:
            {
                tdColor             = "#FF9966";
                satisfactionCaption = LocalizableStringHelper.GetValue(UserConnection,
                                                                       "ICLEstimateLinksGenerator", "SecondLevelSatisfaction");;
            } break;

            case 3:
            {
                tdColor             = "#FFCC99";
                satisfactionCaption = LocalizableStringHelper.GetValue(UserConnection,
                                                                       "ICLEstimateLinksGenerator", "ThirdLevelSatisfaction");;
            } break;

            case 4:
            {
                tdColor             = "#CCFFFF";
                satisfactionCaption = LocalizableStringHelper.GetValue(UserConnection,
                                                                       "ICLEstimateLinksGenerator", "FourthLevelSatisfaction");;
            } break;

            case 5:
            {
                tdColor             = "#CCFFCC";
                satisfactionCaption = LocalizableStringHelper.GetValue(UserConnection,
                                                                       "ICLEstimateLinksGenerator", "FifthLevelSatisfaction");;
            } break;

            default: break;
            }
            sb.AppendFormat("<tr><td style=\"padding: 5px 10px 5px 5px; border: 1px solid black;\" bgcolor=\"{0}\">", tdColor)
            //.AppendFormat(DivFormat, point, divStyle ?? DefaultDivStyle)
            .AppendFormat("<a href=\"{0}\">{1}</a>", link, satisfactionCaption)
            //.AppendFormat(ImgFormat, mimeType, encodedData, CellSize, point)
            .Append("</a>")
            //.Append("</div>")
            .Append("</td></tr>");
            return(sb.ToString());
        }
Ejemplo n.º 18
0
        public override void OnFileSaved()
        {
            base.OnFileSaved();

            if (!UserConnection.GetIsFeatureEnabled("LinkPreview"))
            {
                return;
            }

            var fileType = Entity.GetTypedColumnValue <Guid>("TypeId");

            if (fileType == Terrasoft.WebApp.FileConsts.LinkTypeUId)
            {
                var url = Entity.GetTypedColumnValue <string>("Name").Trim();
                if (IsURLValid(url))
                {
                    LinkPreview     linkPreview     = new LinkPreview();
                    LinkPreviewInfo linkPreviewInfo = linkPreview.GetWebPageLinkPreview(url);
                    if (linkPreviewInfo != null)
                    {
                        LinkPreviewProvider linkPreviewProvider = new LinkPreviewProvider(UserConnection);
                        linkPreviewProvider.SaveLinkPreviewInfo(linkPreviewInfo, Entity.PrimaryColumnValue);
                    }
                }
            }
        }
        public List <string> GetNotificationProviderClassNames(NotificationProviderType type,
                                                               UserConnection userConnection)
        {
            var result = new List <string>();

            if (userConnection.GetIsFeatureEnabled("NotificationV2") && type != NotificationProviderType.Visa)
            {
                return(result);
            }
            var providersSelect = new Select(userConnection)
                                  .Column("NotificationProvider", "ClassName")
                                  .From("NotificationProvider")
                                  .Where("Type").IsEqual(Column.Parameter((int)type)) as Select;

            using (var dbExecutor = userConnection.EnsureDBConnection()) {
                using (var dataReader = providersSelect.ExecuteReader(dbExecutor)) {
                    int columnIndex = dataReader.GetOrdinal("ClassName");
                    while (dataReader.Read())
                    {
                        result.Add(dataReader.GetString(columnIndex));
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 20
0
        public ForecastSummaryResponse GetSummary(string forecastId, string periods)
        {
            var response = new ForecastSummaryResponse();

            try {
                var sheetId     = new Guid(forecastId);
                var sheet       = SheetRepository.GetSheet(sheetId);
                var periodInfos = PeriodRepository.GetForecastPeriods(
                    ConvertStringIdentifiersToGuidList(periods),
                    sheet.PeriodTypeId);
                var summaryCells = ForecastSummary.GetSummary(sheetId, periodInfos.Select(p => p.Id)).ToList();
                var cellsToCalc  = GetCellsToCalc(summaryCells, periodInfos);
                if (UserConnection.GetIsFeatureEnabled("CalcTotalByFormula"))
                {
                    var formulaSummaryCells = FormulaSummaryCalculator.CalcFormulaSummary(
                        new FormulaSummaryParams {
                        ForecastId = sheetId,
                        Cells      = cellsToCalc
                    });
                    summaryCells.AddRange(formulaSummaryCells);
                }
                response.Summary = ConvertCellsToSummary(summaryCells);
            } catch (Exception ex) {
                response.Exception = ex;
            }
            return(response);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Returns collection of the folder filters.
        /// </summary>
        /// <param name="userConnection">Instance of the <see cref="Terrasoft.Core.UserConnection"/>.</param>
        /// <param name="recordId">Unique identifier of the folder.</param>
        /// <param name="folderSchemaUId">Unique identifier of the folder schema.</param>
        /// <param name="sourceSchemaName">Name of the source filters schema.</param>
        /// <param name="disableEmptyFilters">Determines whether to disable empty filters or not.</param>
        /// <returns><see cref="IEntitySchemaQueryFilterItem"/> filters collection.</returns>
        public static IEntitySchemaQueryFilterItem GetFolderEsqFilters(
            UserConnection userConnection, Guid recordId, Guid folderSchemaUId, string sourceSchemaName,
            bool disableEmptyFilters = false)
        {
            byte[] searchData = GetFolderSearchData(userConnection, recordId, folderSchemaUId);
            if (searchData?.IsEmpty() != false)
            {
                return(null);
            }

            var disableEmptyFilterBeforeBuildEsq = userConnection.GetIsFeatureEnabled("DisableEmptyFilterBeforeBuildEsq");
            var filters = DeserializeFilters(searchData);

            if (disableEmptyFilters && disableEmptyFilterBeforeBuildEsq)
            {
                DisableEmptyFilters(new[] { filters });
            }

            var selectQuery = new Terrasoft.Nui.ServiceModel.DataContract.SelectQuery {
                RootSchemaName = sourceSchemaName,
                Filters        = filters
            };
            EntitySchemaQueryFilterCollection esqFilters = selectQuery.BuildEsq(userConnection).Filters;

            if (disableEmptyFilters && !disableEmptyFilterBeforeBuildEsq)
            {
                DisableEmptyEntitySchemaQueryFilters(esqFilters);
            }
            return(esqFilters);
        }
        private ForecastDataResponse ProcessGetForecastData(ForecastRequestData requestData)
        {
            var response = new ForecastDataResponse();

            try {
                var periodIds       = requestData.Periods;
                var hierarchyRowsId = requestData.HierarchyRows;
                int rowOffset       = int.TryParse(requestData.Offset, out rowOffset) ? rowOffset : 0;
                int hierarchyLevel  = hierarchyRowsId.Count();
                var pageableConfig  = new PageableConfig()
                {
                    RowCount           = requestData.Count,
                    RowsOffset         = rowOffset,
                    LastValue          = requestData.LastRow,
                    HierarchyRowsId    = hierarchyRowsId,
                    HierarchyLevel     = hierarchyLevel,
                    PrimaryFilterValue = HttpUtility.UrlDecode(requestData.FilterValue)
                };
                var data    = ForecastProvider.GetData(requestData.ForecastId, periodIds, pageableConfig);
                var columns = ForecastDataMapper.GetMapTableColumns(data);
                response.DataSource = ForecastDataMapper.GetMapTreeTableDataItems(data, columns);
                if (UserConnection.GetIsFeatureEnabled("ForecastSummaryFormula"))
                {
                    SummaryColumnCalculator.ApplySummaryColumns(UserConnection, columns);
                    SummaryColumnCalculator.ApplySummaryData(UserConnection, requestData.ForecastId,
                                                             response.DataSource);
                }
                FilterHiddenColumns(columns);
                response.Columns = columns;
            } catch (Exception ex) {
                response.Exception = ex;
            }
            return(response);
        }
        /// <summary>
        /// Begin search process.
        /// </summary>
        public void BeginSearch()
        {
            Guid   operationId          = DeduplicationConsts.SearchOperationId;
            bool   isFeatureEnable      = _userConnection.GetIsFeatureEnabled("FindDuplicatesOnSave");
            string tspFindDuplicateName = string.Format(FindDuplicateProcedurePattern, _schemaName);

            if (isFeatureEnable)
            {
                tspFindDuplicateName = string.Format(FindDuplicateProcedurePattern, String.Empty);
            }
            if (!Locker.CanExecute(operationId, _schemaName))
            {
                return;
            }
            Guid conversationId = ConversationProvider.BeginConversation(tspFindDuplicateName);

            try {
                Locker.SetLockState(conversationId, _schemaName, operationId, true);
                var storedProcedure = new StoredProcedure(_userConnection, tspFindDuplicateName);
                if (isFeatureEnable)
                {
                    storedProcedure.WithParameter("schemaName", _schemaName);
                    storedProcedure.WithParameter("xmlRows", String.Empty);
                    storedProcedure.WithParameter("sysAdminUnit", _userConnection.CurrentUser.Id);
                }
                storedProcedure.Execute();
                ConversationProvider.EndConversation(conversationId);
                CreateSuccessReminding();
            } catch (Exception e) {
                ConversationProvider.EndConversationWithError(conversationId, CommonSqlExceptionCode, e.Message);
                CreateReminding(_userConnection.GetLocalizableString("DeduplicationActionHelper", "FaildDuplicatesSearchMessage"));
            } finally {
                Locker.SetLockState(conversationId, _schemaName, operationId, false);
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Send email.
        /// </summary>
        protected virtual void SendEmail()
        {
            var emailClientFactory  = ClassFactory.Get <EmailClientFactory>(new ConstructorArgument("userConnection", UserConnection));
            var activityEmailSender = UserConnection.GetIsFeatureEnabled("SecureEstimation") ? new SecureActivityEmailSender(emailClientFactory, UserConnection) :
                                      new ActivityEmailSender(emailClientFactory, UserConnection);

            activityEmailSender.Send(EntityRecordId);
        }
 /// <summary>
 /// Unlocks processed in current synchronization entities for synchronization in another synchronization sessions.
 /// </summary>
 /// <param name="userConnection"><see cref="UserConnection"/> instance.</param>
 protected override void UnlockSyncedEntities(UserConnection userConnection)
 {
     if (!userConnection.GetIsFeatureEnabled("AsyncEmailEventHandling"))
     {
         return;
     }
     base.UnlockSyncedEntities(userConnection);
 }
 public virtual bool ScriptTask3_1e31c06892df417aa6ebf6cbdcf32e7dExecute(ProcessExecutingContext context)
 {
     if (UserConnection.GetIsFeatureEnabled("ValidateLevelPartnershipParam"))
     {
         CheckIsDuplicated(Entity);
     }
     return(true);
 }
Ejemplo n.º 27
0
 public override void BaseEntityWithPositionDeleted()
 {
     if (UserConnection.GetIsFeatureEnabled("NewWorkplaceUI"))
     {
         return;
     }
     base.BaseEntityWithPositionDeleted();
 }
Ejemplo n.º 28
0
 private IBaseFileImporter CreateFileImporter()
 {
     if (UserConnection.GetIsFeatureEnabled("UsePersistentFileImport"))
     {
         return(ClassFactory.Get <IPersistentFileImporter>(UserConstructorArgument));
     }
     return(ClassFactory.Get <IFileImporter>(UserConstructorArgument));
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Clears synchronization error in mailbox.
 /// </summary>
 /// <param name="helper"><see cref="ISynchronizationErrorHelper"/> implementation instance.</param>
 /// <param name="emailClient"><see cref="IEmailClient"/> implementation instance.</param>
 /// <param name="senderEmailAddress">Sender email address.</param>
 private void ClearSyncError(ISynchronizationErrorHelper helper, IEmailClient emailClient, string senderEmailAddress)
 {
     if (_userConnection.GetIsFeatureEnabled("EmailIntegrationV2") && !(emailClient is SmtpClient))
     {
         return;
     }
     helper.CleanUpSynchronizationError(senderEmailAddress);
 }
 /// <summary>
 /// <seealso cref="IBackgroundTask{TParameters}.Run(TParameters)"/>
 /// </summary>
 public override void Run(IDictionary <string, object> parameters)
 {
     if (!UserConnection.GetIsFeatureEnabled("AsyncEmailEventHandling"))
     {
         Execute(UserConnection, parameters);
         return;
     }
     base.Run(parameters);
 }