Exemple #1
0
        private void RegisterScript()
        {
            var sb = new StringBuilder();

            sb.AppendFormat(@"ASC.CRM.HistoryView.init({0},""{1}"",{2},{3},""{4}"",""{5}"",""{6}"", {7});",
                            TargetContactID,
                            TargetEntityType.ToString().ToLower(),
                            TargetEntityID,
                            Global.EntryCountOnPage,
                            TenantUtil.DateTimeNow().ToShortDateString(),
                            DateTimeExtension.DateMaskForJQuery,
                            WebImageSupplier.GetAbsoluteWebPath("empty_screen_filter.png"),
                            ASC.CRM.Core.CRMSecurity.IsAdmin.ToString().ToLower());

            Page.RegisterInlineScript(sb.ToString());
        }
Exemple #2
0
        /// <summary>
        ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
        ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
        ///     any release. You should only use it directly in your code with extreme caution and knowing that
        ///     doing so can result in application failures when updating to a new Entity Framework Core release.
        /// </summary>
        public virtual SkipNavigation SetInverse([CanBeNull] SkipNavigation inverse, ConfigurationSource configurationSource)
        {
            var oldInverse = Inverse;
            var isChanging = inverse != Inverse;

            if (inverse == null)
            {
                Inverse = null;
                _inverseConfigurationSource = null;

                return(isChanging
                    ? (SkipNavigation)DeclaringEntityType.Model.ConventionDispatcher
                       .OnSkipNavigationInverseChanged(Builder, inverse, oldInverse)
                    : inverse);
            }

            if (inverse.DeclaringEntityType != TargetEntityType)
            {
                throw new InvalidOperationException(CoreStrings.SkipNavigationWrongInverse(
                                                        inverse.Name, inverse.DeclaringEntityType.DisplayName(), Name, TargetEntityType.DisplayName()));
            }

            if (inverse.JoinEntityType != null &&
                JoinEntityType != null &&
                inverse.JoinEntityType != JoinEntityType)
            {
                throw new InvalidOperationException(CoreStrings.SkipInverseMismatchedJoinType(
                                                        inverse.Name, inverse.JoinEntityType.DisplayName(), Name, JoinEntityType.DisplayName()));
            }

            Inverse = inverse;
            UpdateInverseConfigurationSource(configurationSource);

            return(isChanging
                ? (SkipNavigation)DeclaringEntityType.Model.ConventionDispatcher
                   .OnSkipNavigationInverseChanged(Builder, inverse, oldInverse)
                : inverse);
        }