static void Main(string[] args) { ServiceReference1.MyServiceClient proxy = new ServiceReference1.MyServiceClient(); var result = proxy.DoWork(); Console.WriteLine(string.Format("Server Returned: {0}",result)); Console.ReadLine(); }
public Form1() { InitializeComponent(); toolStripStatusLabel1.Text = "Disconnected."; groupBox2.Enabled = false; InstanceContext context = new InstanceContext(this); _client = new WCF.Eventing.Client.ServiceReference1.MyServiceClient(context); WSDualHttpBinding _binding = _client.Endpoint.Binding as WSDualHttpBinding; _binding.ClientBaseAddress = new Uri(_binding.ClientBaseAddress.ToString() + Guid.NewGuid().ToString()); }
public ActionResult Edit(int id) { ServiceReference1.MyServiceClient ur = new ServiceReference1.MyServiceClient(); var a = ur.getthelasttoabyid(id); ServiceReference1.ToaThuoc l = ur.chitiettoa(a); ViewBag.bacsi = ur.getbacsi((Int32)ur.getphieukham((Int32)l.MaPhieuKham).MaBacSi); ViewBag.benhnhan = ur.GetAllUserById((Int32)ur.getphieukham((Int32)l.MaPhieuKham).MaBenhNhan); ViewBag.chitiet = ur.getallchitiettoathuocbytoa(l.MaToaThuoc).ToList(); ViewBag.toa = l; return(View()); }
public HomeController() { ur = new ServiceReference1.MyServiceClient(); }
private void btnSend_Click(object sender, EventArgs e) { try { if (txtMsg.Text.Trim().Length != 0) { _client.SendMessage(txtName.Text, txtMsg.Text); txtMsg.Clear(); } } catch { string errormsg = "The id you have chosen is already in use ! Please enter a different chat name and join."; MessageBox.Show(errormsg,"Identitity Error", MessageBoxButtons.OK, MessageBoxIcon.Error); toolStripStatusLabel1.Text = "Disconnected."; groupBox1.Enabled = true; groupBox2.Enabled = false; txtName.Clear(); InstanceContext context = new InstanceContext(this); _client = new WCF.Eventing.Client.ServiceReference1.MyServiceClient(context); } }
public ActionResult Edit(int id, FormCollection f) { ServiceReference1.MyServiceClient ur = new ServiceReference1.MyServiceClient(); ur.thanhtoanphieu(id); return(RedirectToAction("Index")); }
static void Main(string[] args) { ServiceReference1.MyServiceClient client = new ServiceReference1.MyServiceClient(); var result = client.DoWork("Hej", "Test"); }