Пример #1
0
        public ActionResult GetTicket(int ticketId)
        {
            var resp = _tickManager.GetSupportTicketById(new GetSupportTicketByIDRequest() { TicketID = ticketId });
            var model = new SupportTicketEditModel(resp.Ticket);

            var uiresult = new UIResponse<SupportTicketEditModel>();
            uiresult.Subject = model;
            uiresult.HtmlResult = RenderPartialViewToString("ResolveSupportTicket", model);
            uiresult.Status = resp.Status;

            return Json(uiresult, JsonRequestBehavior.AllowGet);
        }
Пример #2
0
        public ActionResult ResolveTicket(SupportTicketEditModel model)
        {
            var userResp = _wfsUserMgr.GetWfsUserInfoByUserName(new GetWfsUserInfoByUserNameRequest() { UserName = User.Identity.Name });

            model.Ticket.ResolvedByUserID = userResp.Value.UserId;

            var resp = _tickManager.SaveSupportTicket(new SaveSupportTicketRequest()
                {
                    Ticket = model.Ticket
                });

            if (resp.Status == Status.Success)
            {
                var uiresponse = resp.ToUIResult<SupportTicketNewModel>(() => new SupportTicketNewModel(resp.Ticket), (vm) => string.Empty);
                return Json(uiresponse);
            }
            else
            {
                var uiresponse = new Result<SupportTicketNewModel>(Status.Error);
                uiresponse.Messages.AddRange(resp.Messages);

                return Json(uiresponse);
            }
        }