Beispiel #1
0
        // POST: api/TicketA
        public HttpResponseMessage Post(AddTicketToAgent value)
        {
            var ticketManagerResponse = ticketManagerService.AddOrIssue(new TicketsIssued {
                AgentCode = value.agentCode, TicketNumber = value.ticketNumber
            });

            if (ticketManagerResponse.IsASuccess)
            {
                return(Request.CreateResponse(HttpStatusCode.Created));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.NotAcceptable, new HttpError(ticketManagerResponse.Errors.First())));
            }
        }
 public ActionResult Create(TicketDetailsViewModel data)
 {
     ticketService.AddOrIssue(data.TicketDetails);
     return(RedirectToAction("index"));
 }