Esempio n. 1
0
        public ActionResult SearchMaster(MstIndexSearchModels model)
        {
            MstIndexTypeDAO indexTypeDAO = new MstIndexTypeDAO(this.mapper);
            model.indexTypeList = indexTypeDAO.GetIndexTypeList(null, Constants.Status.Active);
            MstIndexTypeModels allType = new MstIndexTypeModels();
            model.indexTypeList.Insert(0, allType);

            //if (model.isPublic)
            //{
            //    model.securityType = Constants.Type.Public;
            //}
            //else
            //{
            //    model.securityType = Constants.Type.Authority;
            //}

            if (model.isActive)
            {
                model.indexStatus = Constants.Status.Active;
            }
            else
            {
                model.indexStatus = Constants.Status.Inactive;
            }
            MstIndexDAO indexDAO = new MstIndexDAO(this.mapper);
            model = indexDAO.searchIndex(model, Constants.Term.ShortTerm);
            return View("IndexMaster", model);
        }
Esempio n. 2
0
        public MstIndexSearchModels searchIndex(MstIndexSearchModels model, string term)
        {
            Dictionary<string, object> param = new Dictionary<string, object>();

            if (!StringUtils.IsEmpty(model.indexCode))
            {
               param.Add("indexCode", model.indexCode);
            }
            if (!StringUtils.IsEmpty(term))
            {
                param.Add("term", term);
            }
            if (!StringUtils.IsEmpty(model.indexName))
            {
                param.Add("indexName", model.indexName.ToUpper());
            }
            if (!StringUtils.IsEmpty(model.indexTypeCode))
            {
                param.Add("indexTypeCode", model.indexTypeCode);
            }
            if (!StringUtils.IsEmpty(model.securityType))
            {
                param.Add("securityType", model.securityType);
            }
            if (!StringUtils.IsEmpty(model.indexStatus))
            {
                param.Add("indexStatus", model.indexStatus);
            }

            int maxItemPerPage = Constants.MaxItemPerPage;
            param.Add("max", model.pageIndex * maxItemPerPage);
            param.Add("offset", (model.pageIndex - 1) * maxItemPerPage + 1);
            model.indexList = mapper.QueryForList<MstIndexModels>("Master.selectIndexMasterList", param);

            model.recordCount = mapper.QueryForObject<int>("Master.selectCountIndexMasterList", param);
            return model;
        }
Esempio n. 3
0
        public ActionResult IndexMaster()
        {
            MstIndexSearchModels model = new MstIndexSearchModels();
            MstIndexDAO indexDAO = new MstIndexDAO(this.mapper);
            model.pageIndex = 1;
            model.securityType = Constants.Type.Public;
            model.securityType = Constants.Status.Active;
            model.isPublic = true;
            model.isActive = true;
            //model = indexDAO.searchIndex(model);

            MstIndexTypeDAO indexTypeDAO = new MstIndexTypeDAO(this.mapper);
            model.indexTypeList = indexTypeDAO.GetIndexTypeList(null, Constants.Status.Active);
            MstIndexTypeModels allType = new MstIndexTypeModels();
            model.indexTypeList.Insert(0, allType);
            return View(model);
        }