Пример #1
0
        public ActionResult SearchSlaList(SlaSearchFilter searchFilter)
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("Search SLA").ToInputLogString());

            try
            {
                if (ModelState.IsValid)
                {
                    _slaFacade = new SlaFacade();
                    SlaViewModel slaVM = new SlaViewModel();
                    slaVM.SearchFilter = searchFilter;

                    slaVM.SlaList    = _slaFacade.GetSlaList(slaVM.SearchFilter);
                    ViewBag.PageSize = slaVM.SearchFilter.PageSize;

                    return(PartialView("~/Views/Sla/_SlaList.cshtml", slaVM));
                }

                return(Json(new
                {
                    Valid = false,
                    Error = string.Empty
                }));
            }
            catch (Exception ex)
            {
                Logger.Info(_logMsg.Clear().SetPrefixMsg("Search SLA").ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }
Пример #2
0
        public ActionResult Search()
        {
            _srChannelFacade = new SrChannelFacade();
            _srStatusFacade  = new SrStatusFacade();

            var viewSlaVM     = new SlaViewModel();
            var srChannelList = _srChannelFacade.GetSrChannelList();

            viewSlaVM.SrChannelList = srChannelList.Select(item => new SelectListItem()
            {
                Text  = item.ChannelName,
                Value = item.ChannelId.ToString(CultureInfo.InvariantCulture)
            }).ToList();
            viewSlaVM.SrChannelList.Insert(0, new SelectListItem()
            {
                Text = "ทั้งหมด", Value = "-1"
            });

            var srStatusList = _srStatusFacade.GetSrStatusList();

            viewSlaVM.SrStatusList = srStatusList.Select(item => new SelectListItem()
            {
                Text  = item.SRStatusName,
                Value = item.SRStatusId.ToString()
            }).ToList();
            viewSlaVM.SrStatusList.Insert(0, new SelectListItem()
            {
                Text = "ทั้งหมด", Value = "-1"
            });

            viewSlaVM.SearchFilter = new SlaSearchFilter()
            {
                ProductGroupId    = null,
                ProductId         = null,
                CampaignServiceId = null,
                AreaId            = null,
                SubAreaId         = null,
                TypeId            = null,
                ChannelId         = null,
                SrStatusId        = null,
                PageNo            = 1,
                PageSize          = 15,
                SortField         = "",
                SortOrder         = "ASC"
            };

            return(View(viewSlaVM));
        }