Вы находитесь на странице: 1из 3

@model RSReporting.Models.

ManualServiceViewModel
@using RSReporting.Helpers
@using (Html.BeginForm("Edit", "Reports", FormMethod.Post, new { @class = "smart-
form", @id = "checkout-form", @enctype = "multipart/form-data" }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.HiddenFor(model => model.OnlyOneManualService.Id)
<fieldset>
<table id="datatable_fixed_column" class="table table-striped table-
bordered table-hover " style="width:100%;">
<thead>
<tr>
<th class="hasinput" style="width:5%">
<input type="text" class="form-control" placeholder="Id" />
</th>
<th class="hasinput" style="width:10%">
<input type="text" class="form-control" placeholder="Filter
Service" />
</th>
<th class="hasinput" style="width:10%">
<input type="text" class="form-control" placeholder="Filter
Project" />
</th>
<th class="hasinput" style="width:8%">
<input type="text" class="form-control" placeholder="Filter
Billing" />
</th>
<th class="hasinput" style="width:8%">
<input type="text" class="form-control" placeholder="Filter
NrOfServices" />
</th>
</tr>
<tr>
<th data-class="expand">
@Html.DisplayNameFor(model =>
model.OnlyOneManualService.Id)
</th>
<th data-hide="phone,tablet">
@Html.DisplayNameFor(model =>
model.OnlyOneManualService.Service.Name)
</th>
<th data-hide="phone,tablet">
@Html.DisplayNameFor(model =>
model.OnlyOneManualService.Project.Name)
</th>
<th data-hide="phone,tablet">
@Html.DisplayNameFor(model =>
model.OnlyOneManualService.Billing)
</th>
<th data-hide="phone,tablet">
@Html.DisplayNameFor(model =>
model.OnlyOneManualService.NrOfServices)
</th>
<th data-hide="phone,tablet">
Actions
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.AllManualServices)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.Service.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Project.Name)
</td>
<td class="x-y-center TimeStatus">
@if (item.Billing == 1)
{<span class='center-block padding-5 label label-
success'>Yes</span>}
@if (item.Billing == 0)
{<span class='center-block padding-5 label label-
danger'>No</span>}

</td>
<td>
@if (User.IsInRole("Admin") || User.IsInRole("PM") ||
User.IsInRole("SDM"))
{
<div class="btn-group">
<button title="Bill" class="btn btn-default
btn-xs time-action dropdown-toggle" data-toggle="dropdown"><span class="glyphicon
glyphicon-check"></span></button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0);"
class="btnCheck" data-btnId=@item.Id><i class="fa fa-check"></i> Yes</a>
</li>
<li class="divider"></li>
<li>
<a href="javascript:void(0);"
class="btnLock" data-btnId=@item.Id><i class="fa fa-lock"></i> No</a>
</li>
</ul>
</div>
<a href="#" class="btn btn-outline btn-success btn-
xs dim fa fa-edit " onclick="EditEvent(@item.Id)"></a>
<a href="#" class="btn btn-outline btn-danger btn-
xs dim fa fa-trash-o " onclick="ConfirmDelete(@item.Id)"></a>
}
</td>
</tr>
}
</tbody>

</table>

</fieldset>
<fieldset></fieldset>
<footer>
<button type="submit" class="btn btn-primary">
Save
</button>
<button type="submit" class="btn btn-danger btn-sm" data-
dismiss="modal">Cancel</button>
</footer>
}

@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
<script>
$(document).ready(function () {
$("#btnsubmit").click(function () {
$("#loaderDiv").show();
var formData = $("#editForm").serialize();
$.ajax({
type: "POST",
url: "/Event/Index",
data: formData,
success: function () {
$("#loaderDiv").hide();
$("#ModalEdit").modal("hide");
window.location.href = "/Event/Index";
}
})

})
})
</script>

Вам также может понравиться