纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
6.4 KiB

  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Index.cshtml";
  5. }
  6. <style>
  7. #ISO {
  8. width: 10px;
  9. }
  10. </style>
  11. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  12. <script src="~/Content/js/select2/select2.min.js"></script>
  13. <script>
  14. var ID = $.request("ID");
  15. $(function () {
  16. if (ID != "") {
  17. $("#WorkPointCode").val(WorkPointCode);
  18. $("#WorkPointName").val(WorkPointName);
  19. $("#ServerName").val(ServerName);
  20. $("#DataBaseName").val(DataBaseName);
  21. $("#DataBaseUser").val(DataBaseUser);
  22. $("#DataBasePwd").val(DataBasePwd);
  23. if (Enable == '是') {
  24. $("#StatusYes").prop("checked", true);
  25. } else {
  26. $("#StatusNo").prop("checked", true);
  27. }
  28. }
  29. });
  30. function submitForm() {
  31. var WorkPointCode = $("#WorkPointCode").val();
  32. var WorkPointName = $("#WorkPointName").val();
  33. var ServerName = $("#ServerName").val();
  34. var DataBaseName = $("#DataBaseName").val();
  35. var DataBaseUser = $("#DataBaseUser").val();
  36. var DataBasePwd = $("#DataBasePwd").val();
  37. var Enable = $('input[name="State"]:checked').val();
  38. if (WorkPointCode == "" || WorkPointCode==undefined) {
  39. $.modalAlert("请先输入站点编号!");
  40. return;
  41. }
  42. if (WorkPointName == "" || WorkPointName == undefined) {
  43. $.modalAlert("请先输入站点名称!");
  44. return;
  45. }
  46. if (ServerName == "" || ServerName == undefined) {
  47. $.modalAlert("请先输入数据库服务器地址!");
  48. return;
  49. }
  50. if (DataBaseName == "" || DataBaseName == undefined) {
  51. $.modalAlert("请先输入数据库名称!");
  52. return;
  53. }
  54. if (DataBaseUser == "" || DataBaseUser == undefined) {
  55. $.modalAlert("请先输入数据库用户名称!");
  56. return;
  57. }
  58. if (DataBasePwd == "" || DataBasePwd == undefined) {
  59. $.modalAlert("请先输入数据库口令!");
  60. return;
  61. }
  62. if (Enable == "" || Enable == undefined) {
  63. $.modalAlert("请选择是否启用!");
  64. return;
  65. }
  66. var objArr = {
  67. ID:ID,
  68. WorkPointCode: WorkPointCode,
  69. WorkPointName: WorkPointName,
  70. ServerName: ServerName,
  71. DataBaseName: DataBaseName,
  72. DataBaseUser: DataBaseUser,
  73. DataBasePwd: DataBasePwd,
  74. Enable: Enable
  75. }
  76. debugger;
  77. if (ID!="") {
  78. $.submitForm({
  79. url: "/WMS/BasicSettings/UpdateICSType" + "?" + Math.random(),
  80. param: { keyValue: JSON.stringify(objArr) },
  81. success: function () {
  82. $.currentWindow().$("#gridList").trigger("reloadGrid");
  83. }
  84. })
  85. } else {
  86. $.submitForm({
  87. url: "/WMS/BasicSettings/InsertICSType" + "?" + Math.random(),
  88. param: { keyValue: JSON.stringify(objArr) },
  89. success: function () {
  90. $.currentWindow().$("#gridList").trigger("reloadGrid");
  91. }
  92. })
  93. }
  94. }
  95. //function ChcekboxChange() {
  96. // debugger;
  97. // $("#changechaeckbox").find("input[type='checkbox']").each(function (i, n) {
  98. // if ($(this).prop('checked') == false) {
  99. // $(this).val("");
  100. // }
  101. // });
  102. </script>
  103. <form id="form1">
  104. <div style="padding-top: 20px; margin-right: 20px;">
  105. <table class="form">
  106. <tr>
  107. <th class="formTitle">站点编号:</th>
  108. <td class="formValue">
  109. <input id="WorkPointCode" name="WorkPointCode" type="text" class="form-control required" style="width: 300px;" maxlength="100" placeholder="站点编号" />
  110. </td>
  111. </tr>
  112. <tr>
  113. <th class="formTitle">站点名称:</th>
  114. <td class="formValue">
  115. <input id="WorkPointName" name="WorkPointName" type="text" class="form-control required" style="width: 300px;" maxlength="100" placeholder="站点名称" />
  116. </td>
  117. </tr>
  118. <tr>
  119. <th class="formTitle">数据库服务器地址:</th>
  120. <td class="formValue">
  121. <input id="ServerName" name="ServerName" type="text" class="form-control required" style="width: 300px;" maxlength="100" placeholder="数据库服务器地址" />
  122. </td>
  123. </tr>
  124. <tr>
  125. <th class="formTitle">数据库名称:</th>
  126. <td class="formValue">
  127. <input id="DataBaseName" name="DataBaseName" type="text" class="form-control required" style="width: 300px;" maxlength="100" placeholder="数据库名称" />
  128. </td>
  129. </tr>
  130. <tr>
  131. <th class="formTitle">数据库用户名称:</th>
  132. <td class="formValue">
  133. <input id="DataBaseUser" name="DataBaseUser" type="text" class="form-control required" style="width: 300px;" maxlength="100" placeholder="数据库用户名称" />
  134. </td>
  135. </tr>
  136. <tr>
  137. <th class="formTitle">数据库口令:</th>
  138. <td class="formValue">
  139. <input id="DataBasePwd" name="DataBasePwd" type="password" class="form-control required" style="width: 300px;" maxlength="100" placeholder="数据库口令" />
  140. </td>
  141. </tr>
  142. <tr>
  143. <td>
  144. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否启用:</label>
  145. </td>
  146. <td>
  147. <div class="input-group" id="changechaeckbox">
  148. <input type="radio" name="State" value="1" id="StatusYes" style="width:30px" onchange="ChcekboxChange()" /><label for="cb-NoQuotedPrice">是</label>
  149. <label style="width:85px"></label>
  150. <input type="radio" name="State" value="0" id="StatusNo" style="width:30px" onchange="ChcekboxChange()" /><label for="cb-QuotedPrice">否</label>
  151. </div>
  152. </td>
  153. <td style="padding-left: 10px;"></td>
  154. </tr>
  155. </table>
  156. </div>
  157. </form>