Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @helper RenderContinents(IEnumerable<ISFSchoolCup.Domain.POCO.Continent> continents)
- {
- <ul>
- @foreach (ISFSchoolCup.Domain.POCO.Continent c in continents)
- {
- <li>@c.Name</li>
- }
- </ul>
- }
- @helper RenderCountries(IEnumerable<ISFSchoolCup.Domain.POCO.Country> countries)
- {
- <ul>
- @foreach (ISFSchoolCup.Domain.POCO.Country c in countries)
- {
- <li>@c.Name</li>
- }
- </ul>
- }
- @Html.Grid(Model.ads).Columns(columns =>
- {
- columns.Add().Encoded(false).Sanitized(false).SetWidth(30).RenderValueAs(ad => @<input class="btn" type="button" value="Edit" onclick="location.href='@Url.Action("Edit", "Ad", new { id = ad.AdId }) '" />);
- columns.Add().Encoded(false).Sanitized(false).SetWidth(30).RenderValueAs(ad => @<input class="btn" type="button" value="Details" onclick="location.href='@Url.Action("Details", "Ad", new { id = ad.AdId }) '" />);
- columns.Add().Encoded(false).Sanitized(false).SetWidth(30).RenderValueAs(ad => @<input class="btn" type="button" value="Delete" onclick="location.href='@Url.Action("Delete", "Ad", new { id = ad.AdId }) '" />);
- columns.Add(ad => ad.Name).Filterable(true).Sortable(true);
- columns.Add(ad => ad.Sport).Filterable(true).Sortable(true);
- columns.Add(ad => ad.StartDate).Format("{0:d}").Filterable(true).Sortable(true);
- columns.Add(ad => ad.EndDate).Format("{0:d}").Filterable(true).Sortable(true);
- columns.Add().Encoded(false).Sanitized(false).RenderValueAs(ad => @<div class="hovergallery">
- <img class="thumb" src="~/Content/images/ads/@ad.Photo" height="50" width="500" alt="@ad.Photo"/>
- </div>).Titled("Photo").SetWidth(200);
- columns.Add(ad => ad.Company).Filterable(true).Sortable(true);
- columns.Add(ad => ad.Continents).Encoded(false).Sanitized(false).RenderValueAs(ad => RenderContinents(ad.Continents)).Filterable(true).Titled("Continent(s)");
- columns.Add(ad => ad.Countries).Encoded(false).Sanitized(false).RenderValueAs(ad => RenderCountries(ad.Countries)).Filterable(true).Titled("Countries");
- }).WithPaging(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement