public void Get_Connection()
        {
            try
            {
                label1.Text = "";

                ConnectionInfoRequest  connectionInfoRequest  = new ConnectionInfoRequest();
                ConnectionInfoResponse connectionInfoResponse = new ConnectionInfoResponse();


                connectionInfoRequest.AgentId        = 15;
                connectionInfoRequest.AgentPassword  = "******";
                connectionInfoRequest.RMSClientNo    = 3038;
                connectionInfoRequest.ClientPassword = "******";

                //pass conInfo and get info and store to a variable
                connectionInfoResponse = client.GetConnectionInfo(connectionInfoRequest);


                // 'The secret token for this Client/Agent combination. This should be refreshed every hour
                _Token = connectionInfoResponse.Token;

                // Create an instance of the public service client with the correct endpoint URL for this client
                _PublicServiceClient = GetPublicWebServiceClientInstance(connectionInfoResponse.WebserviceURL);


                label1.Text = client.TestCall();
            }

            catch (Exception ex)
            {
                label1.Text = "Error:" + ex.Message;
            }
        }
Beispiel #2
0
        public ActionResult Details(int id)
        {
            PublicServiceClient client = new PublicServiceClient();

            var e         = client.GetById(id);
            var eventInfo = client.GetEventInfo(id);

            var evm = new EventViewModel()
            {
                Id             = id,
                Name           = e.Name,
                Description    = e.Description,
                DateTimeStart  = e.DateTimeStart,
                DateTimeFinish = e.DateTimeFinish,
                ImageUrl       = e.ImageUrl,
                LayoutId       = e.LayoutId,

                VenueName         = eventInfo.VenueName,
                VenueDescription  = eventInfo.VenueDescription,
                VenueAddress      = eventInfo.VenueAddress,
                VenuePhone        = eventInfo.VenuePhone,
                LayoutName        = eventInfo.LayoutName,
                LayoutDescription = eventInfo.LayoutDescription,

                EventAreaDTOs = client.GetAllEventAreasDTOByEventId(e.Id).ToList(),
                EventSeatDTOs = client.GetAllEventSeatDTOByEventId(e.Id).ToList()
            };

            client.Close();
            return(View(evm));
        }
Beispiel #3
0
        public string GetBusinessObject(string ModeCode)
        {
            if (PublicInterfaceClient == null)
            {
                PublicInterfaceClient = new PublicServiceClient();
            }
            string BusinessObject = PublicInterfaceClient.GetBusinessObject("FB", ModeCode);

            return(BusinessObject);
        }
Beispiel #4
0
        public Main()
        {
            // Tcp: All communication to the Service Bus is performed using outbound TCP connections.
            // Http: All communication to Service Bus is performed using outbound HTTP connections.
            // AutoDetect: The Service bus client automatically selects between TCP and HTTP connectivity.
            Microsoft.ServiceBus.ServiceBusEnvironment.SystemConnectivity.Mode =
                Microsoft.ServiceBus.ConnectivityMode.AutoDetect;

            this.client = new PublicServiceClient();
            this.InitializeComponent();
        }
Beispiel #5
0
        public ActionResult Index(int?page)
        {
            PublicServiceClient client = new PublicServiceClient();

            var events = client.GetAll().Where(x => x.DateTimeStart > DateTime.Now).OrderBy(x => x.DateTimeStart);
            var list   = new List <EventViewModel>();

            foreach (var e in events)
            {
                var eventInfo = client.GetEventInfo(e.Id);

                list.Add(new EventViewModel
                {
                    Id             = e.Id,
                    Name           = e.Name,
                    Description    = e.Description,
                    DateTimeStart  = e.DateTimeStart,
                    DateTimeFinish = e.DateTimeFinish,
                    ImageUrl       = e.ImageUrl,
                    LayoutId       = e.LayoutId,

                    VenueName         = eventInfo.VenueName,
                    VenueDescription  = eventInfo.VenueDescription,
                    VenueAddress      = eventInfo.VenueAddress,
                    VenuePhone        = eventInfo.VenuePhone,
                    LayoutName        = eventInfo.LayoutName,
                    LayoutDescription = eventInfo.LayoutDescription,

                    EventAreaDTOs = client.GetAllEventAreasDTOByEventId(e.Id).ToList(),
                    EventSeatDTOs = client.GetAllEventSeatDTOByEventId(e.Id).ToList()
                });
            }

            int pageSize   = 10;
            int pageNumber = (page ?? 1);

            client.Close();
            return(View(list.ToPagedList(pageNumber, pageSize)));
        }
 public Main()
 {
     this.client = new PublicServiceClient();
     this.InitializeComponent();
 }