Browse Source

ad fixes

master
miladkdz 10 years ago
parent
commit
46441ec8ce
3 changed files with 8 additions and 1 deletions
  1. +1
    -0
      Sevomin.WebFrontend.Controllers/HomeController.cs
  2. +6
    -0
      Sevomin.WebFrontend/App_Start/RouteConfig.cs
  3. +1
    -1
      Sevomin.WebFrontend/Views/Job/JobList.cshtml

+ 1
- 0
Sevomin.WebFrontend.Controllers/HomeController.cs View File

@ -45,6 +45,7 @@ namespace Sevomin.WebFrontend.Controllers
return HttpNotFound(); return HttpNotFound();
} }
ad.ClickCount++; ad.ClickCount++;
_adRepository.Save();
return Redirect(ad.Link); return Redirect(ad.Link);
} }
} }

+ 6
- 0
Sevomin.WebFrontend/App_Start/RouteConfig.cs View File

@ -15,6 +15,12 @@ namespace Sevomin.WebFrontend
defaults: new { controller = "Base", action = "Error404" } defaults: new { controller = "Base", action = "Error404" }
); );
routes.MapRoute(
name: "Ads",
url: "ad/{id}",
defaults: new { controller = "Home", action = "Ads" }
);
#region For Help #region For Help
routes.MapRoute( routes.MapRoute(


+ 1
- 1
Sevomin.WebFrontend/Views/Job/JobList.cshtml View File

@ -18,7 +18,7 @@
<p class="rtl"> <p class="rtl">
@ad.Description @ad.Description
</p> </p>
<a href="@Url.Action("Ads", "Home", new {id = ad.Id})" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-link"></span> مشاهده سایت </a>
<a target="_blank" href="@Url.Action("Ads", "Home", new {id = ad.Id})" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-link"></span> مشاهده سایت </a>
</div> </div>
</div> </div>
} }


Loading…
Cancel
Save