Guest User

Untitled

a guest
Dec 17th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <table>
  2. <td>
  3.  
  4. <input type='checkbox' id="StockIDCheckBox" name='result' value=@item.StockID />
  5. <tr>
  6. </td>
  7. <td>
  8. @Html.TextAreaFor(modelItem => item.Description, new { id = "description", @row = "50", @cols = "5", @class = "form-control" })
  9.  
  10. </td>
  11.  
  12. <td>
  13. <a class="btn btn-info btn-sm" data-toggle="modal" data-target="#verify" id="btnnVerify" onclick="SaveandVerify(@item.StockID)">
  14. <i class="glyphicon glyphicon-ok"></i>
  15. </a>
  16. </td>
  17. <td>
  18. <a class="btn btn-danger btn-sm" data-toggle="modal" data-target="#Reject" onclick="RejectGroup(@item.StockID)">
  19. <i class="glyphicon glyphicon-remove"></i>
  20. </a>
  21. </td>
  22. </tr>
  23. </table>
  24.  
  25. function SaveandVerify(id) {
  26. $.get("/Admin/VerifyStockBuy/SaveandVerify/" + id, function (result) {
  27. $("#verify #myModalLabel").html(" وضعیت درخواست این کالا در این کارگاه ");
  28. $("#verify #myModalBody").html(result);
  29.  
  30. });
  31.  
  32.  
  33.  
  34. }
  35. function RejectGroup(id) {
  36. $.get("/Admin/VerifyStockBuy/Reject/" + id, function (result) {
  37. $("#Reject #myModalLabel").html("رد درخواست");
  38. $("#Reject #myModalBody").html(result);
  39.  
  40. });
  41. }
  42. $(document).ready(function () {
  43. $('#repAll').DataTable({
  44. "ordering": true,
  45. "language": {
  46. "search": "جستجو",
  47. "paginate": {
  48. "previous": "قبلی",
  49. "next": "بعدی"
  50. },
  51. "sLengthMenu": "نمایش _MENU_ ردیف",
  52. "sInfo": "نمایش _START_ تا _END_ ردیف از _TOTAL_ ردیف",
  53. "sEmptyTable": "هیچ داده ای در دسترس نیست",
  54. "sInfoEmpty": "نمایش 0 ردیف از 0 ردیف",
  55. },
  56. "columnDefs": [{ width: 1000, targets: 0 }],
  57.  
  58.  
  59.  
  60.  
  61.  
  62. });
  63.  
  64. $("#btnnVerify").click(function () {
  65.  
  66.  
  67. var Desc = $("#description").val();
  68. var stockId = $("#StockIDCheckBox").val();
  69. alert(Desc + ":" + stockId);
  70. $.ajax({
  71.  
  72. url: '/VerifyStockBuy/EditDescription/',
  73. data: { id: stockId, Description: Desc },
  74. type: 'Post',
  75. dataType: "text",
  76. success: function (data) {
  77. }
  78.  
  79. });
  80.  
  81.  
  82. });
  83.  
  84.  
  85. });
  86.  
  87. [HttpPost]
  88. public ActionResult EditDescription(int id, string Description)
  89. {
  90. var desc = db.StockBuys.Find(id);
  91. desc.Description = Description;
  92. db.SaveChanges();
  93. return Content(Description);
  94. }
Add Comment
Please, Sign In to add comment