// // GET: /FDP/Create public virtual ActionResult Create(int?woredaId) { var adminUnit = _adminUnitService.Get(t => t.AdminUnitID == woredaId, null, "AdminUnit2,AdminUnit2.AdminUnit2").FirstOrDefault(); var adminUnitModel = new AdminUnitModel(); if (adminUnit != null) { if (adminUnit.AdminUnit2.ParentID != null) { adminUnitModel = new AdminUnitModel { SelectedWoredaId = adminUnit.AdminUnitID, SelectedZoneId = adminUnit.AdminUnit2.AdminUnitID, SelectedRegionId = (int)adminUnit.AdminUnit2.ParentID, SelectedWoredaName = adminUnit.Name, SelectedZoneName = adminUnit.AdminUnit2.Name, SelectedRegionName = adminUnit.AdminUnit2.AdminUnit2.Name } } ; } return(PartialView(adminUnitModel)); }