public void DodajVozaca(int id, string ime, char[] oznaka, string prezime) { foreach (RoleInstance instance in RoleEnvironment.Roles[RoleEnvironment.CurrentRoleInstance.Role.Name].Instances) { if (instance.Id == RoleEnvironment.CurrentRoleInstance.Id && 0 <= RoleEnvironment.Roles[RoleEnvironment.CurrentRoleInstance.Role.Name].Instances.IndexOf(instance) && RoleEnvironment.Roles[RoleEnvironment.CurrentRoleInstance.Role.Name].Instances.IndexOf(instance) <= 1) { IBlue1_Partial proxy = new ChannelFactory <IBlue1_Partial>(binding, new EndpointAddress(String.Format("net.tcp://{0}/{1}", instance.InstanceEndpoints[internalEndpoints].IPEndpoint.ToString(), internalEndpoints))).CreateChannel(); proxy.DodajVozaca(id, ime, oznaka, prezime); return; } } TableRepositoryVozac table = new TableRepositoryVozac(); table.AddOrReplaceVozac(new ServiceData.Vozac(id.ToString(), ime, oznaka, prezime)); }
public void DodajVozaca(int id, string ime, char[] oznaka, string prezime) { TableRepositoryVozac table = new TableRepositoryVozac(); table.AddOrReplaceVozac(new ServiceData.Vozac(id.ToString(), ime, oznaka, prezime)); }