Skip to content

Instantly share code, notes, and snippets.

View SCullman's full-sized avatar

Stefan Cullmann SCullman

View GitHub Profile
@SCullman
SCullman / Typed Settings Example 1.cs
Last active August 29, 2015 14:22
Typed Settings for DNN
using DotNetNuke.Common;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Portals;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace AnyNamespace
{
@SCullman
SCullman / view.ascx
Last active October 22, 2015 20:57
DNN, ko and localization
<script>
var resources = <%=Resources%>;
var viewModel = {localize:resources};
ko.applyBindings(viewModel);
</script>
<span data-bind="text:localize.Message"></span>
<span data-bind="text:localize.Message_Help"></span>
@SCullman
SCullman / Cod50120.ContactName.al
Last active July 20, 2020 07:28
Business Central: Contact Name with "Lastname, Firstname" instead "Firstname Lastname"
codeunit 50120 "ContactName"
{
local procedure CalculateName(var Contact: Record Contact) Name: Text[100]
var
NewSurname30: Text[30];
NewFirstname61: Text[61];
NewName93: Text[93];
begin
if Contact.Surname <> '' then
NewSurname30 := Contact.Surname;
@SCullman
SCullman / FSharpOptions.fs
Last active February 15, 2021 21:59
PetaPoco and F# Options
namespace PetaPoco.FSharpOptions
open PetaPoco
open System
type OptionConverterAttribute() =
inherit ValueConverterAttribute()
with
override __.ConvertFromDb(value: obj) =
let toOption (v: 'T) =