public virtual ActionResult Complex(string urlName) { ComplexService.LoadWith(b => b.Load(x => x.BranchOffice, x => x.Admin).And <BranchOffice>(x => x.City)); var complex = ComplexService.GetAll().ByUrlName(urlName); if (complex == null) { return(null); } if (complex.Complex_TC == Cities.Complexes.Partners) { return(Redirect(SimplePages.FullUrls.Partners)); } if (!complex.IsPublished) { return(RedirectToAction(() => City(complex.BranchOffice.City.UrlName))); } var responses = ResponseService.GetAll() .IsActive().Where(x => x.Complex_TC == complex.Complex_TC) .OrderByDescending(x => x.UpdateDate).ToList(); var otherComplexes = ComplexService.GetAll(x => x.IsPublished && x.UrlName != urlName).ToList(); var model = new ComplexVM { Complex = complex, OtherComplexes = otherComplexes, Responses = responses, NearestGroupSet = GroupService.GetNearestGroups(complex), GeoLocation = Cities.Complexes.GeoLocations.GetValueOrDefault(complex.Complex_TC) }; return(MView(Views.Locations.Complex, model)); }
private void Window_Loaded(object sender, RoutedEventArgs e) { var complexVM = new ComplexVM(); this.DataContext = null; this.DataContext = complexVM; }
public List <string> GetBreadCrumbs(ComplexVM model) { var breadcrumb = GetBreadCrumbs(new CityVM { City = model.Complex.BranchOffice.City }); AddLink(breadcrumb, model.Complex.BranchOffice.City); return(breadcrumb); }