Created
October 9, 2018 14:00
-
-
Save alpercalisir/df33aba901bd83e3babe5ab853fad4f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model List<Ulens.Models.UserSupervisorRelationship> | |
@{ | |
ViewBag.Title = "Kullanıcı/Amir İlişkileri"; | |
} | |
<h2>Kullanıcı/Amir İlişkileri</h2> | |
<link href="~/Content/pnotify.css" rel="stylesheet" /> | |
<link href="~/Content/dataTables.bootstrap.min.css" rel="stylesheet" /> | |
<link href="~/Content/responsive.bootstrap.min.css" rel="stylesheet" /> | |
<link href="~/Content/babel.css" rel="stylesheet" /> | |
<link href="~/Content/babel2.css" rel="stylesheet" /> | |
<style> | |
.control-label { | |
text-align: right; | |
} | |
.dataTables_filter { | |
width: 100%; | |
} | |
</style> | |
@using (Html.BeginForm()) | |
{ | |
@Html.AntiForgeryToken() | |
<div class="form-horizontal" style="margin: 0 auto;width: 1024px;height:200px;"> | |
<hr /> | |
@Html.ValidationSummary(true, "", new { @class = "text-danger" }) | |
<form method="get"> | |
<div class="form-group col-md-2" style="left:250px;"> | |
<input class="chosen-value" type="text" value="" placeholder="Kullanıcı" name="userId" id="userId"> | |
<ul class="value-list"> | |
@foreach (ApplicationUser u in ViewBag.Users) | |
{ | |
<li value="@u.Id">@u.Name @u.Lastname</li> | |
} | |
</ul> | |
</div> | |
<div class="form-group col-md-2" style="left:350px;"> | |
<input class="supervis" type="text" value="" placeholder="Amir" name="supervisorId" id="supervisorId"> | |
<ul class="valuelst"> | |
@foreach (ApplicationUser u in ViewBag.Users) | |
{ | |
<li value="@u.Id">@u.Name @u.Lastname</li> | |
} | |
</ul> | |
</div> | |
</form> | |
</div> | |
} | |
<div class="row"> | |
<table id="tableBoard" data-order='[[0, "desc"]]' class="table table-striped"> | |
<thead> | |
<tr> | |
<th>Kullanıcı</th> | |
<th>Amir</th> | |
</tr> | |
</thead> | |
<tbody> | |
@foreach (UserSupervisorRelationship info in ViewBag.Relations) | |
{ | |
<tr data-user="@info.User.Name" data-id="@info.Id" data-super="@info.Supervisor.Id"> | |
<td>@info.User.Name</td> | |
<td>@info.Supervisor.Name</td> | |
<td> | |
<button title="degistir" class="btn btn-primary btn-xs editSupervisor"><i class="glyphicon glyphicon-pencil"></i></button> | |
</td> | |
</tr> | |
} | |
</tbody> | |
</table> | |
</div> | |
<div class="modal fade" id="editSupervisorModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog modal-lg"> | |
<div class="modal-content"> | |
<form class="form-horizontal" method="post" role="form" action="@Url.Action("EditSupervisor")"> | |
@Html.AntiForgeryToken() | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | |
</div> | |
<div class="modal-body" style="margin: 0 auto;width: 450px;"> | |
<input name="relId" type="hidden" /> | |
<div class="form-group"> | |
<label for="Modaluser" class="col-md-3 control-label">Kullanıcı</label> | |
<div class="col-md-8"> | |
<input disabled="disabled" rows="2" id="Modaluser" name="User" class="form-control" placeholder="Kullanıcı....."> | |
</div> | |
</div> | |
<div class="form-group" style="width:900px;"> | |
<select name="supervisorId" id="supervisorId" class="control-label col-md-2" required> | |
<option selected="selected" value="">Amir seçin</option> | |
@foreach (ApplicationUser u in ViewBag.Users) | |
{ | |
<option value="@u.Id">@u.Name @u.Lastname</option> | |
} | |
</select> | |
</div> | |
</div> | |
<div class="modal-footer"> | |
<button type="submit" id="btnUpdate" class="btn btn-success">Güncelle</button> | |
</div> | |
</form> | |
</div> | |
</div> | |
</div> | |
@section scripts{ | |
<script src="~/Scripts/jquery.dataTables.min.js"></script> | |
<script src="~/Scripts/dataTables.bootstrap.min.js"></script> | |
<script src="~/Scripts/dataTables.responsive.min.js"></script> | |
<script src="~/Scripts/responsive.bootstrap.min.js"></script> | |
<script src="~/Scripts/pnotify.js"></script> | |
<script src="~/Scripts/babel.js"></script> | |
<script src="~/Scripts/babel2.js"></script> | |
<script type="text/javascript"> | |
var updateSupervisorUrl = '@Url.Action("EditSupervisor", "Admin")'; | |
var notifyOptions = { | |
styling: 'bootstrap3', | |
}; | |
var notfiyConfirmOptions = { | |
styling: 'bootstrap3', | |
type: 'info', | |
hide: false, | |
confirm: { | |
confirm: true | |
}, | |
buttons: { | |
closer: false, | |
sticker: false | |
}, | |
addclass: 'stack-modal', | |
stack: { 'dir1': 'down', 'dir2': 'right', 'modal': true } | |
}; | |
$(function () { | |
$('.row').on('click', '.editSupervisor', function () { | |
var modal = $('#editSupervisorModal'); | |
modal.find('input[name="User"]').val($(this).closest('tr').data('user')); | |
modal.find('input[name="Super"]').val($(this).closest('tr').data('super')); | |
modal.find('input[name="relId"]').val($(this).closest('tr').data('id')); | |
var that = $(this); | |
modal.modal(); | |
}); | |
}); | |
function printResult(result) { | |
if (result.status == 1) { | |
notifyOptions.title = 'Başarılı'; | |
notifyOptions.type = 'success'; | |
notifyOptions.hide = false; | |
} | |
else { | |
notifyOptions.title = 'Hata!'; | |
notifyOptions.type = 'error'; | |
notifyOptions.hide = true; | |
} | |
notifyOptions.text = result.Message; | |
new PNotify(notifyOptions); | |
} | |
</script> | |
} | |
<div> | |
@Html.ActionLink("Back to List", "Index") | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment