protected void btnSubmitOrder_onclick(object sender, EventArgs e) { HttpCookie cookie = new HttpCookie("SessionCookie"); cookie = Request.Cookies["SessionCookie"]; dynamic accountData = func.cookieStatus(cookie); if (accountData.GetType() == typeof(RepoMapConnect)) { if (continuePermit(accountData.map)) { RepoMapConnect RMC = new RepoMapConnect(databaseTable.CoinOrder); RMC.map.CT = func.coinTypeStringToEnum(ddlCoinType.SelectedValue.ToString()); RMC.map.coinsToBeTraded = decimal.Parse(txtQuantity.Text); RMC.map.perCoin = decimal.Parse(txtOffer.Text); if (RMC.map.CT == coinType.Bitcoin) { RMC.map.coinBankVal = accountData.map.coinBankVal1; } else { RMC.map.coinBankVal = accountData.map.coinBankVal2; } RMC.map.OT = func.orderTypeStringToEnum(ddlBuySell.SelectedValue.ToString()); RMC.repo.executeData(RMC.map, sqlStatementType.Insert); lblErrorInfo.Text = "Order submitted."; } } }
protected void btnRegister_onclick(object sender, EventArgs e) { RepoMapConnect RMC = new RepoMapConnect(databaseTable.PrimaryAccount); PrimaryAccountMap map = new PrimaryAccountMap(true); if (txtPass.Text == txtPass2.Text && txtUsername.Text != "Divinityfound") { map.email = txtEmail.Text; map.username = txtUsername.Text; map.password = RMC.func.hashedValue(txtPass.Text + map.salt); RMC.map = map; RMC.repo.executeData(RMC.map, sqlStatementType.Insert); RMC.func.sendemail("*****@*****.**", map.email, "Coins Share || Account Created", string.Format(@"Welcome {0},<br /><br /> Your account has been created.<br /> <br /> Username: {0}<br /> Password: {1}<br /> <br /> Your account currently is unverified. In order to verify your account, you must make a deposit in Bitcoins, Litecoins, or Credit Card.<br /> <br /> Any amount of bitcoins, litecoins will do. A minimum of $5.00 USD must be deposited to be verified.<br /> <br /> If you did not create this account, simply ignore this email.<br /> <br /> Thank you for joining us.<br /> <br /> - Coins Share Team", map.username, txtPass.Text)); lblError.Text = "Account created. Login anytime."; } else { lblError.Text = "Passwords do not match. Please try again."; } }
public dynamic cookieStatus(HttpCookie cookie) { RepoMapConnect RMC = new RepoMapConnect(databaseTable.Sessions); if (cookie != null) { RMC.map.sessionVal = cookie.Value; RMC.map = RMC.repo.selectData(RMC.map); if (RMC.map.expiration > DateTime.Now) { RepoMapConnect RMCaccount = new RepoMapConnect(databaseTable.PrimaryAccount); RMCaccount.map.id = RMC.map.uid; RMCaccount.map = RMCaccount.repo.selectData(RMCaccount.map); return(RMCaccount); } else { return(false); } } else { return(false); } }
public string updateBuilder(dynamic map, databaseTable table) { string[][] tableFormat = gfunc.processTableFunction(table, tableFunction.tableFormatChoose); RepoMapConnect RMP = new RepoMapConnect(table); string updateList = string.Join(",", RMP.repo.paramList(map)); return(string.Format("UPDATE {0} SET {1} WHERE id=@Id;", tableFormat[0][0], updateList.Replace("id=@Id,", "").Replace("*,", ""))); }
protected void btnFillCoinsList_onclick(object sender, EventArgs e) { RepoMapConnect RMC = new RepoMapConnect(databaseTable.TotalCoins); for (decimal i = 1000.000m; i < 1000.001m; i += 0.001m) { RMC.map.totalCoinString = RMC.func.randomCharacterSet(30); RMC.map.amount = i; RMC.repo.executeData(RMC.map, sqlStatementType.Insert); } }
public CoinOrderMap cheapestCoin(orderType order) { RepoMapConnect RMC = new RepoMapConnect(databaseTable.CoinOrder); RMC.map.OT = order; SqlCommand command = new SqlCommand(string.Format("select * from coinOrder WHERE OT = {0} ORDER BY perCoin ASC LIMIT 1;", func.orderTypeEnumToString(RMC.map.OT))); RMC.map = RMC.repo.sqlFunc.selectData(command, databaseTable.CoinOrder); return(RMC.map); }
public decimal getValueByCoinString(string coinString) { if (coinString != "") { RepoMapConnect RMC = new RepoMapConnect(databaseTable.TotalCoins); RMC.map.totalCoinString = coinString; RMC.map = RMC.repo.selectData(RMC.map); return(RMC.map.amount); } else { return(0.000m); } }
public decimal getValueByBankValue(string bankVal) { if (bankVal != "") { RepoMapConnect RMC = new RepoMapConnect(databaseTable.CoinBank); RMC.map.coinBankVal = bankVal; RMC.map = RMC.repo.selectData(RMC.map); return(getValueByCoinString(RMC.map.totalCoinString)); } else { return(0.000m); } }
protected void Page_Load(object sender, EventArgs e) { functionality func = new functionality(); HttpCookie cookie = new HttpCookie("SessionCookie"); cookie = Request.Cookies["SessionCookie"]; if (cookie != null) { RepoMapConnect RMC = new RepoMapConnect(databaseTable.Sessions); RMC.map.sessionVal = cookie.Value.ToString(); RMC.repo.executeData(RMC.map, sqlStatementType.Delete); cookie.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Add(cookie); } Response.Redirect("../Default.aspx"); }
protected void btnLogin_onclick(object sender, EventArgs e) { RepoMapConnect RMCaccount = new RepoMapConnect(databaseTable.PrimaryAccount); PrimaryAccountMap PAM = new PrimaryAccountMap(); PAM.username = txtUsername.Text; RMCaccount.map = RMCaccount.repo.selectData(PAM); if (RMCaccount.map.password == RMCaccount.func.hashedValue(txtPassword.Text + RMCaccount.map.salt)) { SessionsMap map = new SessionsMap(RMCaccount.map.id); SessionsRepository repo = new SessionsRepository(); repo.executeData(map, sqlStatementType.Insert); HttpCookie cookie = RMCaccount.func.createcookie(map.sessionVal, "SessionCookie"); Response.Cookies.Add(cookie); Response.Redirect("Account/view.aspx"); } }
private void addAccounts(coinType CT, RepoMapConnect primaryAccount) { RepoMapConnect coinBank = new RepoMapConnect(databaseTable.CoinBank); if (CT == coinType.Bitcoin) { primaryAccount.map.coinBankVal1 = func.randomCharacterSet(20); coinBank.map.coinBankVal = primaryAccount.map.coinBankVal1; } else if (CT == coinType.Litecoin) { primaryAccount.map.coinBankVal2 = func.randomCharacterSet(20); coinBank.map.coinBankVal = primaryAccount.map.coinBankVal2; } primaryAccount.repo.executeData(primaryAccount.map, sqlStatementType.Update); coinBank.map.CT = CT; coinBank.map.totalCoinString = "2NgR99HxbtgzdA7kweJzQ6TZdsshYf"; coinBank.repo.executeData(coinBank.map, sqlStatementType.Insert); btnLitecoinBank.Enabled = false; }