示例#1
0
        public ActionResult CreateNeedAssessment()
        {
            ViewBag.Regions    = new SelectList(_adminUnitService.FindBy(t => t.AdminUnitTypeID == 2), "AdminUnitID", "Name");
            ViewBag.Season     = new SelectList(_seasonService.GetAllSeason(), "SeasonID", "Name");
            ViewBag.TypeOfNeed = new SelectList(_typeOfNeedAssessmentService.GetAllTypeOfNeedAssessment(), "TypeOfNeedAssessmentID", "TypeOfNeedAssessment1");
            ViewBag.PlanID     = new SelectList(_planService.GetAllPlan(), "PlanID", "PlanName");
            var needAssessement = new NeedAssessment();

            return(View(needAssessement));
        }
示例#2
0
        public ActionResult CreateNeedAssessment()
        {
            var userRegionID = _userAccountService.GetUserInfo(HttpContext.User.Identity.Name).RegionID;

            if (userRegionID != null)
            {
                ViewBag.Regions = new SelectList(_adminUnitService.FindBy(t => t.AdminUnitID == userRegionID), "AdminUnitID", "Name");
            }
            else
            {
                ViewBag.Regions = new SelectList(_adminUnitService.FindBy(t => t.AdminUnitTypeID == 2), "AdminUnitID", "Name");
            }
            ViewBag.Season     = new SelectList(_seasonService.GetAllSeason(), "SeasonID", "Name");
            ViewBag.TypeOfNeed = new SelectList(_typeOfNeedAssessmentService.GetAllTypeOfNeedAssessment(), "TypeOfNeedAssessmentID", "TypeOfNeedAssessment1");
            ViewBag.PlanID     = new SelectList(_planService.GetAllPlan(), "PlanID", "PlanName");
            var needAssessement = new NeedAssessment();

            return(View(needAssessement));
        }