/// <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 async System.Threading.Tasks.Task <int> CreateAccessGroupAsync(this IAsyncFunctionManager 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) await instance.ExecuteAsync("OpprettTilgangsgruppeHandler", 0, target.Id, string.Join(",", userIds.Select(x => x.ToString(CultureInfo.InvariantCulture)).ToArray()))); }
/// <summary> /// Marks the case as complete. /// </summary> /// <param name="instance">The instance.</param> /// <param name="completedCase">The @case.</param> public static async System.Threading.Tasks.Task MarkCaseAsCompleteAsync(this IAsyncFunctionManager instance, Case completedCase) { if (completedCase == null) { throw new ArgumentNullException("completedCase"); } await MarkCaseAsCompleteAsync(instance, completedCase.Id); }
/// <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); }
/// <summary> /// Marks the case as read. /// </summary> /// <param name="instance">The instance.</param> /// <param name="caseId">The case id.</param> public static async System.Threading.Tasks.Task MarkCaseAsReadAsync(this IAsyncFunctionManager instance, int caseId) { if (instance == null) { throw new ArgumentNullException("instance"); } await instance.ExecuteAsync("MarkerSakSomLest", caseId); }
/// <summary> /// Marks the task as complete. /// </summary> /// <param name="instance">The instance.</param> /// <param name="taskId">The task id.</param> public static async System.Threading.Tasks.Task MarkTaskAsCompleteAsync(this IAsyncFunctionManager instance, int taskId) { if (instance == null) { throw new ArgumentNullException("instance"); } await instance.ExecuteAsync("MerkAktivitetSomFullfoert", taskId); }
/// <summary> /// Marks the task as complete. /// </summary> /// <param name="instance">The instance.</param> /// <param name="task">The task.</param> public static async System.Threading.Tasks.Task MarkTaskAsCompleteAsync(this IAsyncFunctionManager instance, Task task) { if (task == null) { throw new ArgumentNullException("task"); } await MarkTaskAsCompleteAsync(instance, task.Id); }
/// <summary> /// Marks the case as complete. /// </summary> /// <param name="instance">The instance.</param> /// <param name="caseId">The case id.</param> public static async System.Threading.Tasks.Task MarkCaseAsCompleteAsync(this IAsyncFunctionManager instance, int caseId) { if (instance == null) { throw new ArgumentNullException("instance"); } await instance.ExecuteAsync("SettSakTilFerdigmeldt", caseId); }
/// <summary> /// Requests the document approval. /// </summary> /// <param name="instance">The instance.</param> /// <param name="registryEntryId">The registry entry id.</param> /// <param name="documentDescriptionId">The document description id.</param> /// <param name="approverUserNameId">The approver user name id.</param> public static async System.Threading.Tasks.Task RequestDocumentApprovalAsync(this IAsyncFunctionManager instance, int registryEntryId, int documentDescriptionId, int?approverUserNameId = null) { if (instance == null) { throw new ArgumentNullException("instance"); } await instance.ExecuteAsync("GodkjennDokument", registryEntryId, documentDescriptionId, (approverUserNameId ?? 0).ToString(CultureInfo.InvariantCulture)); }
/// <summary> /// Hents the dokumentmal. /// </summary> /// <param name="instance">The instance.</param> /// <param name="journalpostId">The journalpost id.</param> /// <param name="dokumentbeskrivelseId">The dokumentbeskrivelse id.</param> /// <param name="dokumentmalTypeIds">The dokumentmal type ids.</param> /// <returns></returns> public static async Task <IEnumerable <Dokumentmal> > HentDokumentmalAsync(this IAsyncFunctionManager instance, int journalpostId, int dokumentbeskrivelseId, params int[] dokumentmalTypeIds) { var dokumentmaler = (DataSet)await instance.ExecuteAsync("HentDokumentmaler", journalpostId, dokumentbeskrivelseId, string.Join(",", dokumentmalTypeIds.Select(x => x.ToString(CultureInfo.InvariantCulture)).ToArray())); return(from DataRow dokumentmalRow in dokumentmaler.Tables[0].Rows select new Dokumentmal { Id = Convert.ToInt32(dokumentmalRow["Id"]), Betegnelse = (string)dokumentmalRow["malnavn"], DokumentmalTypeId = Convert.ToInt32(dokumentmalRow["Type"]) }); }
/// <summary> /// Marks the registry entry as read. /// </summary> /// <param name="instance">The instance.</param> /// <param name="registryEntryId">The registry entry id.</param> public static async System.Threading.Tasks.Task MarkRegistryEntryAsReadAsync(this IAsyncFunctionManager instance, int?registryEntryId) { if (instance == null) { throw new ArgumentNullException("instance"); } if (!registryEntryId.HasValue) { throw new ArgumentNullException("registryEntryId"); } await instance.ExecuteAsync("MarkerJournalpostSomLest", registryEntryId); }
/// <summary> /// Distributes the registry entry. /// </summary> /// <param name="instance">The instance.</param> /// <param name="registryEntryId">The registry entry id.</param> /// <param name="administrativeUnitId">The administrative unit id.</param> /// <param name="userNameId">The user name id.</param> /// <param name="registryManagementUnitId">The registry management unit id.</param> /// <param name="sendEmail">if set to <c>true</c> [send email].</param> /// <param name="remark">The remark.</param> /// <param name="newRecipients">The new recipients.</param> public static async System.Threading.Tasks.Task DistributeRegistryEntryAsync(this IAsyncFunctionManager instance, int registryEntryId, int administrativeUnitId, int userNameId, string registryManagementUnitId, bool sendEmail, string remark, IEnumerable <SenderRecipient> newRecipients) { var newRecipientSerialized = new StringBuilder(); using (var nyeMottakereWriter = XmlWriter.Create(newRecipientSerialized)) { var serializer = new DataContractSerializer(typeof(SenderRecipient[]), new[] { typeof(SenderRecipient) }); serializer.WriteObject(nyeMottakereWriter, newRecipients.ToArray()); } await instance.ExecuteAsync("DistributeV3En", registryEntryId, administrativeUnitId, userNameId, registryManagementUnitId, sendEmail, remark, newRecipientSerialized.ToString()); }
/// <summary> /// Requests the document approval. /// </summary> /// <param name="instance">The instance.</param> /// <param name="registryEntryDocument">The registry entry document.</param> /// <param name="approverUserNameId">The approver user name id.</param> public static async System.Threading.Tasks.Task RequestDocumentApprovalAsync(this IAsyncFunctionManager instance, RegistryEntryDocument registryEntryDocument, int?approverUserNameId = null) { if (instance == null) { throw new ArgumentNullException("instance"); } if (registryEntryDocument == null) { throw new ArgumentNullException("registryEntryDocument"); } await instance.RequestDocumentApprovalAsync(registryEntryDocument.RegistryEntryId, registryEntryDocument.DocumentDescriptionId, approverUserNameId ?? 0); }
/// <summary> /// Opprett ad-hoc tilgangsgruppe for journalpost. /// </summary> /// <param name="instance">The instance.</param> /// <param name="journalpost">The journalpost.</param> /// <param name="personIds">The person ids.</param> /// <returns></returns> public static async Task <int> OpprettTilgangsgruppeAsync(this IAsyncFunctionManager instance, Journalpost journalpost, params int[] personIds) { if (instance == null) { throw new ArgumentNullException("instance"); } if (journalpost == null) { throw new ArgumentNullException("journalpost"); } if (personIds == null || personIds.Length == 0) { throw new ArgumentException(@"Det må angis minst ett medlem av tilgangsgruppen.", "personIds"); } return((int)await instance.ExecuteAsync("OpprettTilgangsgruppeHandler", 0, journalpost.Id, string.Join(",", personIds.Select(x => x.ToString(CultureInfo.InvariantCulture)).ToArray()))); }
/// <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 async System.Threading.Tasks.Task <int> CreateReplyAsync(this IAsyncFunctionManager instance, RegistryEntry target, int replyFromRecipientId = 0, int accessGroupId = -1, string downgradingCodeId = "", string downgradingDate = "", string documentCategory = "") { return((int)await instance.ExecuteAsync("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)); }
/// <summary> /// Designates the registry entry as reply. /// </summary> /// <param name="instance">The instance.</param> /// <param name="replyToSenderId">The reply to sender id.</param> /// <param name="replyToRegistryEntryId">The reply to registry entry id.</param> /// <param name="replyWithRegistryEntryId">The reply with registry entry id.</param> /// <param name="followUpMethod">The follow up method.</param> /// <param name="documentCategory">The document category.</param> public static async System.Threading.Tasks.Task DesignateRegistryEntryAsReplyAsync(this IAsyncFunctionManager instance, int replyToSenderId, int replyToRegistryEntryId, int replyWithRegistryEntryId, string followUpMethod, string documentCategory) { await instance.ExecuteAsync("BesvarInngaaendeJournalposterMedUtgaaende", new object[] { replyToSenderId, replyWithRegistryEntryId, followUpMethod, replyToRegistryEntryId.ToString( CultureInfo.InvariantCulture), documentCategory }); }
/// <summary> /// Approves the registry entry. /// </summary> /// <param name="instance">The instance.</param> /// <param name="caseId">The case id.</param> /// <param name="registryEntryId">The registry entry id.</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 async System.Threading.Tasks.Task MarkRegistryEntryAsApprovedAsync(this IAsyncFunctionManager instance, int caseId, int registryEntryId, bool isApproved, string remark, bool notifyByEmail) { if (instance == null) { throw new ArgumentNullException("instance"); } await instance.ExecuteAsync("GodkjennJournalpost", caseId, registryEntryId, isApproved, remark, notifyByEmail); }
/// <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 async System.Threading.Tasks.Task MarkRegistryEntryAsApprovedAsync(this IAsyncFunctionManager 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"); } await MarkRegistryEntryAsApprovedAsync(instance, registryEntry.CaseId.Value, registryEntry.Id, isApproved, remark, notifyByEmail); }
/// <summary> /// Marks the sender recipient as read. /// </summary> /// <param name="instance">The instance.</param> /// <param name="senderRecipient">The sender recipient.</param> public static async System.Threading.Tasks.Task MarkSenderRecipientAsReadAsync(this IAsyncFunctionManager instance, SenderRecipient senderRecipient) { if (senderRecipient == null) { throw new ArgumentNullException("senderRecipient"); } await MarkSenderRecipientAsReadAsync(instance, senderRecipient.Id); }
/// <summary> /// Oppretts the sak aktivitetsflyt. /// </summary> /// <param name="instance">The instance.</param> /// <param name="templateId">The template id.</param> /// <param name="sakId">The sak id.</param> /// <param name="position">The position.</param> /// <param name="asSibling">if set to <c>true</c> [as sibling].</param> /// <param name="mottakere">The mottakere.</param> public static async System.Threading.Tasks.Task OpprettSakAktivitetsflytAsync(this IAsyncFunctionManager instance, int templateId, int sakId, int position, bool asSibling, IEnumerable <AvsenderMottaker> mottakere) { await instance.ExecuteAsync("NewActivitiesFromTemplate", templateId, sakId, 1, position, asSibling, string.Join(";", mottakere.Select(AktivitetMottakerToString).ToArray())); }
/// <summary> /// Marks the <see cref="RegistryEntryDocument"/> as complete. /// </summary> /// <param name="instance">The instance.</param> /// <param name="registryEntryDocument">The target.</param> public static async System.Threading.Tasks.Task MarkRegistryEntryDocumentAsCompleteAsync(this IAsyncFunctionManager instance, RegistryEntryDocument registryEntryDocument) { if (instance == null) { throw new ArgumentNullException("instance"); } if (registryEntryDocument == null) { throw new ArgumentNullException("registryEntryDocument"); } await instance.MarkRegistryEntryDocumentAsCompleteAsync(registryEntryDocument.RegistryEntryId, registryEntryDocument.DocumentDescriptionId); }
/// <summary> /// Oppretts the sak aktivitetsflyt. /// </summary> /// <param name="instance">The instance.</param> /// <param name="templateId">The template id.</param> /// <param name="caseId">The sak id.</param> /// <param name="position">The position.</param> /// <param name="asSibling">if set to <c>true</c> [as sibling].</param> /// <param name="recipients">The mottakere.</param> public static async System.Threading.Tasks.Task CreateCaseActivitiesAsync(this IAsyncFunctionManager instance, int templateId, int caseId, int position, bool asSibling, IEnumerable <SenderRecipient> recipients) { await instance.ExecuteAsync("NewActivitiesFromTemplate", templateId, caseId, 0, position, asSibling, string.Join(";", recipients.Select(RecipientToString).ToArray())); }
/// <summary> /// Oppretts the journalpost aktivitetsflyt. /// </summary> /// <param name="instance">The instance.</param> /// <param name="templateId">The template id.</param> /// <param name="journalpostId">The journalpost id.</param> /// <param name="position">The position.</param> /// <param name="asSibling">if set to <c>true</c> [as sibling].</param> /// <param name="mottakere">The mottakere.</param> public static async Task OpprettJournalpostAktivitetsflytAsync(this IAsyncFunctionManager instance, int templateId, int journalpostId, int position, bool asSibling, IEnumerable <AvsenderMottaker> mottakere) { await instance.ExecuteAsync("NewActivitiesFromTemplate", templateId, journalpostId, 0, position, asSibling, string.Join(";", mottakere.Select(AktivitetMottakerToString).ToArray())); }
/// <summary> /// Opprett ad-hoc tilgangsgruppe for sak. /// </summary> /// <param name="instance">The instance.</param> /// <param name="sak">The sak.</param> /// <param name="personIds">The person ids.</param> /// <returns></returns> public static async System.Threading.Tasks.Task <int> OpprettTilgangsgruppeAsync(this IAsyncFunctionManager instance, Sak sak, params int[] personIds) { if (instance == null) { throw new ArgumentNullException("instance"); } if (sak == null) { throw new ArgumentNullException("sak"); } if (personIds == null || personIds.Length == 0) { throw new ArgumentException(@"Det må angis minst ett medlem av tilgangsgruppen.", "personIds"); } if (!sak.Id.HasValue) { throw new InvalidOperationException("Sak må ha en Id."); } return((int)await instance.ExecuteAsync("OpprettTilgangsgruppeHandler", sak.Id, 0, string.Join(",", personIds.Select(x => x.ToString(CultureInfo.InvariantCulture)).ToArray()))); }
/// <summary> /// Marks the registry entry document as complete. /// </summary> /// <param name="instance">The instance.</param> /// <param name="registryEntryId">The registry entry id.</param> /// <param name="documentDescriptionId">The document description id.</param> public static async System.Threading.Tasks.Task MarkRegistryEntryDocumentAsCompleteAsync(this IAsyncFunctionManager instance, int registryEntryId, int documentDescriptionId) { if (instance == null) { throw new ArgumentNullException("instance"); } await instance.ExecuteAsync("FerdigstillDokument", registryEntryId, documentDescriptionId); }
/// <summary> /// Hents the dokumentmaltyper. /// </summary> /// <param name="instance">The instance.</param> /// <returns></returns> public static async System.Threading.Tasks.Task <IDictionary <int, string> > HentDokumentmaltyperAsync(this IAsyncFunctionManager instance) { var dokumentmalTyper = (DataSet)await instance.ExecuteAsync("HentDokumentmalTyper"); return(dokumentmalTyper.Tables[0].Rows.Cast <DataRow>().ToDictionary(dokumentmalType => Convert.ToInt32(dokumentmalType["DMT_ID"]), dokumentmalType => dokumentmalType["DMT_BESKRIVELSE"].ToString())); }
/// <summary> /// Marks the registry entry as followed up. /// </summary> /// <param name="instance">The instance.</param> /// <param name="registryEntryId">The registry entry id.</param> /// <param name="recipientId">The recipient id.</param> /// <param name="followUpMethod">The follow up method.</param> /// <param name="remark">The remark.</param> public static async System.Threading.Tasks.Task MarkRegistryEntryAsFollowedUpAsync(this IAsyncFunctionManager instance, int registryEntryId, int recipientId, string followUpMethod, string remark) { if (instance == null) { throw new ArgumentNullException("instance"); } await instance.ExecuteAsync("AvskrivJournalpost", registryEntryId, recipientId, followUpMethod, remark); }
/// <summary> /// Henter sak aktivitetsmaler. /// </summary> /// <param name="instance">The instance.</param> /// <returns></returns> public static async System.Threading.Tasks.Task <IDictionary <int, string> > HentSakAktivitetsmalerAsync(this IAsyncFunctionManager instance) { var aktivitetsmaler = (DataSet)await instance.ExecuteAsync("HentAktivitetsmaler", 0); var templates = new Dictionary <int, string>(); for (var i = 0; i < aktivitetsmaler.Tables[0].DefaultView.Count; i++) { var aktivitetsmal = aktivitetsmaler.Tables[0].DefaultView[i]; templates.Add(Convert.ToInt32(aktivitetsmal[0]), aktivitetsmal[1].ToString()); } return(templates); }
/// <summary> /// Marks the registry entry as followed up. /// </summary> /// <param name="instance">The instance.</param> /// <param name="recipient">The recipient.</param> /// <param name="followUpMethod">The follow up method.</param> /// <param name="remark">The remark.</param> public static async System.Threading.Tasks.Task MarkRegistryEntryAsFollowedUpAsync(this IAsyncFunctionManager instance, SenderRecipient recipient, string followUpMethod, string remark) { if (recipient == null) { throw new ArgumentNullException("recipient"); } if (!recipient.RegistryEntryId.HasValue) { throw new ArgumentException( Resources.FunctionManagerExtensions_The_recipient_must_have_a_valid_RegistryEntryId, "recipient"); } await MarkRegistryEntryAsFollowedUpAsync(instance, recipient.RegistryEntryId.Value, recipient.Id, followUpMethod, remark); }
/// <summary> /// Henter tilgangskodene til en bruker. /// </summary> /// <param name="instance">The instance.</param> /// <param name="personnavnId">The personnavn id.</param> /// <returns></returns> public static async System.Threading.Tasks.Task <IEnumerable <string> > HentTilgangskoderAsync(this IAsyncFunctionManager instance, int personnavnId) { var tilgangskodeIds = (string)await instance.ExecuteAsync("Tilgangskoder", personnavnId); return(tilgangskodeIds.Split(new [] { "," }, StringSplitOptions.RemoveEmptyEntries).Select(tilgangskodeId => tilgangskodeId.Trim())); }
/// <summary> /// Marks the sender recipient as read. /// </summary> /// <param name="instance">The instance.</param> /// <param name="senderRecipientId">The sender recipient id.</param> public static async System.Threading.Tasks.Task MarkSenderRecipientAsReadAsync(this IAsyncFunctionManager instance, int senderRecipientId) { if (instance == null) { throw new ArgumentNullException("instance"); } await instance.ExecuteAsync("MarkerAvsenderMottakerSomLest", senderRecipientId); }