public static FCUser CreateUser(string n, string p) { FCUser newUser = new FCUser { name = n, pass = p, status = FCUser.eStatus.eDisabled, g = Guid.NewGuid() }; // creates or confirms user #if _LINQXML_ DataHelperLinqXml.AddEntryPointHistory(epl); #elif _SQLITE_ using (var ctx = new ConnectionContextSQLite()) { if (!DataHelperSQLite.CreateUser(ctx, newUser)) { return(null); } return(newUser); } #else // _MYSQL_ using (var ctx = new ConnectionContextMySQL()) { return(DataHelper.CreateUser(ctx, user)); } #endif }
public static UserAccounts.FCUser LoginUser(string name, string pass) { #if _LINQXML_ DataHelperLinqXml.AddEntryPointHistory(epl); #elif _SQLITE_ using (var ctx = new ConnectionContextSQLite()) { return(DataHelperSQLite.LoginUser(ctx, name, pass)); } #else // _MYSQL_ using (var ctx = new ConnectionContextMySQL()) { return(DataHelper.CheckSignInUser(ctx, user)); } #endif }
public static List <EntryPoint> GetEntryPointByInstrument(Instrument instr) { #if _LINQXML_ DataHelperLinqXml.GetEntryPointByRateIdType(ref ep); #elif _SQLITE_ using (var ctx = new ConnectionContextSQLite()) { return(DataHelperSQLite.GetEntryPointByInstrument(ctx, instr)); } #else // _MYSQL_ using (var ctx = new ConnectionContextMySQL()) { DataHelper.GetEntryPointByRateIdType(ctx, ref ep); } #endif }
public static void UpdateEntryPoint(EntryPoint ep) { #if _LINQXML_ DataHelperLinqXml.UpdateEntryPoint(ep); #elif _SQLITE_ using (var ctx = new ConnectionContextSQLite()) { DataHelperSQLite.UpdateEntryPoint(ctx, ep); } #else // _MYSQL_ using (var ctx = new ConnectionContextMySQL()) { DataHelper.UpdateEntryPoint(ctx, ep); } #endif }
public static List <EntryPoint> GetAllEntryPoints(bool isDemo) { #if _LINQXML_ return(DataHelperLinqXml.GetAllEntryPoints()); #elif _SQLITE_ using (var ctx = new ConnectionContextSQLite()) { return(DataHelperSQLite.GetAllEntryPoints(ctx, isDemo)); } #else // _MYSQL_ using (var ctx = new ConnectionContextMySQL()) { return(DataHelper.GetAllEntryPoints(ctx)); } #endif }
// // DataFeed // public static List <YieldCurveDefinition> GetYieldCurveDef(long?idYc) { #if _LINQXML_ return(DataHelperLinqXml.GetYieldCurveDef(idYc)); #elif _SQLITE_ using (var ctx = new ConnectionContextSQLite()) { return(DataHelperSQLite.GetYieldCurveDef(ctx, idYc)); } #else // _MYSQL_ using (var ctx = new ConnectionContextMySQL()) { return(DataHelper.GetYieldCurveData(ctx, idYc)); } #endif }
public static void AddEntryPointHistory(List <EntryPoint> epl) { #if _LINQXML_ DataHelperLinqXml.AddEntryPointHistory(epl); #elif _SQLITE_ using (var ctx = new ConnectionContextSQLite()) { DataHelperSQLite.AddEntryPointHistory(ctx, epl); } #else // _MYSQL_ using (var ctx = new ConnectionContextMySQL()) { DataHelper.AddEntryPointHistory(ctx, epl); } #endif }
public static bool ConfirmUser(string code) { // creates or confirms user #if _LINQXML_ DataHelperLinqXml.AddEntryPointHistory(epl); #elif _SQLITE_ using (var ctx = new ConnectionContextSQLite()) { return(DataHelperSQLite.ConfirmUser(ctx, code)); } #else // _MYSQL_ using (var ctx = new ConnectionContextMySQL()) { return(DataHelper.ConfirmUser(ctx, user)); } #endif }