protected void LoginButton_Click(object sender, EventArgs e) { CombineSoapService.Service1Client proxy = new CombineSoapService.Service1Client(); if (!string.IsNullOrWhiteSpace(TextBox1.Text) && !string.IsNullOrWhiteSpace(TextBox2.Text)) { bool[] login = proxy.LoginService(TextBox1.Text, TextBox2.Text); if (login[0] && login[1]) { ResultLabel.Text = "Login sucessful!"; } else if (login[0] && !login[1]) { ResultLabel.Text = "Wrong Password!"; } else if (!login[0]) { ResultLabel.Text = "Account does not exits! Please create new account."; } else { ResultLabel.Text = "something I did not know ?"; } } else { ResultLabel.Text = "Please enter Info!"; } }
protected void PopulationButton_Click(object sender, EventArgs e) { CombineSoapService.Service1Client proxy = new CombineSoapService.Service1Client(); if (!string.IsNullOrWhiteSpace(LocationNameBox.Text)) { ResultRainCondition.Text = proxy.RainFall(LocationNameBox.Text); } else { ResultRainCondition.Text = "Please enter Location!"; } }
protected void Button1_Click(object sender, EventArgs e) { CombineSoapService.Service1Client proxyNH = new CombineSoapService.Service1Client(); try { if (String.IsNullOrWhiteSpace(LattitudeBox.Text) && String.IsNullOrWhiteSpace(LongtitudeBox.Text)) { RRRLabel.Text = "Please enter value in both boxs."; } else if (string.IsNullOrWhiteSpace(LongtitudeBox.Text)) { RRRLabel.Text = "Please enter value in longitude box."; } else if (string.IsNullOrWhiteSpace(LattitudeBox.Text)) { RRRLabel.Text = "Please enter value in latitude box."; } else { decimal lat = Convert.ToDecimal(LattitudeBox.Text); decimal lon = Convert.ToDecimal(LongtitudeBox.Text); if ((lon <= -180 || lon >= 180) && (lat <= -90 || lat >= 90)) { RRRLabel.Text = "Invalid for longtitude and Latitude!" + " Valid latitude are -90 <= latitude <= 90 and " + "longtitude are -180 <= longitude <= 180 "; } else if (lon <= -180 || lon >= 180) { RRRLabel.Text = "Invalid for longtitude, Valid values are -180 <= longitude <= 180"; } else if (lat <= -90 || lat >= 90) { RRRLabel.Text = "Invalid for latitude,Valid values are -90 <= latitude <= 90"; } else { decimal result = proxyNH.NaturalHazards(lat, lon); RRRLabel.Text = result.ToString(); } } } catch (Exception ec) { RRRLabel.Text = "Error input!"; } }
protected void CreatedButton_Click(object sender, EventArgs e) { CombineSoapService.Service1Client proxy = new CombineSoapService.Service1Client(); if (!string.IsNullOrWhiteSpace(UsernameBox.Text) && !string.IsNullOrWhiteSpace(PasswordBox.Text)) { bool create = proxy.AccontService(UsernameBox.Text, PasswordBox.Text); if (create) { ResultLabel.Text = "Account creates sucessful."; } else { ResultLabel.Text = "Username already exit, please enter different username."; } } else { ResultLabel.Text = "Please enter your infomation. "; } }
protected void Button1_Click(object sender, EventArgs e) { CombineSoapService.Service1Client proxy = new CombineSoapService.Service1Client(); string[] inputRe; string[] result; List <string> resultList = new List <string>(); string output = ""; try { if (string.IsNullOrWhiteSpace(InputNewForcusBox.Text)) { OutOutNewForcusBox.Text = "Please type Input!"; } else { List <string> strinList = new List <string>(); foreach (string item in InputNewForcusBox.Text.Split(',')) { strinList.Add(item); } inputRe = strinList.ToArray(); result = proxy.NewsForcusService(inputRe); resultList = result.ToList(); string newLine = Environment.NewLine; for (int i = 0; i < result.Length; i++) { output = output + (i + 1).ToString() + ": " + result[i] + newLine; } OutOutNewForcusBox.Text = output; } } catch (Exception ec) { OutOutNewForcusBox.Text = "Error !"; } }