private void removePerson_Click(object sender, EventArgs e) { using (ServiceWCFClient client = new ServiceWCFClient()) { client.Open(); foreach (ListViewItem currentItem in listView1.SelectedItems) { listView1.Items.Remove(currentItem); MessageBox.Show(currentItem.Text.ToString()); client.DoRemoveData(currentItem.Text); } client.Close(); } }
protected void btnLicense_Click(object sender, EventArgs e) { ServiceWCFClient client = new ServiceWCFClient(); RealLicenseWCF obj = new RealLicenseWCF(); obj.LicenseNumber = TextBox1.Text; Session["User"] = client.AuthenticateLicense(obj); client.Close(); if (((Boolean)Session["User"] == true)) { Response.Redirect("~/Success.aspx"); } else { Response.Redirect("~/Expired.aspx"); } }
private void setComboBox() { using (ServiceWCFClient client = new ServiceWCFClient()) { client.Open(); Person[] list = client.DoShowData(); foreach (var p in list) { comboBox1.Items.Add(p.Name); } comboBox1.SelectedItem = list[0].Name; textBox1.Text = list[0].Date.ToString(); textBox2.Text = list[0].Name.ToString(); client.Close(); } }
private void button1_Click(object sender, EventArgs e) { using (ServiceWCFClient client = new ServiceWCFClient()) { client.Open(); Person[] list = client.DoShowData(); foreach (var p in list) { if (String.Compare(p.Name, textBox1.Text) == 0) { p.Name = textBox1.Text; p.Date = DateTime.Parse(textBox2.Text); } comboBox1.Items.Add(p.Name); } comboBox1.SelectedItem = list[0].Name; ClientForm form = new ClientForm(); form.AddDataGrid(); client.Close(); } }
public void AddDataGrid() { using (ServiceWCFClient client = new ServiceWCFClient()) { client.Open(); Person[] list = client.DoShowData(); foreach (var p in list) { ListViewItem item = new ListViewItem(p.Id.ToString()); //ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem(); //ListViewItem.ListViewSubItem subItemNext = new ListViewItem.ListViewSubItem(); //item.Text = p.Id.ToString(); //subItem.Text = p.Date.ToString(); //subItemNext.Text = p.Name; item.SubItems.Add(p.Date.ToString()); item.SubItems.Add(p.Name); listView1.Items.Add(item); } client.Close(); } }