Beispiel #1
0
        public override IEnumerable <Order> GetOrders(int index, int rows, int providerId, ItemStatus status, string query)
        {
            Uri uri;

            if (string.IsNullOrEmpty(query))
            {
                uri = new Uri(String.Format("{0}/index/{1}/rows/{2}/providerid/{3}/status/{4}", Keys["OrdersUri"], index, rows, providerId, status));
            }
            else
            {
                uri = new Uri(String.Format("{0}/index/{1}/rows/{2}/providerid/{3}/status/{4}/query/{5}", Keys["OrdersUri"], index, rows, providerId, status, query));
            }
            return(HttpFactory.ProcessRequest <IEnumerable <Order>, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #2
0
        public override string SendMessage(Log log)
        {
            Uri uri = new Uri(Keys["SendMessageUri"]);

            return(HttpFactory.ProcessRequest <string, Log>(uri, HttpMethod.POST, log));
        }
Beispiel #3
0
        public override IEnumerable <Blank> GetBlanks(int index, int rows, ItemStatus status)
        {
            Uri uri = new Uri(String.Format("{0}/index/{1}/rows/{2}/status/{3}", Keys["BlanksUri"], index, rows, status));

            return(HttpFactory.ProcessRequest <IEnumerable <Blank>, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #4
0
        public static byte[] ProcessRequest(Uri uri, HttpMethod method)
        {
            HttpFactory factory = new HttpFactory(uri, method);

            return(factory.RequestImage());
        }
Beispiel #5
0
        public override IEnumerable <Ticket> GetTickets(int orderId)
        {
            Uri uri = new Uri(String.Format("{0}/orderId/{1}", Keys["TicketsUri"], orderId));

            return(HttpFactory.ProcessRequest <IEnumerable <Ticket>, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #6
0
        public override IEnumerable <Core.Point> GetMapSeatPoints(int eventId)
        {
            Uri uri = new Uri(String.Format("{0}/eventId/{1}/status/onsale", Keys["MapSeatPointsUri"], eventId));

            return(HttpFactory.ProcessRequest <IEnumerable <Core.Point>, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #7
0
        public override IEnumerable <Hall> GetHallSeats(int eventId, ItemStatus status)
        {
            Uri uri = new Uri(String.Format("{0}/eventId/{1}/status/{2}", Keys["SeatStatsUri"], eventId, status));

            return(HttpFactory.ProcessRequest <IEnumerable <Hall>, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #8
0
        public override IEnumerable <EventDate> GetEvents(int actionId)
        {
            Uri uri = new Uri(String.Format("{0}/actionId/{1}", Keys["EventsUri"], actionId));

            return(HttpFactory.ProcessRequest <IEnumerable <EventDate>, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #9
0
        public override Blank Annul(Blank blank)
        {
            Uri uri = new Uri(Keys["AnnulUri"]);

            return(HttpFactory.ProcessRequest <Blank, Blank>(uri, HttpMethod.DELETE, blank));
        }
Beispiel #10
0
        public override Order Cancel(Order order)
        {
            Uri uri = new Uri(Keys["CancelUri"]);

            return(HttpFactory.ProcessRequest <Order, Order>(uri, HttpMethod.DELETE, order));
        }
Beispiel #11
0
        public override List <Seat> ReleaseSeats(List <Seat> seats)
        {
            Uri uri = new Uri(Keys["ReleaseUri"]);

            return(HttpFactory.ProcessRequest <List <Seat>, List <Seat> >(uri, HttpMethod.DELETE, seats));
        }
Beispiel #12
0
        public override IEnumerable <Provider> GetProviders()
        {
            Uri uri = new Uri(Keys["ProvidersUri"]);

            return(HttpFactory.ProcessRequest <IEnumerable <Provider>, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #13
0
        public override byte[] GetReport(int memberId, string selectedDate)
        {
            Uri uri = new Uri(String.Format("{0}?type={1}&memberId={2}&date={3}", Keys["ReportUri"], "CashierDaily", memberId, selectedDate));

            return(HttpFactory.ProcessRequest(uri, HttpMethod.GET));
        }
Beispiel #14
0
        public override IEnumerable <Ticket> GetReports(string selectedDate)
        {
            Uri uri = new Uri(String.Format("{0}/date/{1}", Keys["ReportsUri"], selectedDate));

            return(HttpFactory.ProcessRequest <IEnumerable <Ticket>, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #15
0
        public override IEnumerable <ShowAction> GetActions(int providerId)
        {
            Uri uri = new Uri(String.Format("{0}/providerId/{1}", Keys["ActionsUri"], providerId));

            return(HttpFactory.ProcessRequest <IEnumerable <ShowAction>, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #16
0
        public override ShowAction GetAction(int actionId)
        {
            Uri uri = new Uri(String.Format("{0}/actionId/{1}", Keys["ActionUri"], actionId));

            return(HttpFactory.ProcessRequest <ShowAction, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #17
0
        public override List <Seat> LockSeats(List <Seat> seats)
        {
            Uri uri = new Uri(Keys["LockUri"]);

            return(HttpFactory.ProcessRequest <List <Seat>, List <Seat> >(uri, HttpMethod.PUT, seats));
        }
Beispiel #18
0
        public override EventDate GetEvent(int eventId)
        {
            Uri uri = new Uri(String.Format("{0}/eventId/{1}", Keys["EventUri"], eventId));

            return(HttpFactory.ProcessRequest <EventDate, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #19
0
        public override Order ConfirmPayment(Order order)
        {
            Uri uri = new Uri(Keys["ConfirmPaymentUri"]);

            return(HttpFactory.ProcessRequest <Order, Order>(uri, HttpMethod.PUT, order));
        }
Beispiel #20
0
        public override byte[] GetSeatingMap(int stageId)
        {
            Uri uri = new Uri(String.Format("{0}/stageId/{1}", Keys["SeatingMapUri"], stageId));

            return(HttpFactory.ProcessRequest(uri, HttpMethod.GET));
        }
Beispiel #21
0
        public override Ticket SetTicketPrinted(Ticket ticket)
        {
            Uri uri = new Uri(Keys["SetTicketPrintedUri"]);

            return(HttpFactory.ProcessRequest <Ticket, Ticket>(uri, HttpMethod.PUT, ticket));
        }
Beispiel #22
0
        public override byte[] GetTicketPrinted(int orderId, int seatId, int formId)
        {
            Uri uri = new Uri(String.Format("{0}/orderId/{1}/seatId/{2}/formId/{3}", Keys["PrintUri"], orderId, seatId, formId));

            return(HttpFactory.ProcessRequest(uri, HttpMethod.GET));
        }
Beispiel #23
0
        public override Member Login(Member member)
        {
            Uri uri = new Uri(String.Format("{0}/login", Keys["LoginUri"]));

            return(HttpFactory.ProcessRequest <Member, Member>(uri, HttpMethod.POST, member));
        }
Beispiel #24
0
        public override Stage GetStage(int stageId)
        {
            Uri uri = new Uri(String.Format("{0}/stageId/{1}", Keys["StageUri"], stageId));

            return(HttpFactory.ProcessRequest <Stage, Type>(uri, HttpMethod.GET, null));
        }
Beispiel #25
0
        public override Order UpdateOrder(Customer customer)
        {
            Uri uri = new Uri(Keys["UpdateOrderUri"]);

            return(HttpFactory.ProcessRequest <Order, Customer>(uri, HttpMethod.POST, customer));
        }
Beispiel #26
0
        /// <summary>
        /// Processes Http Request on remote server
        /// </summary>
        /// <typeparam name="TOutput">Output type</typeparam>
        /// <typeparam name="TInput">Input type</typeparam>
        /// <param name="uri">Destination url</param>
        /// <param name="method">Method to be executed</param>
        /// <param name="t">Input type instance</param>
        /// <returns>Output type instance</returns>
        public static TOutput ProcessRequest <TOutput, TInput>(Uri uri, HttpMethod method, TInput t) where TOutput : class
        {
            HttpFactory factory = new HttpFactory(uri, method);

            return(factory.CreateRequest <TOutput, TInput>(t));
        }
Beispiel #27
0
        public override Customer GetCustomer(int customerId)
        {
            Uri uri = new Uri(String.Format("{0}/customerId/{1}", Keys["CustomerUri"], customerId));

            return(HttpFactory.ProcessRequest <Customer, Type>(uri, HttpMethod.GET, null));
        }