Пример #1
0
        public ActionResult Index([DataSourceRequest(Prefix = "Grid")] DataSourceRequest dsRequest, int CaseId)
        {
            if (!ViewBag.HasAccessToCaseManagementModule)
            {
                WebHelper.CurrentSession.Content.ErrorMessage = "You are not eligible to do this action";
                return(RedirectToAction(Constants.Actions.AccessDenied, Constants.Controllers.Home, new { Area = String.Empty }));
            }

            CaseStatusHistory varCase = new CaseStatusHistory();

            varCase.CaseID = CaseId;
            varCase.CaseHouseholdIncome = new CaseHouseholdIncome();
            varCase.CaseHouseholdIncome.IncomeRanges = incomeRangeRepository.GetAll().ToList();
            varCase.CaseWorkerNote = new CaseWorkerNote();

            //DataSourceResult result = caseStatusHistoryRepository.CaseStatusByCaseID(CaseId).AsEnumerable().ToDataSourceResult(dsRequest);

            string status = caseStatusHistoryRepository.CaseStatusByCaseID(CaseId);

            int statusId = caseStatusHistoryRepository.CaseStatusIDByCaseID(CaseId);

            varCase.CaseStatus = status;

            varCase.CurrentStatusID = statusId;

            return(View(varCase));
        }
Пример #2
0
        public ActionResult Index([DataSourceRequest(Prefix = "Grid")] DataSourceRequest dsRequest, Case searchCase, int caseID)
        {
            var  varCase   = caseRepository.Find(caseID);
            bool hasAccess = workerroleactionpermissionnewRepository.HasPermission(caseID, CurrentLoggedInWorkerRoleIDs, CurrentLoggedInWorker.ID, varCase.ProgramID, varCase.RegionID, varCase.SubProgramID, varCase.JamatkhanaID, Constants.Areas.CaseManagement, Constants.Controllers.CaseMember, Constants.Actions.Index, true);

            if (!hasAccess)
            {
                WebHelper.CurrentSession.Content.ErrorMessage = "You are not eligible to do this action";
                return(RedirectToAction(Constants.Actions.AccessDenied, Constants.Controllers.Home, new { Area = String.Empty }));
            }

            CaseSummaryVM caseSummary = _casesummaryrepository.GetCaseDetails(caseID);

            caseSummary.caseMember               = new CaseMember();
            caseSummary.caseMember.CaseID        = caseID;
            caseSummary.CurrentHouseholdIncomeID = 0;

            caseSummary.CaseInitialHouseholdIncomeVM = caseHouseholdIncomeRepository.GetInitialIncomeForCaseSummary(caseID);
            caseSummary.CaseCurrentHouseholdIncomeVM = caseHouseholdIncomeRepository.GetCurrentIncomeForCaseSummary(caseID);

            if (caseSummary.CaseCurrentHouseholdIncomeVM == null && caseSummary.CaseInitialHouseholdIncomeVM != null)
            {
                caseSummary.CaseCurrentHouseholdIncomeVM = caseSummary.CaseInitialHouseholdIncomeVM;
            }

            if (caseSummary.CaseCurrentHouseholdIncomeVM != null)
            {
                caseSummary.CurrentHouseholdIncomeID = caseSummary.CaseCurrentHouseholdIncomeVM.ID;
            }

            caseSummary.AssesmentIndicators   = caseInitialAssessmentRepository.GetAllIndicators();
            caseSummary.CaseInitialAssessment = caseInitialAssessmentRepository.GetCaseAssessment(caseID);

            string status = caseStatusHistoryRepository.CaseStatusByCaseID(caseID);

            caseSummary.CaseStatus = status;

            caseSummary.caseGoalNewVM = new CaseGoalNewVM();
            int TotalGoal = caseGoalNewRepository.CaseGoalNewCountByCaseID(caseID);

            caseSummary.caseGoalNewVM.TotalGoal = TotalGoal;

            int GoalCompleted = caseGoalNewRepository.CaseGoalNewCompleteByCaseID(caseID);

            caseSummary.caseGoalNewVM.GoalCompleted = GoalCompleted;

            return(View(caseSummary));
        }