Exemplo n.º 1
0
        // GET: Comment/Edit/5
        public ActionResult Edit(int id, int billTo, int shipTo, int centerNumber, int routePlanId, int stopNumber, string comment, string category, bool isInternal, string screen)
        {
            var model = new UpdateRouteCommentModel
            {
                CommentId    = id,
                IsInternal   = isInternal,
                Category     = category,
                LongComment  = comment,
                BillTo       = billTo,
                ShipTo       = shipTo,
                CenterNumber = centerNumber,
                RoutePlanId  = routePlanId,
                StopNumber   = stopNumber,
                Screen       = screen
            };

            return(PartialView("_edit", model));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Edit(int id, UpdateRouteCommentModel comment)
        {
            try
            {
                var oldComment = new RouteCommentViewModel(await CommentService.GetByCommentIdAsync(id));
                await CommentService.UpdateCommentAsync(new services.models.UpdateComment
                {
                    CommentId    = id,
                    Status       = (comment.IsInternal ? 2 : 3),
                    ShortComment = comment.Category,
                    LongComment  = comment.LongComment,
                    UpdatedBy    = LastFirstName.ToUpperInvariant()
                });

                return(RedirectToAction("ListByBillToShipTo", new { billTo = comment.BillTo, shipTo = comment.ShipTo, stopNumber = comment.StopNumber, routePlanId = oldComment.RoutePlanId, centerNumber = comment.CenterNumber, screen = comment.Screen }));
            }
            catch
            {
                return(null);
            }
        }