private void GetCounters() { using (localhost.CountersServiceClient proxy = new CountersClient.localhost.CountersServiceClient()) { this.bindingSource1.DataSource = proxy.GetCounters(); } }
private void button3_Click(object sender, EventArgs e) { try { using (localhost.CountersServiceClient proxy = new CountersClient.localhost.CountersServiceClient()) { proxy.ResetCounters(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } GetCounters(); }
private void button2_Click(object sender, EventArgs e) { try { using (TransactionScope scope = new TransactionScope()) { using (localhost.CountersServiceClient proxy = new CountersClient.localhost.CountersServiceClient()) { proxy.SetCounter1(int.Parse(this.txtCounter.Text)); proxy.SetCounter2(int.Parse(this.txtCounter.Text)); } scope.Complete(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } GetCounters(); }