Esempio n. 1
0
        public IActionResult CreateAccount(Account input)
        {
            var apiUrl = "api/Customer/Create";

            var account = new Account()
            {
                name                     = input.name,
                revenue                  = input.revenue,
                description              = input.description,
                address1_telephone1      = input.address1_telephone1,
                address1_stateorprovince = input.address1_stateorprovince,
                accountcategorycode      = input.accountcategorycode,
                customertypecode         = input.customertypecode
            };

            var status = CrmServerHandlers.HttpPostToServer(apiUrl, JsonConvert.SerializeObject(account));

            var result = string.Empty;

            if (status == 200 || status == 204)
            {
                result = "Action completed";
            }
            return(RedirectToAction(nameof(Accounts)));
        }
Esempio n. 2
0
        public IActionResult Accounts()
        {
            var apiUrl = "api/Customer/GetAll";

            var accounts = CrmServerHandlers.HttpGetAll(apiUrl);

            return(View(accounts));
        }
Esempio n. 3
0
        public IActionResult SignIn()
        {
            CrmServerHandlers.HttpGetFromServer("api/Client");
            var token = BaseRequest.AccessToken;

            var redirectUrl = Url.Action(nameof(HomeController.Index), "Home");

            return(Challenge(
                       new AuthenticationProperties {
                RedirectUri = redirectUrl
            },
                       OpenIdConnectDefaults.AuthenticationScheme));
        }