Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.74 KB | None | 0 0
  1. var id = $("#personid").val();
  2. $("#ajaxView").load("/PersonelEgitim/Index/" + id);
  3.  
  4. $("#ajaxView").load("/PersonelEgitim/Index/1234);
  5.  
  6. $("#ajaxView").load("/PersonelEgitim/Index/1234 #ajaxView");
  7.  
  8. $("#ajaxView").load("/PersonelEgitim/Index/1234 #ajaxView >*","");
  9.  
  10. $.ajax({
  11. type: "GET",
  12. url: "/PersonelEgitim/Index/1234",
  13. datatype: "html",
  14. success: function (data) {
  15. $("#ajaxView").html(data);
  16. }
  17. });
  18.  
  19. <script type="text/javascript" language="javascript">
  20.  
  21. function ClearForm()
  22. {
  23.  
  24. }
  25.  
  26. </script>
  27.  
  28. @using (Ajax.BeginForm(new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "mesaj", OnBegin = "ClearForm" }))
  29.  
  30. public ActionResult Index(string id)
  31. {
  32. var personelEgitim = db.PersonelEgitim.Where(x => x.PersonID == id);
  33. return View(personelEgitim);
  34. }
  35.  
  36. @model DenemeMetroPro.Models.EntityFramework.PersonelGenel
  37.  
  38. @{
  39. ViewBag.Title = "Details";
  40. Layout = "~/Views/Shared/_TableMain.cshtml";
  41. }
  42.  
  43.  
  44. <div>
  45.  
  46. <dl class="dl-horizontal">
  47. <dt>
  48. @Html.DisplayNameFor(model => model.TCNo)
  49. </dt>
  50.  
  51. <dd>
  52. @Html.DisplayFor(model => model.TCNo)
  53. </dd>
  54.  
  55. <dt>
  56. @Html.DisplayNameFor(model => model.Adi)
  57. </dt>
  58.  
  59. <dd>
  60. @Html.DisplayFor(model => model.Adi)
  61. </dd>
  62.  
  63. <dt>
  64. @Html.DisplayNameFor(model => model.Soyadi)
  65. </dt>
  66.  
  67. <dd>
  68. @Html.DisplayFor(model => model.Soyadi)
  69. </dd>
  70.  
  71. <dt>
  72. @Html.DisplayNameFor(model => model.SicilNo)
  73. </dt>
  74.  
  75. <dd>
  76. @Html.DisplayFor(model => model.SicilNo)
  77. </dd>
  78.  
  79. <dt>
  80. @Html.DisplayNameFor(model => model.IseGirisTarihi)
  81. </dt>
  82.  
  83. <dd>
  84. @Html.DisplayFor(model => model.IseGirisTarihi)
  85. </dd>
  86.  
  87. <dt>
  88. @Html.DisplayNameFor(model => model.Cinsiyet)
  89. </dt>
  90.  
  91. <dd>
  92. @(Model.Cinsiyet == true ? "Erkek" : "Kadın")
  93. </dd>
  94.  
  95. <dt>
  96. @Html.DisplayNameFor(model => model.EskiHukumlu)
  97.  
  98. </dt>
  99.  
  100. <dd>
  101. @(Model.EskiHukumlu == true ? "Eski Hükümlü" : "Hükümlü Değil")
  102. </dd>
  103.  
  104. <dt>
  105. @Html.DisplayNameFor(model => model.Engelli)
  106. </dt>
  107.  
  108. <dd>
  109. @(Model.Engelli == true ? "Engelli" : "Engelli Değil")
  110. </dd>
  111.  
  112. <dt>
  113. @Html.DisplayNameFor(model => model.Birimler.BirimAdi)
  114. </dt>
  115.  
  116. <dd>
  117. @Html.DisplayFor(model => model.Birimler.BirimAdi)
  118. </dd>
  119.  
  120. <dt>
  121. @Html.DisplayNameFor(model => model.KadroTipleri.KadroTipleri1)
  122. </dt>
  123.  
  124. <dd>
  125. @Html.DisplayFor(model => model.KadroTipleri.KadroTipleri1)
  126. </dd>
  127.  
  128. <dt>
  129. @Html.DisplayNameFor(model => model.Kisimlar.KisimAdi)
  130. </dt>
  131.  
  132. <dd>
  133. @Html.DisplayFor(model => model.Kisimlar.KisimAdi)
  134. </dd>
  135.  
  136. <dt>
  137. @Html.DisplayNameFor(model => model.Pozisyonlar.Pozisyon)
  138. </dt>
  139.  
  140. <dd>
  141. @Html.DisplayFor(model => model.Pozisyonlar.Pozisyon)
  142. </dd>
  143.  
  144. <dt>
  145. @Html.DisplayNameFor(model => model.Siniflar.SinifAdi)
  146. </dt>
  147.  
  148. <dd>
  149. @Html.DisplayFor(model => model.Siniflar.SinifAdi)
  150. </dd>
  151. </dl>
  152. </div>
  153. <p>
  154. @Html.ActionLink("Edit", "Edit", new { id = Model.TCNo }) |
  155. @Html.ActionLink("Back to List", "Index")
  156. </p>
  157.  
  158. <p>
  159. @if (Model.Cinsiyet == true)
  160. {
  161. @Ajax.ActionLink("Askerlik Durumu", "Index", "PersonelAskerlik", new { id = Model.TCNo }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "ajaxView", OnSuccess = "clearSubForm" }, new { @class = "btn btn-default" })
  162. }
  163.  
  164. @Ajax.ActionLink("Eğitim Durumu", "Index", "PersonelEgitim", new { id = Model.TCNo }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "ajaxView", OnSuccess = "clearSubForm" }, new { @class = "btn btn-default" })
  165. </p>
  166.  
  167. <div id="ajaxView"></div>
  168. <div id="mesaj"></div>
  169. <div id="ajaxEdit"></div>
  170.  
  171. <script type="text/javascript" language="javascript">
  172.  
  173. function clearSubForm()
  174. {
  175. $("#ajaxEdit").empty();
  176. }
  177.  
  178. </script>
  179.  
  180. @model IEnumerable<DenemeMetroPro.Models.EntityFramework.PersonelEgitim>
  181.  
  182. <h3>Eğitim Durumu</h3>
  183.  
  184.  
  185. <p>
  186. @Ajax.ActionLink("Yeni", "Create", "PersonelEgitim", null, new AjaxOptions { UpdateTargetId = "ajaxEdit" }, new { @class = "btn btn-success" })
  187. </p>
  188.  
  189. <table id="datatable" class="table table-bordered table-striped">
  190. <thead>
  191. <tr>
  192. <th>
  193. @Html.DisplayNameFor(model => model.MezuniyetDurumu.Mezuniyet)
  194. </th>
  195.  
  196. <th>
  197. @Html.DisplayNameFor(model => model.Okul)
  198. </th>
  199. <th>
  200. @Html.DisplayNameFor(model => model.Bölüm)
  201. </th>
  202. <th>
  203. @Html.DisplayNameFor(model => model.MezuniyetTarihi)
  204. </th>
  205. <th>
  206. @Html.DisplayNameFor(model => model.TezKonusu)
  207. </th>
  208.  
  209.  
  210. <th></th>
  211. </tr>
  212. </thead>
  213. <tbody>
  214. @foreach (var item in Model)
  215. {
  216. <tr>
  217. <td>
  218. @Html.DisplayFor(modelItem => item.MezuniyetDurumu.Mezuniyet)
  219. </td>
  220.  
  221. <td>
  222. @Html.DisplayFor(modelItem => item.Okul)
  223. </td>
  224. <td>
  225. @Html.DisplayFor(modelItem => item.Bölüm)
  226. </td>
  227. <td>
  228. @Html.DisplayFor(modelItem => item.MezuniyetTarihi)
  229. </td>
  230. <td>
  231. @Html.DisplayFor(modelItem => item.TezKonusu)
  232. </td>
  233.  
  234.  
  235. <td>
  236. @Ajax.ActionLink("Düzenle", "Edit", "PersonelEgitim", new { id = item.ID }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "ajaxEdit" }) |
  237. @Ajax.ActionLink("Sil", "Delete", "PersonelEgitim", new { id = item.ID }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "ajaxEdit" })
  238. </td>
  239. </tr>
  240. }
  241. </tbody>
  242. </table>
  243.  
  244. @model DenemeMetroPro.Models.EntityFramework.PersonelEgitim
  245.  
  246.  
  247.  
  248.  
  249. @using (Ajax.BeginForm(new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "mesaj", OnBegin = "ClearForm" }))
  250. {
  251. @Html.AntiForgeryToken()
  252.  
  253. <div class="form-horizontal">
  254. <h4>Eğitim Bilgisi Ekle</h4>
  255. <hr />
  256. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  257. <div class="form-group">
  258. @Html.LabelFor(model => model.PersonID, "PersonID", htmlAttributes: new { @class = "control-label col-md-2" })
  259. <div class="col-md-10">
  260. @Html.DropDownList("PersonID", null, htmlAttributes: new { @class = "form-control", id="personid" })
  261. @Html.ValidationMessageFor(model => model.PersonID, "", new { @class = "text-danger" })
  262. </div>
  263. </div>
  264.  
  265. <div class="form-group">
  266. @Html.LabelFor(model => model.MezuniyetId, "MezuniyetId", htmlAttributes: new { @class = "control-label col-md-2" })
  267. <div class="col-md-10">
  268. @Html.DropDownList("MezuniyetId", null, "Mezuniyet Seçiniz", htmlAttributes: new { @class = "form-control" })
  269. @Html.ValidationMessageFor(model => model.MezuniyetId, "", new { @class = "text-danger" })
  270. </div>
  271. </div>
  272.  
  273. <div class="form-group">
  274. @Html.LabelFor(model => model.MezuniyetTarihi, htmlAttributes: new { @class = "control-label col-md-2" })
  275. <div class="col-md-10">
  276. @Html.EditorFor(model => model.MezuniyetTarihi, new { htmlAttributes = new { @class = "form-control" } })
  277. @Html.ValidationMessageFor(model => model.MezuniyetTarihi, "", new { @class = "text-danger" })
  278. </div>
  279. </div>
  280.  
  281. <div class="form-group">
  282. @Html.LabelFor(model => model.Okul, htmlAttributes: new { @class = "control-label col-md-2" })
  283. <div class="col-md-10">
  284. @Html.EditorFor(model => model.Okul, new { htmlAttributes = new { @class = "form-control" } })
  285. @Html.ValidationMessageFor(model => model.Okul, "", new { @class = "text-danger" })
  286. </div>
  287. </div>
  288.  
  289. <div class="form-group">
  290. @Html.LabelFor(model => model.Bölüm, htmlAttributes: new { @class = "control-label col-md-2" })
  291. <div class="col-md-10">
  292. @Html.EditorFor(model => model.Bölüm, new { htmlAttributes = new { @class = "form-control" } })
  293. @Html.ValidationMessageFor(model => model.Bölüm, "", new { @class = "text-danger" })
  294. </div>
  295. </div>
  296.  
  297. <div class="form-group">
  298. @Html.LabelFor(model => model.TezKonusu, htmlAttributes: new { @class = "control-label col-md-2" })
  299. <div class="col-md-10">
  300. @Html.EditorFor(model => model.TezKonusu, new { htmlAttributes = new { @class = "form-control" } })
  301. @Html.ValidationMessageFor(model => model.TezKonusu, "", new { @class = "text-danger" })
  302. </div>
  303. </div>
  304.  
  305. <div class="form-group">
  306. <div class="col-md-offset-2 col-md-10">
  307. <input type="submit" value="Create" class="btn btn-default" />
  308. </div>
  309. </div>
  310. </div>
  311. }
  312.  
  313. <script type="text/javascript" language="javascript">
  314.  
  315. function ClearForm()
  316. {
  317.  
  318. $("#ajaxView").load("/PersonelEgitim/Index/1234);
  319.  
  320.  
  321. $("#mesaj").delay(2000).fadeOut("slow");
  322.  
  323.  
  324. $("#ajaxEdit").empty();
  325. }
  326.  
  327. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement