public ActionResult Index() { CalculatorWebServiceSoapClient client = new CalculatorWebServiceSoapClient(); List <string> model = model = client.GetCalculations(); return(View(model)); }
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"; }