Advertisement
Guest User

Untitled

a guest
Mar 9th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1. @using IPass.DB.Base
  2. @using IpassWebApplication.Providers.Profile
  3. @{
  4.  
  5. ProfileIPass profile = ViewBag.profile;
  6. var detailTemplates = ((Dictionary<string, List<string>>) ViewBag.TagDetailTemplates);
  7. IEnumerable<SelectListItem> readerList =((List<RfidReader>)ViewBag.RfidReaders).Select(s => new SelectListItem() { Text = s.name, Value = s.id.ToString() }).ToList();
  8. }
  9. <div style="width: 225px; float: left; position: relative;">
  10.  
  11. @*This is the first window to pop up. It will have the dropdown menu in it*@
  12. <div id="addRfidCard" style="position: absolute; width: 280px; height: 100px; background-color: #eee;
  13. padding: 10px; -webkit-box-shadow: 0px 3px 20px #2c2c2c; border: 1px solid black;
  14. top: 20px; left: 20px; display: none; z-index: 2;">
  15. <img src="/Content/images/icons/window-close-4.png" style="position: absolute; top: 5px;
  16. right: 5px; cursor: pointer;" onclick="$(this).parent().fadeOut();" />
  17. @Html.Label("rfidreaderidlabel", "This is the first page")
  18. @Html.DropDownList("rfidreaderid", readerList)
  19. <input type="button" value="Add Rfid Tag" onclick="$('#addRfidCard1').fadeIn(); $(this).parent().fadeOut();" />
  20. </div>
  21.  
  22.  
  23. @*This is the second window. Currently it is holding the Textbox that I am using as a debug tool to see if the item in the drop down list is being passed*@
  24. <div id="addRfidCard1" style="position: absolute; width: 280px; height: 100px; background-color: #eee;
  25. padding: 10px; -webkit-box-shadow: 0px 3px 20px #2c2c2c; border: 1px solid black;
  26. top: 20px; left: 20px; display: none; z-index: 2;">
  27. <img src="/Content/images/icons/window-close-4.png" style="position: absolute; top: 5px;
  28. right: 5px; cursor: pointer;" onclick="$(this).parent().fadeOut();" />
  29. Scan card now then click next
  30. @Html.TextBox("Textbox", selectedReader)
  31. <input type="button" value="Next" onclick="$('#addRfidCard2').fadeIn(); $(this).parent().fadeOut();" />
  32. </div>
  33.  
  34.  
  35. @*This is the third window. Right now it does nothing but will do something in the future*@
  36. <div id="addRfidCard2" style="position: absolute; width: 280px; height: 100px; background-color: #eee;
  37. padding: 10px; -webkit-box-shadow: 0px 3px 20px #2c2c2c; border: 1px solid black;
  38. top: 20px; left: 20px; display: none; z-index: 2;">
  39. <img src="/Content/images/icons/window-close-4.png" style="position: absolute; top: 5px;
  40. right: 5px; cursor: pointer;" onclick="$(this).parent().fadeOut();" />
  41. <input type="button" value="Add Rfid Tag" onclick="$(this).parent().fadeOut();" />
  42. </div>
  43.  
  44. @*This is the top of the partial view and contains the button that opens the first window*@
  45. <div style="margin: 10px 0px;">
  46. <span style="font-weight: bold; text-transform: uppercase; color: #000;">
  47. <img src="/Content/images/icons/icon-accesscard.png" style="vertical-align: middle;" />
  48. Rfid Cards&nbsp;
  49. <img src="/Content/images/icons/edit-add-4.png" style="cursor: pointer; vertical-align: middle;"
  50. onclick="$('#addRfidCard').fadeIn()" />
  51. </span>
  52. </div>
  53.  
  54. @*This is a section on the same partial view but is not something I'm working with right now*@
  55. <div id="tagcontainer">
  56. @foreach (IPass.DB.Base.RfidTag rfidtag in ViewBag.RfidTags)
  57. {
  58.  
  59. <div class="rfidtag" data="@rfidtag.id" >
  60. <span class="tagno">@rfidtag.tagNo</span><br />
  61. <a href="javascript:ShowRfidTagDetails(@rfidtag.id)">edit</a>
  62. <img src="/Content/images/icons/edit-delete-6.png" class="btnRemove" onclick="User.RfidTagRemoveFromUser('@profile.UserName',@rfidtag.id);" />
  63. </div>
  64. }
  65. </div>
  66. <div id="tagcontainerDetails">
  67. @foreach (IPass.DB.Base.RfidTag rfidtag in ViewBag.RfidTags)
  68. {
  69. if (detailTemplates.Keys.Contains(rfidtag.id.ToString()))
  70. {
  71. <div class="rfidtagDetails" data="@rfidtag.id" >
  72. <a href="javascript:HideRfidTagDetails(@rfidtag.id)">close</a> | <a href="javascript:SaveRfidTagDetails(@rfidtag.id)">Save</a>
  73. <br />
  74. <br />
  75. @foreach (string detailName in detailTemplates[rfidtag.id.ToString()])
  76. {
  77. var detail = rfidtag.Details.Where(w => w.key.Equals(detailName)).FirstOrDefault();
  78. string value = detail != null ? detail.value : string.Empty;
  79. <input placeholder="@detailName" name="@detailName" value="@value"/>
  80. }
  81. </div>
  82. }
  83. }
  84. </div>
  85. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement