private PartialViewResult ViewEditBasics(EditBasicsViewModel viewModel)
        {
            var adminFeature = new FirmaAdminFeature();
            var viewData     = new EditBasicsViewData(CurrentFirmaSession);

            return(RazorPartialView <EditBasics, EditBasicsViewData, EditBasicsViewModel>(viewData, viewModel));
        }
Exemplo n.º 2
0
        private PartialViewResult ViewEditBasics(EditBasicsViewModel viewModel)
        {
            var adminFeature             = new FirmaAdminFeature();
            var tenantPeople             = HttpRequestStorage.DatabaseEntities.People.ToList().Where(x => adminFeature.HasPermissionByPerson(x)).ToSelectListWithEmptyFirstRow(x => x.PersonID.ToString(CultureInfo.InvariantCulture), x => x.GetFullNameFirstLast());
            var taxonomyLevels           = TaxonomyLevel.All.ToSelectListWithEmptyFirstRow(x => x.TaxonomyLevelID.ToString(CultureInfo.InvariantCulture), x => x.TaxonomyLevelDisplayName);
            var budgetTypeID             = viewModel.BudgetTypeID;
            var budgetTypes              = BudgetType.All.ToDictionary(x => x.BudgetTypeID, x => x.BudgetTypeDisplayName);
            var disabledBudgetTypeValues = new List <int>()
            {
                BudgetType.NoBudget.BudgetTypeID, BudgetType.AnnualBudget.BudgetTypeID
            };
            var costTypes = HttpRequestStorage.DatabaseEntities.CostTypes.Select(x => x.CostTypeName).ToList();
            // if any projects exist that are not ProjectType.Normal we do not want them to be able to turn off Enable Project Type checkbox
            bool canEditEnableProjectTypeCheckbox = !HttpRequestStorage.DatabaseEntities.Projects.Any(x => x.ProjectCategoryID != (int)ProjectCategoryEnum.Normal);
            var  viewData = new EditBasicsViewData(CurrentFirmaSession, tenantPeople, taxonomyLevels, budgetTypeID, budgetTypes, disabledBudgetTypeValues, costTypes, canEditEnableProjectTypeCheckbox);

            return(RazorPartialView <EditBasics, EditBasicsViewData, EditBasicsViewModel>(viewData, viewModel));
        }
        private PartialViewResult ViewEditBasics(OnlandVisualTrashAssessmentArea onlandVisualTrashAssessmentArea, EditBasicsViewModel viewModel)
        {
            var viewData = new EditBasicsViewData(CurrentPerson, onlandVisualTrashAssessmentArea);

            return(RazorPartialView <EditBasics, EditBasicsViewData, EditBasicsViewModel>(viewData, viewModel));
        }