function ServiceLogin() { debugger; var isValidated = true; var txtEmail = $("#txtEmail").val(); var txtpassword = $("#txtpassword").val(); var isEmailId = IsValidateEmail(txtEmail); var isMobile = IsMobileNumber(txtEmail); if (isValidated == true && isEmailId == false && isMobile == false) { isValidated = false; alert("Invalid Login Id! Use Email Id"); } else if (isValidated == true && txtpassword.length == 0) { isValidated = false; alert("Enter Password"); } if (isValidated == true) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", dataType: "json", url: "PService.asmx/WebLogin", data: "{'userId_':'" + txtEmail + "','password_':'" + txtpassword + "'}", success: function (response) { if (response.d != null) { $(".wait-ripple").hide(); var resArray = response.d.split('|'); if (resArray[0] == "Error") { alert(resArray[1]); } else { window.location.href = response.d; } } }, beforeSend: function (XMLHttpRequest) { $(".wait-ripple").show(); }, error: function (xmlHttpRequest, status, err) { } }); } return isValidated; } function ServiceLoginType() { var isValidated = true; var txtEmail = $("#txtEmail").val(); var txtpassword = $("#txtpassword").val(); var userType = $("#selUserType option:selected").val(); var isEmailId = IsValidateEmail(txtEmail); var isMobile = IsMobileNumber(txtEmail); if (userType == "Default") { isValidated = false; alert("Select User Type"); } else if (isValidated == true && isEmailId == false && isMobile == false) { isValidated = false; alert("Invalid Login Id! Use Email Id"); } else if (isValidated == true && txtpassword.length == 0) { isValidated = false; alert("Enter Password"); } if (isValidated == true) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", dataType: "json", url: "PService.asmx/ACLogin", data: "{'userId_':'" + txtEmail + "','password_':'" + txtpassword + "','userType_':'" + userType + "'}", success: function (response) { if (response.d != null) { $(".wait-ripple").hide(); var resArray = response.d.split('|'); if (resArray[0] == "Error") { alert(resArray[1]); } else { window.location.href = response.d; } } }, beforeSend: function (XMLHttpRequest) { $(".wait-ripple").show(); }, error: function (xmlHttpRequest, status, err) { } }); } return isValidated; } function ValidateForget() { var forgetItem = $("#txtForget").val(); if (IsValidateEmail(forgetItem) == false) { alert("Invalid Login Id"); return false; } else { $(".wait-ripple").show(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", dataType: "json", url: "PService.asmx/ForgetMyPassword", data: "{'emailId_':'" + forgetItem + "'}", success: function (response) { if (response.d != null) { alert(response.d); } $(".wait-ripple").hide(); }, beforeSend: function (XMLHttpRequest) { $(".wait-ripple").show(); }, error: function (xmlHttpRequest, status, err) { } }); } } function IsValidateEmail(sEmail) { var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; if (filter.test(sEmail)) { return true; } else { return false; } } function IsMobileNumber(txtMobile_) { var mob = /^[1-9]{1}[0-9]{9}$/; if (mob.test(txtMobile_) == false) { return false; } return true; }