Esempio n. 1
0
        public async Task <RO <object> > CustomerEvents([FromBody] CustomerEventsData events)
        {
            // if events.Client.Customerkey = "ALL" - return all clients - all events
            var ro = new RO <object>();

            if (ModelState.IsValid)
            {
                                #if SESAM
                VendorInterface vendor = new VendorInterface();
                ro = await vendor.CustomerEvents(events);
                                #else
                var eventsList = await VendorDL.GetCustomerEvents(events);

                var ro = new RO <CustomerEventList>
                {
                    ReturnCode  = 0,
                    ReturnValue = eventsList
                };
                return(ro);
                                #endif
            }
            else
            {
                var message = string.Join(" | ", ModelState.Values.SelectMany(v => v.Errors).Select(e => e.ErrorMessage));
                ro.ReturnCode = 100;
                ro.Message    = "Bad request - CustomerEvents - Incorrect parameters:" + " - " + events.CustomerKey + "/" + events.FromDate + "/" + events.ToDate;
            }
            return(ro);
        }