protected void btnSubmit_Click(object sender, EventArgs e) { CalculatorWebServiceSoapClient cal = new CalculatorWebServiceSoapClient(); lblResult.Text = cal.Add(Convert.ToInt32(txtNumber1.Text), Convert.ToInt32(txtNumber2.Text)).ToString(); gvRecentCalc.DataSource = cal.GetCalc(); gvRecentCalc.DataBind(); gvRecentCalc.HeaderRow.Cells[0].Text = "Recent Calc"; }
public PartialViewResult Add(int firstNumber, int secondNumber) { CalculatorWebServiceSoapClient client = new CalculatorWebServiceSoapClient(); AddViewModel model = new AddViewModel(); model.Result = client.Add(firstNumber: firstNumber, secondNumber: secondNumber); model.RecentCalculations = client.GetCalculations(); return(PartialView("Add", model)); }
protected void btnAdd_Click(object sender, EventArgs e) { CalculatorWebServiceSoapClient client = new CalculatorWebServiceSoapClient(); int result = client.Add(Convert.ToInt32(txtFirstNumber.Text), Convert.ToInt32(txtSecondNumber.Text)); lblResult.Text = result.ToString(); gvCalculations.DataSource = client.GetCalculations(); gvCalculations.DataBind(); gvCalculations.HeaderRow.Cells[0].Text = "Son Hesaplamalar"; }