public ActionResult DodajVozaca(int ID, string Ime, string Oznaka, string Prezime) { Task.Factory.StartNew(() => { NetTcpBinding binding = new NetTcpBinding(); EndpointAddress address1 = new EndpointAddress("net.tcp://localhost:8951/InputRequest_Blue"); ChannelFactory <IBlue1> channelFactory = new ChannelFactory <IBlue1>(binding, address1); IBlue1 proxy = channelFactory.CreateChannel(); proxy.DodajVozaca(Convert.ToInt32(ID), Ime, Oznaka.ToCharArray(), Prezime); }); return(RedirectToAction("Index")); }
public ActionResult DodajAutobus(int id, string oznaka) { Task.Factory.StartNew(() => { NetTcpBinding binding = new NetTcpBinding(); EndpointAddress address1 = new EndpointAddress("net.tcp://localhost:8951/InputRequest_Blue"); ChannelFactory <IBlue1> channelFactory = new ChannelFactory <IBlue1>(binding, address1); IBlue1 proxy = channelFactory.CreateChannel(); proxy.DodajAutobus(Convert.ToInt32(id), oznaka); }); return(RedirectToAction("Vozac")); }