Esempio n. 1
0
        public IActionResult ConnectRouteToClient(RouteVM routeVM)
        {
            //if (ModelState.IsValid)
            if (true)
            {
                try
                {
                    var route = _mapper.Map <Route>(routeVM);

                    var newClient = _routeApplicationService.ConnectRouteToClient(null);

                    if (newClient.Count > 0)
                    {
                        return(Ok(newClient));
                    }
                    else
                    {
                        return(NotFound());
                    }
                }
                catch (Exception ex)
                {
                    return(BadRequest(ex.Message));
                }
            }
        }
Esempio n. 2
0
        public ActionResult PutAjaxHandlerAddClients(string[] clientsIDs)
        {
            try
            {
                JsonSerialize jsonS         = new JsonSerialize();
                var           routeClientVM = jsonS.JsonDeserialize <RouteClientVM>(clientsIDs[0]);

                _routeApplicationService.ConnectRouteToClient(routeClientVM);

                return(Json(new
                {
                    success = true,
                    Message = "OK"
                }));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }