Example #1
0
        public void LookUps()
        {
            var userRegionID = _userAccountService.GetUserInfo(HttpContext.User.Identity.Name).RegionID;
            var regions      = _commonService.GetRegions();

            if (userRegionID != null)
            {
                regions = _commonService.FindBy(m => m.AdminUnitID == userRegionID);
            }

            var lossReasons = _lossReasonService.GetAllLossReason().Select(t => new
            {
                name =
                    t.LossReasonCodeEg + "-" +
                    t.LossReasonEg,
                Id = t.LossReasonId
            });

            ViewData["LossReasons"] = lossReasons;

            ViewBag.Region    = new SelectList(regions, "AdminUnitID", "Name", "--Select Region--");
            ViewBag.Zone      = new SelectList(_commonService.FindBy(m => m.AdminUnitTypeID == 3 && m.ParentID == 3), "AdminUnitID", "Name");
            ViewBag.Woreda    = new SelectList(_commonService.FindBy(m => m.AdminUnitTypeID == 4 && m.ParentID == 19), "AdminUnitID", "Name");
            ViewBag.ProgramID = new SelectList(_commonService.GetPrograms(), "ProgramID", "Name");
            //ViewBag.Month = new SelectList(RequestHelper.GetMonthList(), "Id", "Name");
            ViewBag.SupportTypeID = new SelectList(_commonService.GetAllSupportType(), "SupportTypeID", "Description");
        }
Example #2
0
 public void LookUps()
 {
     ViewBag.Region    = new SelectList(_commonService.GetAminUnits(m => m.AdminUnitTypeID == 2), "AdminUnitID", "Name", "--Select Region--");
     ViewBag.Zone      = new SelectList(_commonService.FindBy(m => m.AdminUnitTypeID == 3 && m.ParentID == 3), "AdminUnitID", "Name");
     ViewBag.Woreda    = new SelectList(_commonService.FindBy(m => m.AdminUnitTypeID == 4 && m.ParentID == 19), "AdminUnitID", "Name");
     ViewBag.ProgramID = new SelectList(_commonService.GetPrograms(), "ProgramID", "Name");
     //ViewBag.Month = new SelectList(RequestHelper.GetMonthList(), "Id", "Name");
     ViewBag.SupportTypeID = new SelectList(_commonService.GetAllSupportType(), "SupportTypeID", "Description");
 }