Files
using.cash/Logic/Support/ActivistEvents.cs
T

45 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using Swarmops.Logic.Swarm;
using Swarmops.Logic.Structure;
using Swarmops.Basic.Enums;
namespace Swarmops.Logic.Support
{
public class ActivistEvents
{
public static void TerminateActivistWithLogging (Person p, EventSource eventSourceSignupPage)
{
int orgId = 1;
PWEvents.CreateEvent(eventSourceSignupPage,
EventType.LostActivist,
p.Identity,
orgId,
p.Geography.Identity,
p.Identity,
0,
string.Empty);
p.TerminateActivist();
PWLog.Write(PWLogItem.Person, p.Identity, PWLogAction.ActivistLost, "Lost as activist", string.Empty);
}
public static void CreateActivistWithLogging (Geography geo, Person newActivist, string logMessage, EventSource evtSrc, bool isPublic, bool isConfirmed, int orgId)
{
PWEvents.CreateEvent(evtSrc,
EventType.NewActivist,
newActivist.Identity,
orgId,
geo.Identity,
newActivist.Identity,
0,
string.Empty);
newActivist.CreateActivist(isPublic, isConfirmed);
PWLog.Write(newActivist, PWLogItem.Person, newActivist.Identity, PWLogAction.ActivistJoin, "New activist joined.", logMessage);
}
}
}