Guest User

Untitled

a guest
Sep 24th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @model IEnumerable<EditInventoryHistoryModel>
  2. @{
  3.     Layout = "~/Views/TankCommand/_TankLayout.cshtml";
  4. }
  5. <table class="standard">
  6.     <thead>
  7.         <tr>
  8.             <th>Date</th>
  9.             <th>Reading Date</th>
  10.             <th>Ambient Volume</th>
  11.             <th>Standard Volume</th>
  12.             <th>Options</th>
  13.         </tr>
  14.     </thead>
  15.     <tbody>
  16.     @foreach (var item in Model)
  17.     {
  18.  
  19.         @Html.Action("Edit", "InventoryHistory", new { id = item.Id })
  20.  
  21.     }
  22.     </tbody>
  23. </table>
  24. <div class="clear"></div>
  25.  
  26.  
  27. <script type="text/javascript">
  28.     $(document).ready(function () {
  29.  
  30.         $('.fetchFromDevice').click(function () {
  31.             alert("fetch from device");
  32.             $.ajax({
  33.                 url: '@Url.Action("FetchFromDevice", "InventoryHistory")',
  34.                 data: JSON.stringify({ id: model.id, model: model }),
  35.                 type: 'POST',
  36.                 contentType: 'application/json; charset=utf-8;',
  37.                 success: function (response) {
  38.                 },
  39.                 error: function (xhr, status, error) {
  40.                     alert(error);
  41.                 }
  42.             });
  43.         });
  44.  
  45.         $('.fetchFromIR').click(function () {
  46.             alert("fetch from IR");
  47.             $.ajax({
  48.                 url: '@Url.Action("FetchFromInventoryReconciliation", "InventoryHistory")',
  49.                 data: JSON.stringify({ id: model.Id, model: model }),
  50.                 type: 'POST',
  51.                 contentType: 'application/json; charset=utf-8;',
  52.                 success: function (response) {
  53.                 },
  54.                 error: function (xhr, status, error) {
  55.                     alert(error);
  56.                 }
  57.             });
  58.         });
  59.  
  60.         $('.set').click(function () {
  61.             var row = $(this).closest('tr');
  62.             var itemId = row.data("itemid");
  63.             var model = { "Id": itemId };
  64.             data.Volume = row.find('#Volume').val();
  65.             data.Date = row.find('#Date').val();
  66.             data.TemperatureCompensatedVolume = row.find('#TemperatureCompensatedVolume').val();
  67.             alert(model);
  68.             $.ajax({
  69.                 url: '@Url.Action("Edit", "InventoryHistory")',
  70.                 data: { id: itemId, model: model },
  71.                 type: 'POST',
  72.                 contentType: 'application/json; charset=utf-8;',
  73.                 success: function (response) {
  74.                 },
  75.                 error: function (xhr, status, error) {
  76.                     alert(error);
  77.                 }
  78.             });
  79.         });
  80.  
  81.     });
  82. </script>
Add Comment
Please, Sign In to add comment