コード例 #1
0
        public void DodajAutobus(int id, string oznaka)
        {
            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.DodajAutobus(id, oznaka);

                    return;
                }
            }

            TableRepositoryAutobus table = new TableRepositoryAutobus();

            table.AddOrReplaceAutobus(new Autobus(id.ToString(), oznaka));
        }
コード例 #2
0
        public void DodajAutobus(int id, string oznaka)
        {
            TableRepositoryAutobus table = new TableRepositoryAutobus();

            table.AddOrReplaceAutobus(new Autobus(id.ToString(), oznaka));
        }