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.

102 lines
5.5 KiB

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Swift.web.Agent.Default" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  4. <head>
  5. <meta charset="utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1" />
  8. <meta name="description" content="" />
  9. <meta name="author" content="" />
  10. <title><%=Swift.web.Library.GetStatic.ReadWebConfig("companyName","") %> - Agent Login</title>
  11. <link href="../ui/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
  12. <link href="../ui/css/style.css" rel="stylesheet" />
  13. <link href="../ui/font-awesome/css/font-awesome.css" rel="stylesheet" />
  14. </head>
  15. <body>
  16. <div onkeypress="return checkSubmit(event)">
  17. <div class="login-bg">
  18. <div class="over-bg">
  19. <div class="container">
  20. <div class="row">
  21. <div class="account-col">
  22. <div class="login-head">
  23. <h1>Agent Login</h1>
  24. </div>
  25. <div id="msg" runat="server" class="error">
  26. <div class="alert alert-danger" runat="server" id="errMsg" visible="false"></div>
  27. </div>
  28. <div class="login-body">
  29. <form role="form" id="loginForm" runat="server">
  30. <div class="form-group">
  31. <label for="exampleInputAgentId1">Agent ID <span class="notifyRequired">*</span></label>
  32. <asp:TextBox class="form-control" ID="agentCode" placeholder="Enter Agent ID" runat="server" Text="" required="true" autocomplete="off"></asp:TextBox>
  33. </div>
  34. <div class="form-group">
  35. <label for="exampleInputPassword1">Employee ID <span class="notifyRequired">*</span></label>
  36. <asp:TextBox class="form-control" ID="employeeId" runat="server" placeholder="Enter Employee ID" Text="" required="true" autocomplete="off"></asp:TextBox>
  37. </div>
  38. <div class="form-group">
  39. <label for="exampleInputEmail1">User Name <span class="notifyRequired">*</span></label>
  40. <asp:TextBox class="form-control" ID="username" placeholder="Enter Username" TextMode="Password" runat="server" required="true" autocomplete="off"></asp:TextBox>
  41. </div>
  42. <div class="form-group">
  43. <label for="exampleInputPassword1">Password <span class="notifyRequired">*</span></label>
  44. <asp:TextBox class="form-control" ID="pwd" runat="server" TextMode="Password" placeholder="Enter Password" required="true" autocomplete="off"></asp:TextBox>
  45. </div>
  46. <%--<button type="button" class="btn btn-default" id="btnLogin">Submit</button>--%>
  47. <asp:Button ID="btnLogin" class="btn btn-default" runat="server" Text="Submit" OnClick="btnLogin_Click" />
  48. </form>
  49. </div>
  50. <div class="login-logo">
  51. <i class="fa fa-user" aria-hidden="true"></i>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <script type="text/javascript">
  60. function ShowErrorMsg(msg) {
  61. $("#msg").html('<div class="alert alert-danger">' + msg + '</div>');
  62. }
  63. function AjaxAuthenticate() {
  64. var name = $("#username").val();
  65. var pwd = $("#pwd").val();
  66. var code = $("#employeeId").val();
  67. var agentcode = $("#agentCode").val();
  68. $.ajax({
  69. url: '<%= ResolveUrl("Default.aspx") %>',
  70. type: 'POST',
  71. data: { methodName: "GetLogin", username: name, password: pwd, companycode: code },
  72. success: function (result) {
  73. var strng = JSON.stringify(result);
  74. obj = JSON.parse(strng);
  75. if (obj["ErrorCode"] == "1" || obj["ErrorCode"] == "9999") {
  76. $("#msg").html('<div class="alert alert-danger">' + obj["Msg"] + '</div>');
  77. }
  78. else if (obj["isForcePwdChanged"] == "Y") {
  79. window.location.href = "SwiftSystem/UserManagement/ApplicationUserSetup/ChangePassword.aspx";
  80. }
  81. else {
  82. window.location.href = "Dashboard.aspx";
  83. }
  84. },
  85. error: function (result) {
  86. alert("Sorry! Due to unexpected errors operation terminates !");
  87. }
  88. });
  89. }
  90. function checkSubmit(e) {
  91. if (e && e.keyCode == 13) {
  92. document.getElementById("<%=btnLogin.ClientID%>").click();
  93. }
  94. }
  95. </script>
  96. </body>
  97. </html>