Esempio n. 1
0
        public async Task <IActionResult> Edit(long id, string returnUrl)
        {
            var branch = await _branchesDao.GetByIdAsync(id);

            return(View(
                       new EditViewModel
            {
                Id = branch.Id,
                EditorMode = EditorMode.Update,
                Name = branch.Name,
                Address = branch.Address,
                ReturnUrl = returnUrl
            }));
        }
Esempio n. 2
0
        private async Task <bool> CacheBranchAsync(long branchId = default(long))
        {
            if (branchId == default(long))
            {
                var session = _httpContextAccessor.HttpContext.Session;
                branchId = session.GetJson <long>(BranchIdJsonKey);
                if (branchId == default(long))
                {
                    return(false);
                }
            }

            _cachedBranch = await _branchesDao.GetByIdAsync(branchId);

            return(_cachedBranch != null);
        }