|
|
@ -7,10 +7,11 @@ using FLocal.Common.actions; |
|
|
|
using FLocal.Common.dataobjects; |
|
|
|
using FLocal.Common.dataobjects; |
|
|
|
using FLocal.Core; |
|
|
|
using FLocal.Core; |
|
|
|
using System.Configuration; |
|
|
|
using System.Configuration; |
|
|
|
|
|
|
|
using NConsoler; |
|
|
|
|
|
|
|
|
|
|
|
namespace FLocal.ImportConsole { |
|
|
|
namespace FLocal.ImportConsole { |
|
|
|
class Program { |
|
|
|
class Program { |
|
|
|
static void Main(string[] args) { |
|
|
|
public static void Main(string[] args) { |
|
|
|
|
|
|
|
|
|
|
|
if(!FLocal.Common.Config.isInitialized) { |
|
|
|
if(!FLocal.Common.Config.isInitialized) { |
|
|
|
lock(typeof(FLocal.Common.Config)) { |
|
|
|
lock(typeof(FLocal.Common.Config)) { |
|
|
@ -18,12 +19,20 @@ namespace FLocal.ImportConsole { |
|
|
|
FLocal.Common.Config.Init(ConfigurationManager.AppSettings); |
|
|
|
FLocal.Common.Config.Init(ConfigurationManager.AppSettings); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Consolery.Run(typeof(Program), args); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Action] |
|
|
|
|
|
|
|
public static void ImportUsers() { |
|
|
|
|
|
|
|
|
|
|
|
for(int i=1; i<800; i++) { |
|
|
|
for(int i=1; i<800; i++) { |
|
|
|
Console.Write("[" + i + "]"); |
|
|
|
Console.Write("[" + i + "]"); |
|
|
|
foreach(string userName in ShallerGateway.getUserNames(i)) { |
|
|
|
foreach(string userName in ShallerGateway.getUserNames(i)) { |
|
|
|
Console.Write("."); |
|
|
|
try { |
|
|
|
|
|
|
|
User.LoadByName(userName); |
|
|
|
|
|
|
|
Console.Write("-"); |
|
|
|
|
|
|
|
} catch(NotFoundInDBException) { |
|
|
|
Dictionary<string, string> userData = ShallerGateway.getUserInfo(userName); |
|
|
|
Dictionary<string, string> userData = ShallerGateway.getUserInfo(userName); |
|
|
|
AbstractChange addUser = new InsertChange( |
|
|
|
AbstractChange addUser = new InsertChange( |
|
|
|
User.TableSpec.instance, |
|
|
|
User.TableSpec.instance, |
|
|
@ -49,8 +58,15 @@ namespace FLocal.ImportConsole { |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
ChangeSetUtil.ApplyChanges(addUser, addAccount); |
|
|
|
ChangeSetUtil.ApplyChanges(addUser, addAccount); |
|
|
|
|
|
|
|
Console.Write("."); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Action] |
|
|
|
|
|
|
|
public static void ProcessUpload(string pathToUpload) { |
|
|
|
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|