Exemplo n.º 1
0
        public ActionResult Detail(int currHelpdeskSupporterId, int requestId)
        {
            HelpdeskRequest          hr      = _helpdeskSupporterService.GetHelpdeskRequest(requestId);
            HelpdeskRequestViewModel request = new HelpdeskRequestViewModel();

            request.Title       = hr.Title;
            request.Description = hr.Description;
            //---Convert date to dd/MM/yyyy
            DateTime parsedCreateDate = (DateTime)hr.CreateDate;

            request.CreateDate = parsedCreateDate.ToString(patternDate);
            if (hr.DueDate != null)
            {
                DateTime parsedDueDate = (DateTime)hr.DueDate;
                request.DueDate = parsedDueDate.ToString(patternDate);
            }

            request.Status    = hr.Status.Value;
            request.HouseName = hr.House.HouseName;
            request.HelpdeskServiceCatName = hr.HelpdeskRequestCategory.Name;
            request.Id = hr.Id;
            request.HelpdeskSupporterId = currHelpdeskSupporterId;
            ViewBag.currRequest         = request;
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult GetHistoryRequest(int supporterId)
        {
            List <HelpdeskRequestLogViewModel> listLog      = new List <HelpdeskRequestLogViewModel>();
            HelpdeskRequestViewModel           requestModel = null;

            try
            {
                User currUser = _userService.findById(supporterId);//AnLTNM
                if (null != currUser)
                {
                    List <HelpdeskRequestLog>   logOfCurrRequest = _helpdeskRequestLogService.GetHelpdeskRequestLogByUser(currUser.Id);
                    HelpdeskRequestLogViewModel log = null;
                    foreach (var rq in logOfCurrRequest)
                    {
                        log                = new HelpdeskRequestLogViewModel();
                        log.Title          = rq.HelpdeskRequest.Title;
                        log.SrvCatName     = rq.HelpdeskRequest.HelpdeskRequestCategory.Name;
                        log.CreateDate     = rq.CreateDate.Value.ToString(AmsConstants.DateTimeFormat);
                        log.CreateDateLong = rq.CreateDate.Value.Ticks;
                        log.StatusTo       = rq.StatusTo.Value;
                        log.StatusFrom     = rq.StatusFrom.Value;
                        log.HouseName      = rq.HelpdeskRequest.House.HouseName;
                        listLog.Add(log);
                    }
                }
            }
            catch (Exception)
            {
                return(Json(listLog, JsonRequestBehavior.AllowGet));
            }
            return(Json(listLog, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        public ActionResult GetHeRequestBySupporterId(int supporterId)
        {
            List <HelpdeskRequestViewModel> listRequest  = new List <HelpdeskRequestViewModel>();
            HelpdeskRequestViewModel        requestModel = null;

            try
            {
                User currUser = _userService.findById(supporterId);//AnLTNM
                if (null != currUser)
                {
                    List <HelpdeskRequest> hr = _helpdeskRequestServices.GetAllHdRequestBySupporterId(currUser.Id);//AnLTNM
                    foreach (var rq in hr)
                    {
                        requestModel       = new HelpdeskRequestViewModel();
                        requestModel.Id    = rq.Id;
                        requestModel.Title = rq.Title;
                        requestModel.HelpdeskServiceCatName = rq.HelpdeskRequestCategory.Name;
                        requestModel.CreateDate             = rq.CreateDate.Value.ToString(AmsConstants.DateTimeFormat);
                        requestModel.CreateDateLong         = rq.CreateDate.Value.Ticks;

                        if (null != rq.DueDate)
                        {
                            requestModel.DueDate     = rq.DueDate.Value.ToString(AmsConstants.DateTimeFormat);
                            requestModel.DueDateLOng = rq.DueDate.Value.Ticks;
                        }
                        requestModel.Status    = rq.Status.Value;
                        requestModel.HouseName = rq.House.HouseName;
                        listRequest.Add(requestModel);
                    }
                }
            }
            catch (Exception)
            {
                return(Json(listRequest, JsonRequestBehavior.AllowGet));
            }
            return(Json(listRequest, JsonRequestBehavior.AllowGet));
        }