/// <summary> /// Action to get localisation description /// </summary> /// <param name="id">Id of the localisation</param> /// <returns>Redirect to returnUrl</returns> public virtual PartialViewResult LocalisationDescription(int id) { var context = ModelFactory.GetUnitOfWork(); var lRepo = ModelFactory.GetRepository<ILocalisationRepository>(context); var localisation = lRepo.Get(id); if (localisation == null) return null; var model = new SearchSingleResultViewModel { Localisation = localisation, Index = -1 }; return PartialView(MVC.Mobile.Localisation.Views._SearchResultSummary, model); }
/// <summary> /// Action to get localisation detail /// </summary> /// <param name="id">Id of the localisation</param> /// <returns>Localisation Detail</returns> public virtual ActionResult LocalisationDetail(int id) { var context = ModelFactory.GetUnitOfWork(); var lRepo = ModelFactory.GetRepository<ILocalisationRepository>(context); var localisation = lRepo.Get(id); if (localisation == null) return null; var model = new SearchSingleResultViewModel { Localisation = localisation }; return View(MVC.Mobile.Localisation.Views.FullSearchResultDetail, model); }
public virtual ActionResult Details(int id, string name) { var context = ModelFactory.GetUnitOfWork(); var lRepo = ModelFactory.GetRepository<ILocalisationRepository>(context); var localisation = lRepo.Get(id); if (localisation == null || string.IsNullOrEmpty(name) /*|| string.Compare(MiscHelpers.GetSeoString(localisation.Name), name, true) != 0*/) { TempData[MiscHelpers.TempDataConstants.Info] = Worki.Resources.Views.Localisation.LocalisationString.WorkplaceNotFound; return RedirectToAction(MVC.Home.Index()); } else { var container = new SearchSingleResultViewModel { Localisation = localisation }; if (localisation.IsOffline) { ModelState.AddModelError("", Worki.Resources.Views.Localisation.LocalisationString.PlaceNotAvailable); } return View(MVC.Localisation.Views.FullSearchResultDetail, container); } }