public ActionResult Create(RequestViewModel requestVM)
        {
            int requestId = requestService.CreateRequest(requestVM.Subject, requestVM.InitMessage.Text);

            // await Response.WriteAsync($"<script language='javascript'>window.alert('Your request ID is  {requestId}');</script>");
            return(RedirectToAction(nameof(Index), new { lastRequestId = requestId }));
        }
예제 #2
0
        public Result <int> Post([FromBody] RequestForAddModel newRequest)
        {
            if (newRequest == null)
            {
                return(Result <int> .InvalidData);
            }
            int requestId = requestManagementService.CreateRequest(newRequest.Subject, newRequest.InitMessage);

            return(new Result <int>(requestId)
            {
                MessageType = MessageType.Ok, MessageText = $"Request was successfully created with id {requestId}"
            });
            // return CreatedAtRoute(nameof(GetByID), new { id = requestId }, newRequest);
        }