public JsonResult OnGetSubCategories(Guid headAccount, Guid parentId, int CLI)
        {
            List <COA_AccountSubCategory_Dto> result = new List <COA_AccountSubCategory_Dto>();

            result = _subCategoryAppService.GetSubCategories(headAccount, CLI, parentId);

            return(new JsonResult(result));
        }
Beispiel #2
0
        public JsonResult OnGetSubCategoriesAndStatementType(Guid headAccount, string headAccountName, Guid parentId, int CLR)
        {
            (List <COA_AccountSubCategory_Dto> result, Guid statementTypeId)result = (new List <COA_AccountSubCategory_Dto>(), Guid.Empty);
            result.result = _subCategoryAppService.GetSubCategories(headAccount, CLR, parentId);

            if (headAccountName == "Assets" || headAccountName == "Liabilities" || headAccountName == "Capital")
            {
                result.statementTypeId = _accStatementTypeRepo.First(x => x.Title == "Balance Sheet").Id;
            }
            else
            {
                result.statementTypeId = _accStatementTypeRepo.First(x => x.Title == "Profit & Loss").Id;
            }

            return(new JsonResult(result));
        }