private void buttonLogin_Click(object sender, EventArgs e) { museid = this.textBoxUser.Text; ParameterUrl LoginPHP = new ParameterUrl(); LoginPHP.musename = museid; LoginPHP.password = password; LoginPHP.mode = API_MODE.LOGIN; LoginPHP.timeout = 300000; LoginPHP.url = string.Format("{0}{1}", mainUrl, "login.php").Trim(); LoginPHP.method = API_METHOD.POST; try { RESPONSE_FEEDBACK response = new NetworkManager().Connect(LoginPHP); if (response.status == false) { throw new Exception(string.Format("Login Failed. {0}", response.message)); } status = response.status; actionTaken = DialogStep.BYPASS; DialogDashboard.RunLoop("MainForm"); } catch (Exception ex) { DialogDashboard.Append(Level.Error, String.Format("what:{0} {1}", ex.HelpLink, ex.Message)); } }
private void buttonLogout_Click(object sender, EventArgs e) { ParameterUrl Logout = new ParameterUrl(); Logout.musename = activeUser; Logout.password = ""; Logout.mode = API_MODE.LOGOUT; Logout.timeout = 300000; Logout.url = string.Format("{0}{1}", mainUrl, "logout.php").Trim(); Logout.method = API_METHOD.POST; try { RESPONSE_FEEDBACK response = new NetworkManager().Connect(Logout); if (response.status == false) { throw new Exception(string.Format("Logout Failed. {0}", response.message)); } else { status = response.status; } ActionTaken = DialogStep.LOGIN; MainDashboard.RunLoop("BypassForm"); } catch (Exception ex) { MainDashboard.Append(Level.Error, String.Format("what:{0} {1}", ex.HelpLink, ex.Message)); } }
private void buttonCancel_Click(object sender, EventArgs e) { actionTaken = DialogStep.LOGIN; DialogLogging.RunLoop("RegisterForm"); }