protected void pushLoginButton_Click(object sender, EventArgs e) { if (!username.Text.Equals("")) { try { if (Session["appToken"] == null) { Session["appToken"] = AppMethods.GetApplicationToken(); } else { string session = HttpContext.Current.Session.SessionID; bool pushLogin = AppMethods.PushLogin(username.Text, Session["session"].ToString(), Session["appToken"].ToString()); if (pushLogin) { Session["username"] = username.Text.ToString(); ClientAdapter.Instance.Join(session); Session["session"] = session; } } } catch (Exception) { } } }
protected void Page_Load(object sender, EventArgs e) { try { string tracker = Request.QueryString["tracker"]; string username = Request.QueryString["account"]; if (username != null && !username.Equals("")) { if (AppMethods.TrackerIdValidation(username, tracker, AppMethods.GetApplicationToken())) { Session["username"] = username; Response.Redirect("/Default.aspx"); } else { Response.Write("tracker data or account information cannot get."); } } } catch (Exception) { Response.Write("tracker data or account information cannot get."); throw; } }
protected void registerByAdmin_Click(object sender, EventArgs e) { if (Session["appToken"] != null) { if (!email.Text.Equals("")) { bool registrationResult = AppMethods.RegistrationByAdmin(email.Text, adAccount1.Checked, accountOwner.Text, Session["appToken"].ToString()); if (registrationResult) { Session["username"] = email.Text.ToString(); } registrationWarning.Text = AppMethods.ErrMessage; } else { registrationWarning.Text = "Please enter e-mail."; } } else { Response.Write("Session Expired!"); Response.Redirect("/Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { Session["companyToken"] = AppMethods.GetCompanyToken() != null?AppMethods.GetCompanyToken() : null; if (Session["companyToken"] == null) { Response.Write("company token cannot given."); } }
protected void removeAccount_Click(object sender, EventArgs e) { if (Session["companyToken"] != null) { bool removeAccountResult = AppMethods.RemoveAccount(removeUsername.Text, Session["companyToken"].ToString()); removeAccountWarning.Text = AppMethods.ErrMessage; } else { removeAccountWarning.Text = "Session Expired!!"; } }
protected void verifyAccount_Click(object sender, EventArgs e) { if (Session["companyToken"] != null) { bool verifyAccountResult = AppMethods.VerifyAccount(verifyUsername.Text, isadaccount.Checked, accountownerverify.Text, Session["companyToken"].ToString()); verifyAccountWarning.Text = AppMethods.ErrMessage; } else { verifyAccountWarning.Text = "Session Expired!!"; } }
protected void getRegistrationAndLoginBarcode_Click(object sender, EventArgs e) { if (Session["appToken"] != null && !Session["appToken"].Equals("")) { registerBarcode.ImageUrl = null; string session = HttpContext.Current.Session.SessionID; registerBarcode.ImageUrl = AppMethods.GetBarcodeImage(Session["appToken"].ToString(), session, "ILIR"); ClientAdapter.Instance.Join(session); Session["sessionIR"] = session; } else { Response.Write("Session Expired!"); Response.Redirect("/Login.aspx"); } }
protected void addAccount_Click(object sender, EventArgs e) { if (!username.Text.Equals("")) { if (Session["companyToken"] != null) { bool addAccountResult = AppMethods.AddAccount(username.Text, grouplist.Text, accountowner.Text, Session["companyToken"].ToString()); addAccountWarning.Text = AppMethods.ErrMessage; } else { addAccountWarning.Text = "Session Expired!!"; } } else { addAccountWarning.Text = "username is required!"; } }
protected void Page_Load(object sender, EventArgs e) { Message message = new Message(); message.reqSession = Request.Headers["session"]; message.reqTracker = Request.Headers["tracker"]; message.reqUsername = Request.Headers["username"]; if (!AppMethods.TrackerIdValidation(message.reqUsername, message.reqTracker, AppMethods.GetApplicationToken())) { return; } else { if (!string.IsNullOrWhiteSpace(message.reqSession) && !string.IsNullOrEmpty(message.reqTracker) && !string.IsNullOrEmpty(message.reqUsername)) { ClientAdapter.Instance.SendMessage(message); } } }
protected void unregister_Click(object sender, EventArgs e) { if (Session["appToken"] != null && Session["username"] != null) { bool unregisterResult = AppMethods.UnRegistration(Session["username"].ToString(), Session["appToken"].ToString()); if (unregisterResult) { unregisterWarning.Text = AppMethods.ErrMessage; Session.Clear(); } else { unregisterWarning.Text = AppMethods.ErrMessage; } } else { unregisterWarning.Text = AppMethods.ErrMessage; } }
protected void Page_Load(object sender, EventArgs e) { try { Session["appToken"] = AppMethods.GetApplicationToken(); if (Session["appToken"] != null && !Session["appToken"].Equals("")) { string session = HttpContext.Current.Session.SessionID; barcodeImageGrid.ImageUrl = AppMethods.GetBarcodeImage(Session["appToken"].ToString(), session, "IL"); ClientAdapter.Instance.Join(session); Session["session"] = session; string bluetoothImage = AppMethods.GetBarcodeImage(Session["appToken"].ToString(), HttpContext.Current.Session.SessionID, "BT"); ltlProximity.Text = "<iframe name='we' id='12' frameborder='no' scrolling='auto' height='200px' width='100%' src='" + bluetoothImage + "' style='left:0; background-color:#B8B8B8;visibility: hidden;'></iframe>"; } else { Response.Write("Session Expired!"); } } catch (Exception) {} }
protected void login_Click(object sender, EventArgs e) { if (!username.Text.Equals("") && !otp.Text.Equals("")) { if (Session["appToken"] != null) { bool otpResult = AppMethods.OTPCheck(username.Text, otp.Text, Session["appToken"].ToString()); if (otpResult) { Session["username"] = username.Text.ToString(); Response.Redirect("/Default.aspx"); } else { loginWarning.Text = AppMethods.ErrMessage; } } else { loginWarning.Text = AppMethods.ErrMessage; } } }
protected void registerByUser_Click(object sender, EventArgs e) { if (Session["appToken"] != null) { if (!username.Text.Equals("") && !saaspassId.Text.Equals("") && !otp.Text.Equals("")) { bool registrationResult = AppMethods.RegistrationByUser(username.Text, adAccount2.Checked, saaspassId.Text, otp.Text, Session["appToken"].ToString()); if (registrationResult) { Session["username"] = username.Text.ToString(); } registrationWarning.Text = AppMethods.ErrMessage; } else { registrationWarning.Text = "Please enter username, saaspassId and one time password"; } } else { Response.Write("Session Expired!"); Response.Redirect("/Login.aspx"); } }