コード例 #1
0
        public ActionResult Search()
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("InitSearch Job").ToInputLogString());
            try
            {
                _commonFacade   = new CommonFacade();
                _commPoolFacade = new CommPoolFacade();

                ViewBag.jobstatus = _commPoolFacade.GetJobStatusSelectList(Resource.Ddl_Status_All, Constants.ApplicationStatus.All);
                ViewBag.channel   = _commPoolFacade.GetChannelWithEmailSelectList(Resource.Ddl_Status_All, Constants.ApplicationStatus.All);
                ViewBag.srstatus  = _commPoolFacade.GetSRStatusSelectList(Resource.Ddl_Status_All, Constants.ApplicationStatus.All);

                JobViewModel jobVM = new JobViewModel();
                jobVM.SearchFilter = new CommPoolSearchFilter
                {
                    FirstName = string.Empty,
                    LastName  = string.Empty,
                    JobStatus = null,
                    Channel   = null,
                    Subject   = string.Empty,
                    From      = string.Empty,
                    DateFrom  = string.Empty,
                    DateTo    = string.Empty,
                    ActionBy  = string.Empty,
                    SRId      = string.Empty,
                    SRStatus  = null,
                    CreatorSR = string.Empty,
                    OwnerSR   = string.Empty,
                    User      = null,
                    PageNo    = 1,
                    PageSize  = _commonFacade.GetPageSizeStart(),
                    SortField = "JobId",
                    SortOrder = "DESC"
                };

                var defSearch = _commonFacade.GetShowhidePanelByUserId(this.UserInfo, Constants.Page.CommunicationPage);

                if (defSearch != null)
                {
                    jobVM.IsSelected = defSearch.IsSelectd ? "1" : "0";
                }
                else
                {
                    jobVM.IsSelected = "0";
                }

                ViewBag.PageSize     = jobVM.SearchFilter.PageSize;
                ViewBag.PageSizeList = _commonFacade.GetPageSizeList();
                ViewBag.Message      = string.Empty;

                return(View(jobVM));
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("InitSearch Job").Add("Error Message", ex.Message).ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }