public ActionResult Create()
        {
            _srPageFacade = new SrPageFacade();

            var mappingProductTypeVM = new MappingProductTypeViewModel();

            var srPageList = _srPageFacade.GetSrPageList();

            mappingProductTypeVM.SrPageList = srPageList.Select(item => new SelectListItem()
            {
                Text  = item.SrPageName,
                Value = item.SrPageId.ToString(CultureInfo.InvariantCulture)
            }).ToList();

            mappingProductTypeVM.QuestionGroupSearchFilter = new QuestionSelectSearchFilter()
            {
                QuestionName   = string.Empty,
                QuestionIdList = string.Empty,
                ProductId      = null,
                PageSize       = 15,
                PageNo         = 1,
                SortField      = "test",
                SortOrder      = "ASC"
            };

            ViewBag.CreateUsername = UserInfo.FullName;
            ViewBag.UpdateUsername = UserInfo.FullName;
            ViewBag.CreateDate     = DateTime.Now;
            ViewBag.UpdateDate     = DateTime.Now;

            return(View(mappingProductTypeVM));
        }
        public ActionResult SearchQuestionGroupMapList(QuestionSelectSearchFilter searchFilter)
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("Search Mapping").ToInputLogString());

            try
            {
                if (ModelState.IsValid)
                {
                    _mappingProductTypeFacade = new MappingProductTypeFacade();
                    MappingProductTypeViewModel model = new MappingProductTypeViewModel();
                    model.QuestionGroupSearchFilter = searchFilter;

                    model.QuestionGroupList =
                        _mappingProductTypeFacade.GetQuestionGroupList(model.QuestionGroupSearchFilter);
                    ViewBag.PageSize = model.QuestionGroupSearchFilter.PageSize;

                    return(PartialView("~/Views/MappingProductType/_QuestionGroupList.cshtml", model));
                }

                return(Json(new
                {
                    Valid = false,
                    Error = string.Empty
                }));
            }
            catch (Exception ex)
            {
                Logger.Info(_logMsg.Clear().SetPrefixMsg("Search Mapping").ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }
Esempio n. 3
0
        public ActionResult SearchMappingList(MappingProductSearchFilter searchFilter)
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("Search Mapping").ToInputLogString());

            try
            {
                if (ModelState.IsValid)
                {
                    _mappingProductTypeFacade = new MappingProductTypeFacade();
                    MappingProductTypeViewModel mappingVM = new MappingProductTypeViewModel();
                    mappingVM.SearchFilter       = searchFilter;
                    mappingVM.MappingProductList = _mappingProductTypeFacade.GetMappingList(mappingVM.SearchFilter);
                    ViewBag.PageSize             = mappingVM.SearchFilter.PageSize;
                    return(PartialView("~/Views/MappingProductType/_MappingProductList.cshtml", mappingVM));
                }

                return(Json(new
                {
                    Valid = false,
                    Error = string.Empty
                }));
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("Search Mapping").Add("Error Message", ex.Message).ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }
        public ActionResult Search()
        {
            var mappingProductVM = new MappingProductTypeViewModel();

            mappingProductVM.SearchFilter = new MappingProductSearchFilter()
            {
                ProductGroupId = null,
                ProductId      = null,
                CampaignId     = null,
                TypeId         = null,
                AreaId         = null,
                SubAreaId      = null,
                IsVerify       = null,
                OwnerId        = null,
                IsActive       = null,
                PageNo         = 1,
                PageSize       = 15,
                SortField      = "AreaName",
                SortOrder      = "ASC"
            };

            return(View(mappingProductVM));
        }
Esempio n. 5
0
        public ActionResult Create()
        {
            _srPageFacade = new SrPageFacade();

            var mappingProductTypeVM = new MappingProductTypeViewModel();

            var srPageList = _srPageFacade.GetSrPageList();

            mappingProductTypeVM.SrPageList = srPageList.Select(item => new SelectListItem()
            {
                Text = item.SrPageName,
                //Value = item.SrPageId.ToString(CultureInfo.InvariantCulture)
                Value = item.SrPageId.ToString()
            }).ToList();

            mappingProductTypeVM.QuestionGroupSearchFilter = new QuestionSelectSearchFilter()
            {
                QuestionName   = string.Empty,
                QuestionIdList = string.Empty,
                ProductId      = null,
                PageSize       = 15,
                PageNo         = 1,
                SortField      = "test",
                SortOrder      = "ASC"
            };

            ViewBag.CreateUsername = UserInfo.FullName;
            ViewBag.UpdateUsername = UserInfo.FullName;
            ViewBag.CreateDate     = DateTime.Now;
            ViewBag.UpdateDate     = DateTime.Now;

            ViewBag.VerifyOTPList = new SelectList(new SelectListItem[]
            {
                new SelectListItem()
                {
                    Value = "true", Text = "Yes"
                },
                new SelectListItem()
                {
                    Value = "false", Text = "No"
                },
            },
                                                   "Value", "Text", string.Empty);

            using (MappingProductTypeFacade _mapFacade = new MappingProductTypeFacade())
            {
                List <SelectListItem> otpTemplate = new List <SelectListItem>();
                _mapFacade.GetOTPTemplate().ForEach(o => otpTemplate.Add(new SelectListItem()
                {
                    Value = o.OTPTemplateId.ToString(), Text = o.OTPTemplateName
                }));
                ViewBag.OTPTemplateList = new SelectList(otpTemplate, "Value", "Text", string.Empty);
            }

            using (HpFacade _hpFacade = new HpFacade())
            {
                List <SelectListItem> hpStatus = new List <SelectListItem>();
                _hpFacade.GetHpStatus().ForEach(o => hpStatus.Add(new SelectListItem()
                {
                    Value = o.HpStatusId.ToString(), Text = $"{o.HpLangIndeCode}-{o.HpSubject}"
                }));
                ViewBag.HpStatusList = new SelectList(hpStatus, "Value", "Text", string.Empty);
            }

            return(View(mappingProductTypeVM));
        }