Example #1
0
        public ActionResult Index()
        {
            return(base.ExecuteFunction("Index", delegate()
            {
                StencilAPI API = this.IFoundation.Resolve <StencilAPI>();

                string result = string.Empty;
                try
                {
                    var directResult = API.Direct.GlobalSettings.GetByName("anything");
                }
                catch (Exception)
                {
                    result += "DIRECT-FAIL ";
                }
                try
                {
                    var cacheResult = API.Index.Accounts.GetById(Guid.Empty);
                }
                catch (Exception)
                {
                    result += "INDEX-FAIL ";
                }
                if (string.IsNullOrEmpty(result))
                {
                    result = "PONG";
                }
                ViewBag.Result = result;
                return View();
            }));
        }
Example #2
0
        public ActionResult Index()
        {
            return(base.ExecuteFunction("Index", delegate()
            {
                StencilAPI API = this.IFoundation.Resolve <StencilAPI>();

                string result = string.Empty;
                try
                {
                    Guid newAccountID = new Guid("{0AB9F424-DF92-4678-8AB7-68F186E1C497}");// hard code for super safety (fkey)
                    Account newAccount = new Account()
                    {
                        account_id = newAccountID,
                        first_name = "William",
                        last_name = "Mansfield",
                        email = "*****@*****.**",
                        password = "******",
                        entitlements = "super_admin",
                    };
                    Account initialAccount = API.Direct.Accounts.CreateInitialAccount(newAccount);
                    if (initialAccount != null)
                    {
                        result = "Created new user";
                    }
                    else
                    {
                        result = "Pong";
                    }
                }
                catch (Exception ex)
                {
                    result = ex.Message;
                }

                ViewBag.Result = result;
                return View();
            }));
        }