using System.Linq; using System.Collections.Generic; using Dynamicweb.DataIntegration.Integration; namespace Script { public class Script : TableScript { public override string ScriptingName { get { return "Restore group relations script"; } } public override void ProcessInputRow(Mapping mapping, Dictionary row) { //TODO: add you code for processing the input row //note: the updated value should have the same type as the input value //for example: set ProductPrice column values to some value if (mapping.SourceTable != null) { //var user = Dynamicweb.Security.UserManagement.User.GetUserByUserName //Dynamicweb.Logging.LogManager.Current.GetLogger("TableScript").Info(row["AccessUserUserName"].ToString()); if (row["AccessUserUserName"].ToString() == "lim@kab-bolig.dk") { row["AccessUserGroups"] = "11"; } if (row["AccessUserUserName"].ToString() == "ran@kab-bolig.dk") { row["AccessUserGroups"] = "11,7"; } } } } public class SqlScript : TableScript { public override string ScriptingName { get { return "SQL Restore group relations script"; } } public override void ProcessInputRow(Mapping mapping, Dictionary row) { //TODO: add you code for processing the input row //note: the updated value should have the same type as the input value //for example: set ProductPrice column values to some value if (mapping.SourceTable != null) { //var user = Dynamicweb.Security.UserManagement.User.GetUserByUserName //Dynamicweb.Logging.LogManager.Current.GetLogger("TableScript").Info(row["AccessUserUserName"].ToString()); if (row["AccessUserUserName"].ToString() == "lim@kab-bolig.dk") { row["AccessUserGroups"] = "@11@"; } if (row["AccessUserUserName"].ToString() == "ran@kab-bolig.dk") { row["AccessUserGroups"] = "@11@@7@"; } } } } }