public static void InitializeSimple(Majorsilence.Vpn.Poco.SiteInfo info, decimal currentMonthlyRate, decimal currentYearlyRate) { SiteInfo.info = info; SiteInfo.CurrentMonthlyRate = currentMonthlyRate; SiteInfo.CurrentMonthlyRateInCents = (int)currentMonthlyRate * 100; SiteInfo.CurrentYearlyRate = currentYearlyRate; }
public void Setup() { using (var cn = Majorsilence.Vpn.Logic.InitializeSettings.DbFactory) { cn.Open(); sinfo = cn.Query <Majorsilence.Vpn.Poco.SiteInfo>("SELECT * FROM SiteInfo").First(); prates = cn.Query <Majorsilence.Vpn.Poco.PaymentRates>("SELECT * FROM PaymentRates").First(); } }
public static void Initialize(Majorsilence.Vpn.Poco.SiteInfo info, int monthlyPaymentId, decimal currentMonthlyRate, decimal currentYearlyRate, int yearlyPaymentId) { SiteInfo.info = info; SiteInfo.MonthlyPaymentId = monthlyPaymentId; SiteInfo.CurrentMonthlyRate = currentMonthlyRate; SiteInfo.CurrentMonthlyRateInCents = (int)currentMonthlyRate * 100; SiteInfo.CurrentYearlyRate = currentYearlyRate; SiteInfo.YearlyPaymentId = yearlyPaymentId; }
public void SaveSiteInfo(int siteid, string adminemail, string livesite, string sitename, string siteurl, int sshport, string vpnsshuser, string vpnsshpassword, string stripeapipublickey, string stripeapisecretkey, string currency, string stripeplanid, decimal monthlypaymentrate, decimal yearlypaymentrate) { if (sessionInstance.LoggedIn == false || sessionInstance.IsAdmin == false) { return; } try { bool islivesite = false; if (livesite == "on") { // means no beta key required islivesite = true; } var info = new Majorsilence.Vpn.Poco.SiteInfo() { Id = siteid, AdminEmail = adminemail, LiveSite = islivesite, SiteName = sitename, SiteUrl = siteurl, SshPort = sshport, StripeAPISecretKey = stripeapisecretkey, StripeAPIPublicKey = stripeapipublickey, VpnSshPassword = vpnsshpassword, VpnSshUser = vpnsshuser, StripePlanId = stripeplanid, Currency = currency }; Majorsilence.Vpn.Logic.Helpers.SiteInfo.InitializeSimple(info, monthlypaymentrate, yearlypaymentrate); Majorsilence.Vpn.Logic.Helpers.SiteInfo.SaveCurrentSettingsToDb(); Response.Redirect("/admin/siteinfo?status=ok", false); } catch (Exception ex) { Majorsilence.Vpn.Logic.Helpers.Logging.Log(ex); Response.Redirect("/admin/siteinfo?status=" + HttpUtility.HtmlEncode(ex.Message), false); } }