Exemplo n.º 1
0
        public async Task <IActionResult> AddClientDetails(EventClientVM _eventClient)
        {
            bool flag = true;

            try
            {
                await mediator.Send(new AddClientDetailsCommand
                {
                    EventClient = _eventClient
                });
            }
            catch (Exception)
            {
                flag = false;
            }

            return(Json(flag));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> EventDetails(int EventID, int ClientID)
        {
            if (EventID == 0 || ClientID == 0)
            {
                return(RedirectToAction("Index"));
            }

            var account = await HttpContext.GetLoggedInUser();

            var clientResponse = await _eventiApi.GetClientAsync(new ClientSearchRequest()
            {
                AccountID = account.ID
            });

            var Client = clientResponse.Content.Data.ToList()[0];


            var eventResponse = await _eventiApi.GetEventAsync(EventID);

            var Event = eventResponse.Content;


            EventClientVM model = new EventClientVM {
                EventID         = Event.ID,
                Name            = Event.Name,
                Category        = Event.EventCategory.ToString(),
                Description     = Event.Description,
                Start           = Event.Start,
                End             = Event.End,
                Image           = Event.Image,
                ClientID        = Client.ID,
                ClientFirstName = Client.FirstName,
                ClientLastName  = Client.LastName,
                ClientAddress   = Client.Address
            };

            return(View(model));
        }