Notes
Notes - notes.io |
@using EndGame.DAL.Models
@{
ViewBag.Title = "Kategorileri Yönet";
ViewBag.Heading = "Kategorileri";
ViewBag.SubHeading = "Yönet";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section ButtonArea{
<button type="button" class="btn btn-info btnYeni" data-toggle="modal" data-target="#myModal" style="float:right;"><i class="fa fa-pencil"></i> Yeni</button>
}
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>ID</th>
<th>Kategori Adı</th>
<th> </th>
</tr>
</thead>
<tbody>
@{
CategoryRepository _categories = new CategoryRepository();
if (_categories.GetAll().Count() > 0)
{
foreach (Category item in _categories.GetAll())
{
<tr>
<td>@item.ID</td>
<td>@item.CategoryName</td>
<td>
<a href="#" class="btn btn-success btn-xs btnModalGuncelle" data-toggle="modal" data-target="#myModal" data-id="@item.ID" data-categoryname="@item.CategoryName" data-topcategoryid="@item.TopCategoryID"><i class="fa fa-repeat"></i> Güncelle</a>
<a href="#" class="btn btn-danger btn-xs"><i class="fa fa-trash"></i> Sil</a>
</td>
</tr>
}
}
}
</tbody>
</table>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><span id="modal-header"></span></h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<fieldset>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="ustKat">Üst Kategori:</label>
<div class="col-md-4">
<select id="ustKat" name="ustKat" class="form-control">
<option value="0">Seçiniz...</option>
@{
foreach (Category item in _categories.GetAll())
{
<option value="@item.ID">@item.CategoryName</option>
}
}
</select>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="KategoriAdi">Kategori Adı:</label>
<div class="col-md-4">
<input id="KategoriAdi" name="KategoriAdi" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>
<button type="button" class="btn btn-success btnGuncelle" data-dismiss="modal" data-id="12">Güncelle</button>
<button type="button" class="btn btn-success btnEkle" data-dismiss="modal">Kaydet</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('.btnYeni').click(function () {
$('.btnGuncelle').hide();
$('#modal-header').html("Yeni");
});
$('.btnEkle').click(function () {
var categoryName = $('#KategoriAdi').val();
var topCategoryID = $('#ustKat').val();
$.ajax({
type: "POST",
url: "/Home/CategoryAdd?categoryName=" + categoryName + "&topCategoryID=" + topCategoryID,
success: function () {
window.location.replace("/Home/ManageCategories");
},
error: function () {
alert("İşlem başarısız!");
}
});
});
$('.btnModalGuncelle').click(function () {
$('.btnEkle').hide();
$('#modal-header').html("Güncelle");
var id = $(this).data("id");
var categoryName = $(this).data("categoryname");
var topCategoryID = $(this).data("topcategoryid");
$("#ustKat option[value=" + topCategoryID + "]")
.attr('selected', true);
$('#KategoriAdi').val(categoryName);
$('.btnGuncelle').attr("data-id", id);
});
$('.btnGuncelle').click(function () {
})
})
</script>
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team