Esempio n. 1
0
        public ActionResult UnseenUpdate(string manualcashflow, [FromBody] JsonElement json)
        {
            string          authHeader = this.HttpContext.Request.Headers["Authorization"];
            TokenModel      tokenModel = new TokenModel();
            ClaimsPrincipal auth       = tokenModel.GetPrincipal(authHeader);

            if (auth.Identity.IsAuthenticated)
            {
                new ClickTracker("UnseenUpdate", false, true, json.GetRawText(), auth.Identity.Name);
                AutomatedCashFlow automatedCashFlow = JsonConvert.DeserializeObject <AutomatedCashFlow>(json.GetRawText());
                ReturnModel       returnModel       = automatedCashFlow.UpdateAutomated(manualcashflow);
                return(Ok(returnModel));
            }
            return(Ok(""));
        }
Esempio n. 2
0
        public ActionResult AddAccount([FromBody] JsonElement json)
        {
            string          authHeader = this.HttpContext.Request.Headers["Authorization"];
            TokenModel      tokenModel = new TokenModel();
            ClaimsPrincipal auth       = tokenModel.GetPrincipal(authHeader);

            if (auth.Identity.IsAuthenticated)
            {
                new ClickTracker("AddAccount", false, true, json.GetRawText(), auth.Identity.Name);
                Account     account     = JsonConvert.DeserializeObject <Account>(json.GetRawText());
                ReturnModel returnModel = account.AddAccount(account);
                return(Ok(returnModel));
            }
            return(Ok(""));
            //[Route("BudgetEdit")]
            //[HttpGet]
            //public ActionResult BudgetEdit(string collectionsId, DateTime date)
            //{
            //    return Ok();
            //}
        }