public static void Log(IMemberShipData msd, IBucketListData bld, string method, IList <string> parameters) { if (msd != null) { string msg = method + " - "; foreach (string parameter in parameters) { msg += parameter + ", "; } msg = msg.Trim(' '); msg = msg.Trim(','); msd.LogMsg(msg); } else if (bld != null) { string msg = method + " - "; foreach (string parameter in parameters) { msg += parameter + ", "; } msg = msg.Trim(' '); msg = msg.Trim(','); bld.LogMsg(msg); } }
public string[] GetBucketListItems(string encodedUserName, string encodedSortString, string encodedToken) { IBucketListData bld = null; string[] result = null; try { bld = new BucketListData(Utilities.GetDbSetting()); string decodedUserName = Utilities.DecodeClientBase64String(encodedUserName); string decodedSortString = Utilities.DecodeClientBase64String(encodedSortString); string decodedToken = Utilities.DecodeClientBase64String(encodedToken); //LogParameters(); if (ProcessToken(decodedUserName, decodedToken)) { result = bld.GetBucketList(decodedUserName, decodedSortString); } else { result = Utilities.GetInValidTokenResponse(); } } catch (Exception e) { bld.LogMsg("Error: " + e.Message + ", trace: " + e.StackTrace.ToString()); } return(result); }
public static void Log(IMemberShipData msd, IBucketListData bld, string method, IList<string> parameters) { if (msd != null) { string msg = method + " - "; foreach (string parameter in parameters) msg += parameter + ", "; msg = msg.Trim(' '); msg = msg.Trim(','); msd.LogMsg(msg); } else if (bld != null) { string msg = method + " - "; foreach (string parameter in parameters) msg += parameter + ", "; msg = msg.Trim(' '); msg = msg.Trim(','); bld.LogMsg(msg); } }
public string[] GetDaily(string encodedUser, string encodedToken, bool isNasdaq) { IBucketListData bld = null; string[] result = null; try { bld = new BucketListData(Utilities.GetDbSetting()); string decodedUserName = Utilities.DecodeClientBase64String(encodedUser); string decodedToken = Utilities.DecodeClientBase64String(encodedToken); //LogParameters(); if (ProcessToken(decodedUserName, decodedToken)) { GetDailyPrice gdp = new GetDailyPrice(); // TODO - do something with bool result? bool goodPull = gdp.GetDailySpreadsheet(isNasdaq); } else { result = Utilities.GetInValidTokenResponse(); } } catch (Exception e) { bld.LogMsg("Error: " + e.Message + ", trace: " + e.StackTrace.ToString()); } return(result); }
private void AssertUsersExist(bool shouldExist, bool evaluateBucketListItems, IBucketListData bd, string userName) { var savedUsers = bd.GetUsers("testUser"); if (shouldExist) { if (evaluateBucketListItems) { var bucketListItems = bd.GetBucketList(userName); Assert.IsTrue(bucketListItems.Count > 0); } Assert.IsTrue(savedUsers.Count > 0); } else { if (evaluateBucketListItems) { var bucketListItems = bd.GetBucketList(userName); Assert.IsFalse(bucketListItems.Count > 0); } Assert.IsFalse(savedUsers.Count > 0); } }
public TgimbaService ( IBucketListData bucketListData, IPassword passwordHelper, IGenerator generatorHelper, IString stringHelper, IAvailableSortingAlgorithms availableSortingAlgorithms, IAvailableSearchingAlgorithms availableSearchingAlgorithms ) { this.bucketListData = bucketListData; this.passwordHelper = passwordHelper; this.generatorHelper = generatorHelper; this.stringHelper = stringHelper; this.availableSortingAlgorithms = availableSortingAlgorithms; this.availableSearchingAlgorithms = availableSearchingAlgorithms; }
public string[] UpsertBucketListItemV2(string encodedBucketListItems, string encodedUser, string encodedToken) { IBucketListData bld = null; string[] result = null; try { bld = new BucketListData(Utilities.GetDbSetting()); string decodedBucketListItems = Utilities.DecodeClientBase64String(encodedBucketListItems); string decodedToken = Utilities.DecodeClientBase64String(encodedToken); string decodedUserName = Utilities.DecodeClientBase64String(encodedUser); decodedBucketListItems = decodedBucketListItems.Trim(','); decodedBucketListItems = decodedBucketListItems.Trim(';'); string[] items = decodedBucketListItems.Split(','); //HACK - needed a demo user quick and I didn't want any changes if (!string.IsNullOrEmpty(decodedUserName) && decodedUserName.Equals("demouser")) { result = Utilities.GetValidTokenResponse(); } else { //LogParameters(); if (ProcessToken(decodedUserName, decodedToken)) { bld.UpsertBucketListItemV2(items); result = Utilities.GetValidTokenResponse(); } else { result = Utilities.GetInValidTokenResponse(); } } } catch (Exception e) { bld.LogMsg("Error: " + e.Message + ", trace: " + e.StackTrace.ToString()); } return(result); }
public string[] GetDashboard() { IBucketListData bld = null; string[] results = null; try { bld = new BucketListData(Utilities.GetDbSetting()); results = bld.GetDashboard(); } catch (Exception e) { bld.LogMsg("Error: " + e.Message + ", trace: " + e.StackTrace.ToString()); } return(results); }