collaborateurs et home page
This commit is contained in:
131
Yavsc/Controllers/CoWorkingController.cs
Normal file
131
Yavsc/Controllers/CoWorkingController.cs
Normal file
@ -0,0 +1,131 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
public class CoWorkingController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
|
||||
public CoWorkingController(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: CoWorking
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
var applicationDbContext = _context.WorkflowProviders.Include(c => c.Performer).Include(c => c.WorkingFor);
|
||||
return View(await applicationDbContext.ToListAsync());
|
||||
}
|
||||
|
||||
// GET: CoWorking/Details/5
|
||||
public async Task<IActionResult> Details(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
CoWorking coWorking = await _context.WorkflowProviders.SingleAsync(m => m.Id == id);
|
||||
if (coWorking == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(coWorking);
|
||||
}
|
||||
|
||||
// GET: CoWorking/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
ViewBag.PerformerId = _context.Performers.Select( p=> new SelectListItem { Value = p.PerformerId, Text = p.Performer.UserName});
|
||||
ViewBag.WorkingForId = new SelectList(_context.Users, "Id", "UserName");
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: CoWorking/Create
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create(CoWorking coWorking)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.WorkflowProviders.Add(coWorking);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
ViewData["PerformerId"] = new SelectList(_context.Performers, "PerformerId", "Performer", coWorking.PerformerId);
|
||||
ViewData["WorkingForId"] = new SelectList(_context.Users, "Id", "WorkingFor", coWorking.WorkingForId);
|
||||
return View(coWorking);
|
||||
}
|
||||
|
||||
// GET: CoWorking/Edit/5
|
||||
public async Task<IActionResult> Edit(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
CoWorking coWorking = await _context.WorkflowProviders.SingleAsync(m => m.Id == id);
|
||||
if (coWorking == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
ViewData["PerformerId"] = new SelectList(_context.Performers, "PerformerId", "Performer", coWorking.PerformerId);
|
||||
ViewData["WorkingForId"] = new SelectList(_context.Users, "Id", "WorkingFor", coWorking.WorkingForId);
|
||||
return View(coWorking);
|
||||
}
|
||||
|
||||
// POST: CoWorking/Edit/5
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(CoWorking coWorking)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(coWorking);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
ViewData["PerformerId"] = new SelectList(_context.Performers, "PerformerId", "Performer", coWorking.PerformerId);
|
||||
ViewData["WorkingForId"] = new SelectList(_context.Users, "Id", "WorkingFor", coWorking.WorkingForId);
|
||||
return View(coWorking);
|
||||
}
|
||||
|
||||
// GET: CoWorking/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public async Task<IActionResult> Delete(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
CoWorking coWorking = await _context.WorkflowProviders.SingleAsync(m => m.Id == id);
|
||||
if (coWorking == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(coWorking);
|
||||
}
|
||||
|
||||
// POST: CoWorking/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(long id)
|
||||
{
|
||||
CoWorking coWorking = await _context.WorkflowProviders.SingleAsync(m => m.Id == id);
|
||||
_context.WorkflowProviders.Remove(coWorking);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
@ -30,7 +30,7 @@ namespace Yavsc.Controllers
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
return View(DbContext.Activities);
|
||||
}
|
||||
|
||||
public IActionResult About()
|
||||
|
42
Yavsc/Views/CoWorking/Create.cshtml
Normal file
42
Yavsc/Views/CoWorking/Create.cshtml
Normal file
@ -0,0 +1,42 @@
|
||||
@model Yavsc.Models.Workflow.CoWorking
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h2>Create</h2>
|
||||
|
||||
<form asp-action="Create">
|
||||
<div class="form-horizontal">
|
||||
<h4>CoWorking</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="PerformerId" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="PerformerId" class ="form-control" asp-items=@ViewBag.PerformerId></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="WorkingForId" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="WorkingForId" class ="form-control" asp-items=@ViewBag.WorkingForId></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Create" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||
}
|
22
Yavsc/Views/CoWorking/Delete.cshtml
Normal file
22
Yavsc/Views/CoWorking/Delete.cshtml
Normal file
@ -0,0 +1,22 @@
|
||||
@model Yavsc.Models.Workflow.CoWorking
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>CoWorking</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<div class="form-actions no-color">
|
||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
18
Yavsc/Views/CoWorking/Details.cshtml
Normal file
18
Yavsc/Views/CoWorking/Details.cshtml
Normal file
@ -0,0 +1,18 @@
|
||||
@model Yavsc.Models.Workflow.CoWorking
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h2>Details</h2>
|
||||
|
||||
<div>
|
||||
<h4>CoWorking</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
</dl>
|
||||
</div>
|
||||
<p>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</p>
|
45
Yavsc/Views/CoWorking/Edit.cshtml
Normal file
45
Yavsc/Views/CoWorking/Edit.cshtml
Normal file
@ -0,0 +1,45 @@
|
||||
@model Yavsc.Models.Workflow.CoWorking
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<div class="form-horizontal">
|
||||
<h4>CoWorking</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="PerformerId" class="control-label col-md-2">PerformerId</label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="PerformerId" class="form-control" />
|
||||
<span asp-validation-for="PerformerId" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="WorkingForId" class="control-label col-md-2">WorkingForId</label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="WorkingForId" class="form-control" />
|
||||
<span asp-validation-for="WorkingForId" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Save" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||
}
|
26
Yavsc/Views/CoWorking/Index.cshtml
Normal file
26
Yavsc/Views/CoWorking/Index.cshtml
Normal file
@ -0,0 +1,26 @@
|
||||
@model IEnumerable<Yavsc.Models.Workflow.CoWorking>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
@ -4,61 +4,39 @@
|
||||
|
||||
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
|
||||
<ol class="carousel-indicators">
|
||||
@{
|
||||
int i=0;
|
||||
|
||||
foreach (var act in Model) {
|
||||
if (i==0) {
|
||||
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="1"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="2"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="3"></li>
|
||||
} else {
|
||||
<li data-target="#myCarousel" data-slide-to="@i"></li>
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
</ol>
|
||||
<div class="carousel-inner" role="listbox">
|
||||
<div class="item active">
|
||||
<img src="~/images/booking/groupe_b2.jpg" alt="ASP.NET" class="img-responsive" />
|
||||
<div class="carousel-inner" role="listbox">
|
||||
@{
|
||||
i=0;
|
||||
foreach (var act in Model) {
|
||||
string cls = (i==0) ? "item active":"item";
|
||||
<div class="@cls">
|
||||
<img src="@act.Photo" alt="@act.Name" class="img-responsive" />
|
||||
<div class="carousel-caption">
|
||||
|
||||
<p><em>@act.Name</em><br/>
|
||||
@act.Description </p>
|
||||
<p>
|
||||
Invitez un groupe musical à animer votre événement </p>
|
||||
<p>
|
||||
<a class="btn btn-default" asp-controller="FrontOffice" asp-action="Book" asp-route-id="IT">
|
||||
En savoir plus
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="~/images/booking/concert_b2.jpg" alt="Visual Studio" class="img-responsive" />
|
||||
<div class="carousel-caption">
|
||||
<p>
|
||||
Organisez un concert. </p>
|
||||
<p>
|
||||
<a class="btn btn-default" asp-controller="FrontOffice" asp-action="Book" asp-route-id="IT">
|
||||
En savoir plus
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="~/images/booking/dj_b2.jpg" alt="Package Management" class="img-responsive" />
|
||||
<div class="carousel-caption">
|
||||
<p> Offrez-vous un anniversaire, un mariage Hip Hop </p>
|
||||
<p>
|
||||
|
||||
<a class="btn btn-default" asp-controller="FrontOffice" asp-action="Book" asp-route-id="IT">
|
||||
En savoir plus
|
||||
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="~/images/booking/mike_b2.jpg" alt="Microsoft Azure" class="img-responsive" />
|
||||
<div class="carousel-caption">
|
||||
<p>
|
||||
Invitez votre chanteur à la fête </p>
|
||||
<p>
|
||||
<a class="btn btn-default" asp-controller="FrontOffice" asp-route-id="Book" >
|
||||
<a class="btn btn-default" asp-controller="FrontOffice" asp-action="Book" asp-route-id="@act.Code">
|
||||
En savoir plus
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
i++; }
|
||||
}
|
||||
</div>
|
||||
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
|
||||
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
|
||||
|
Reference in New Issue
Block a user