private void buttonLogin_Click(object sender, EventArgs e) { string type = "Admin"; string pw = EncryptionDecryption.ComputeSha256Hash(userPw.Text); HttpClient client = new HttpClient(); var uri = new Uri(string.Format("http://apupay.azurewebsites.net/api/Login?username="******"&password="******"&type=" + type)); HttpResponseMessage response; client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); response = client.GetAsync(uri).Result; if (response.StatusCode == System.Net.HttpStatusCode.Accepted) { AdminMenu admin = new AdminMenu { userID = userID.Text }; admin.Show(); this.Hide(); } else { MessageBox.Show("Rejected"); response.Dispose(); client.Dispose(); } }
private void buttonReturn_Click(object sender, EventArgs e) { adminMenu.Show(); this.Close(); }