示例#1
0
        /// <summary>
        /// Create an Ad-Hoc Access Group for the <paramref name="target"/>.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <param name="target">The target registry entry.</param>
        /// <param name="userIds">The user ids.</param>
        /// <returns></returns>
        public static int CreateAccessGroup(this IFunctionManager instance, RegistryEntry target, params int[] userIds)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            if (userIds == null || userIds.Length == 0)
            {
                throw new ArgumentException(
                          Resources
                          .FunctionManagerExtensions_CreateAccessGroup_The_must_be_at_least_one_member_in_the_Access_Group,
                          "userIds");
            }

            return
                ((int)
                 instance.Execute("OpprettTilgangsgruppeHandler", 0, target.Id,
                                  string.Join(",",
                                              userIds.Select(x => x.ToString(CultureInfo.InvariantCulture)).ToArray())));
        }
示例#2
0
        /// <summary>
        /// Marks the registry entry as read.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <param name="registryEntry">The registry entry.</param>
        public static void MarkRegistryEntryAsRead(this IFunctionManager instance, RegistryEntry registryEntry)
        {
            if (registryEntry == null)
            {
                throw new ArgumentNullException("registryEntry");
            }

            MarkRegistryEntryAsRead(instance, registryEntry.Id);
        }
示例#3
0
 /// <summary>
 /// Creates the reply.
 /// </summary>
 /// <param name="instance">The instance.</param>
 /// <param name="target">The target.</param>
 /// <param name="replyFromRecipientId">The reply from recipient id.</param>
 /// <param name="accessGroupId">The access group id.</param>
 /// <param name="downgradingCodeId">The downgrading code id.</param>
 /// <param name="downgradingDate">The downgrading date.</param>
 /// <param name="documentCategory">The document category.</param>
 /// <returns>
 /// The Id of the registry entry representing the reply.
 /// </returns>
 public static int CreateReply(this IFunctionManager instance, RegistryEntry target, int replyFromRecipientId = 0,
                               int accessGroupId       = -1, string downgradingCodeId = "", string downgradingDate = "",
                               string documentCategory = "")
 {
     return((int)instance.Execute("BesvarJournalpostMedSkjerming",
                                  target.Id,
                                  replyFromRecipientId,
                                  target.RegistryEntryTypeId == "N" ? "X" : "U",
                                  target.IsPhysical.HasValue && target.IsPhysical.Value ? "BU" : "***",
                                  target.Title,
                                  target.TitleRestricted,
                                  target.TitlePersonNameTagged,
                                  target.AccessCodeId,
                                  accessGroupId,
                                  target.Pursuant,
                                  downgradingCodeId,
                                  downgradingDate,
                                  documentCategory));
 }
示例#4
0
        /// <summary>
        /// Approves the registry entry.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <param name="registryEntry">The registry entry.</param>
        /// <param name="isApproved">if set to <c>true</c> [is approved].</param>
        /// <param name="remark">The remark.</param>
        /// <param name="notifyByEmail">if set to <c>true</c> [notify by email].</param>
        public static void MarkRegistryEntryAsApproved(this IFunctionManager instance, RegistryEntry registryEntry,
                                                       bool isApproved, string remark, bool notifyByEmail)
        {
            if (registryEntry == null)
            {
                throw new ArgumentNullException("registryEntry");
            }

            if (!registryEntry.CaseId.HasValue)
            {
                throw new ArgumentException(
                          Resources.FunctionManagerExtensions_ApproveRegistryEntry_The_registry_entry_must_have_a_valid_CaseId,
                          "registryEntry");
            }

            MarkRegistryEntryAsApproved(instance, registryEntry.CaseId.Value, registryEntry.Id, isApproved, remark,
                                        notifyByEmail);
        }
示例#5
0
 /// <summary>
 /// Creates the case party letter.
 /// </summary>
 /// <param name="instance">The instance.</param>
 /// <param name="target">The target.</param>
 /// <param name="type">The type.</param>
 /// <param name="includeCaseParties">if set to <c>true</c> [include case parties].</param>
 /// <returns></returns>
 public static int CreateCasePartyLetter(this IFunctionManager instance, RegistryEntry target, string type,
                                         bool includeCaseParties)
 {
     return((int)instance.Execute("NyttPartsbrev", target.Id, type, includeCaseParties));
 }
示例#6
0
        /// <summary>
        /// Marks the registry entry as read.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <param name="registryEntry">The registry entry.</param>
        public static async System.Threading.Tasks.Task MarkRegistryEntryAsReadAsync(this IAsyncFunctionManager instance, RegistryEntry registryEntry)
        {
            if (registryEntry == null)
            {
                throw new ArgumentNullException("registryEntry");
            }

            await MarkRegistryEntryAsReadAsync(instance, registryEntry.Id);
        }
示例#7
0
 /// <summary>
 /// Creates the case party letter.
 /// </summary>
 /// <param name="instance">The instance.</param>
 /// <param name="target">The target.</param>
 /// <param name="type">The type.</param>
 /// <param name="includeCaseParties">if set to <c>true</c> [include case parties].</param>
 /// <returns></returns>
 public static async System.Threading.Tasks.Task <int> CreateCasePartyLetterAsync(this IAsyncFunctionManager instance, RegistryEntry target, string type,
                                                                                  bool includeCaseParties)
 {
     return((int)await instance.ExecuteAsync("NyttPartsbrev", target.Id, type, includeCaseParties));
 }