Browse Source

job list started

confirmation-email
Milad Karbasizadeh 11 years ago
parent
commit
8ac18f510e
7 changed files with 80 additions and 7 deletions
  1. +25
    -3
      Sevomin.WebFrontend.Controllers/HomeController.cs
  2. +11
    -0
      Sevomin.WebFrontend.Controllers/JobController.cs
  3. +3
    -1
      Sevomin.WebFrontend/Sevomin.WebFrontend.csproj
  4. +13
    -0
      Sevomin.WebFrontend/Views/Home/AvalinIndex.cshtml
  5. +8
    -0
      Sevomin.WebFrontend/Views/Home/DovominIndex.cshtml
  6. +17
    -0
      Sevomin.WebFrontend/Views/Job/JobList.cshtml
  7. +3
    -3
      Sevomin.WebFrontend/Views/Shared/Navbar.cshtml

+ 25
- 3
Sevomin.WebFrontend.Controllers/HomeController.cs View File

@ -1,15 +1,37 @@
using System.Web.Mvc;
using Microsoft.AspNet.Identity.EntityFramework;
using Sevomin.Models;
using Sevomin.Models.Helpers;
using System.Threading.Tasks;
using System.Web.Mvc;
namespace Sevomin.WebFrontend.Controllers namespace Sevomin.WebFrontend.Controllers
{ {
public class HomeController : BaseController public class HomeController : BaseController
{ {
public ActionResult Index()
public HomeController()
: this(new SevominUserManager(new UserStore<User>(SevominDbContext.Current)))
{
}
public HomeController(SevominUserManager userManager)
{
UserManager = userManager;
}
public SevominUserManager UserManager { get; private set; }
public async Task<ActionResult> Index()
{ {
if (!Request.IsAuthenticated) if (!Request.IsAuthenticated)
return View("Intro"); return View("Intro");
else else
return View("Intro");
{
User user = await UserManager.FindByNameAsync(User.Identity.Name);
if(user is Avalin)
return View("AvalinIndex");
else
return View("DovominIndex");
}
} }
} }

+ 11
- 0
Sevomin.WebFrontend.Controllers/JobController.cs View File

@ -117,6 +117,17 @@ namespace Sevomin.WebFrontend.Controllers
} }
return Content("boogh: " + job.Id.ToString()); return Content("boogh: " + job.Id.ToString());
} }
public PartialViewResult LatestJobList(int count)
{
return PartialView("JobList", JobRepository.Current.ListAll()
.Where(d => d.ExpireDate > DateTime.Now)
.OrderByDescending(d => d.CreateDate)
.Take(count)
.ToList()
.Select(j => new JobMiniViewModel(j)).ToList());
}
private static void UpdateFields(string JalaliExpireDate, string ContactPersonName, string ContactPersonPhone, string ContactPersonEMail, bool IsFullTime, bool ShowCompanyName, string Description, bool ShowCompanyLogo, FormCollection form, Job job) private static void UpdateFields(string JalaliExpireDate, string ContactPersonName, string ContactPersonPhone, string ContactPersonEMail, bool IsFullTime, bool ShowCompanyName, string Description, bool ShowCompanyLogo, FormCollection form, Job job)
{ {


+ 3
- 1
Sevomin.WebFrontend/Sevomin.WebFrontend.csproj View File

@ -256,6 +256,9 @@
<Content Include="Views\Shared\DovominParameterViewModel.cshtml" /> <Content Include="Views\Shared\DovominParameterViewModel.cshtml" />
<Content Include="Views\Job\Edit.cshtml" /> <Content Include="Views\Job\Edit.cshtml" />
<Content Include="Views\Shared\PostResult.cshtml" /> <Content Include="Views\Shared\PostResult.cshtml" />
<Content Include="Views\Home\DovominIndex.cshtml" />
<Content Include="Views\Home\AvalinIndex.cshtml" />
<Content Include="Views\Job\JobList.cshtml" />
<None Include="Web.Debug.config"> <None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon> <DependentUpon>Web.config</DependentUpon>
</None> </None>
@ -275,7 +278,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="App_Data\resumes\" /> <Folder Include="App_Data\resumes\" />
<Folder Include="Views\Home\" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>


+ 13
- 0
Sevomin.WebFrontend/Views/Home/AvalinIndex.cshtml View File

@ -0,0 +1,13 @@
@{
ViewBag.Title = "خانه";
}
<nav>
<div class="btn-toolbar">
<div class="btn-group">
<a href="@Url.Action("NewJob", "Job")" class="btn btn-default">انتشار آگهی</a>
<a href="#" class="btn btn-default">آگهی های شما</a>
<a href="#" class="btn btn-default">وضعیت آگهی های جاری</a>
</div>
</div>
</nav>

+ 8
- 0
Sevomin.WebFrontend/Views/Home/DovominIndex.cshtml View File

@ -0,0 +1,8 @@
@{
ViewBag.Title = "خانه";
}
<section>
<div class="row">
@Html.Action("LatestJobList", "Job", new { count = 15 })
</div>
</section>

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

@ -0,0 +1,17 @@
@model IList<Sevomin.Models.JobMiniViewModel>
<div class="col-md-12">
@foreach (var job in Model)
{
<div class="panel panel-default">
<div class="panel-body">
<p class="rtl"> کارشناس برنامه ریزی و کنترل پروژه
@foreach (var param in job.Parameters)
{
@MvcHtmlString.Create(string.Format(param.Item1, param.Item2) + " ")
}
</p>
</div>
</div>
}
</div>

+ 3
- 3
Sevomin.WebFrontend/Views/Shared/Navbar.cshtml View File

@ -19,11 +19,11 @@
else { else {
<li class="rtl"><a href="@Url.Action("Login", "Account")">ورود به سایت</a></li> <li class="rtl"><a href="@Url.Action("Login", "Account")">ورود به سایت</a></li>
} }
<li class="rtl"><a href="#">تماس با ما</a></li>
<li class="rtl"><a href="#">درباره ما</a></li>
@*<li class="rtl"><a href="#">تماس با ما</a></li>
<li class="rtl"><a href="#">درباره ما</a></li>*@
<li class="rtl"><a href="#">مشخصات متخصصین</a></li> <li class="rtl"><a href="#">مشخصات متخصصین</a></li>
<li class="rtl"><a href="#">آگهی های استخدام</a></li> <li class="rtl"><a href="#">آگهی های استخدام</a></li>
<li class="rtl"><a href="#"><span class="glyphicon glyphicon-home"></span> خانه</a></li>
<li class="rtl"><a href="@Url.Action("Index", "Home")"><span class="glyphicon glyphicon-home"></span> خانه</a></li>
</ul> </ul>
</div> </div>
</div> </div>


Loading…
Cancel
Save