示例#1
0
        public async Task <IActionResult> AccountSubHeads(AccountSubHeadViewModel model)
        {
            if (!ModelState.IsValid)
            {
                ViewData["AccountHead"] = new SelectList(new[] { "ASSET", "LIABILITY", "INCOME", "EXPENSE" });
                return(View(model));
            }

            //If here, then its a new account sub head
            Result = await _setupService.CreateAccountSubHeadAsync(model);

            if (Result)
            {
                StatusMessage = _config.GetSection("Messages")["Success"];
                return(RedirectToAction(nameof(AccountSubHeads)));
            }

            StatusMessage = "Error: Unable to create account sub head";
            return(View(model));
        }