protected void Page_Load(object sender, EventArgs e) { WebService1SoapClient client = new WebService1SoapClient(); int sum = client.Add(1, 4); Response.Write(sum); }
// GET: Default public ActionResult Index() { ServiceReference1.WebService1SoapClient obj = new WebService1SoapClient(); ViewBag.Add = obj.Add(10, 20); return(View()); }
// GET: Employee public ActionResult Index() { WebService1SoapClient obj = new WebService1SoapClient(); ViewBag.result = obj.Add(19, 20); ServiceReference2.Service1Client obj1 = new ServiceReference2.Service1Client(); ViewBag.result2 = obj1.Add(2, 8); return(View(db.GetEmployee())); }
//正常的方式调用 protected void Button1_Click(object sender, EventArgs e) { var soap = new WebService1SoapClient(); Label1.Text = soap.Add(1, 2).ToString(); var list = soap.NonExecuateTask(); GridView1.DataSource = list; GridView1.DataBind(); }
private void button1_Click(object sender, EventArgs e) { WebService1SoapClient LocalWS = new WebService1SoapClient(); if (textBox1.Text == string.Empty || textBox2.Text == string.Empty) { return; } double s1 = double.Parse(textBox1.Text); double s2 = Convert.ToDouble(this.textBox2.Text.ToString()); this.textBox3.Text = LocalWS.Add(s1, s2).ToString(); }
private void btnAdd_Click(object sender, EventArgs e) { if (txtBoxNum1.Text == "" || txtBoxNum2.Text == "") { MessageBox.Show("Please add values in both fields."); } else { int a = Convert.ToInt32(txtBoxNum1.Text); int b = Convert.ToInt32(txtBoxNum2.Text); int ans = obj.Add(a, b); MessageBox.Show("The two numbers added equal to " + ans); } }
public ActionResult Add(StudentModel m) { band();//绑定下拉 m.Swei = 0; m.Stimes = DateTime.Now; var d = client.Add(m); if (d == 1) { return(Content("<script>alert('添加成功!');location.href='/Stu/Show'</script>")); } else { return(Content("<script>alert('添加失败!')</script>")); } }