示例#1
0
 public List<SearchEntity> Search(SearchRequest request)
 {
     using (var db = CreateCatalog())
     {
         return db.Conditions.Search(request);
     }
 }
 public List<SearchEntity> Search(SearchRequest request)
 {
     using (var db = CreateCatalog())
     {
         return db.Miscellaneous.Search(request);
     }
 }
 public List<SearchEntity> Search(SearchRequest request)
 {
     using (var db = CreateCatalog())
     {
         return db.CustomerConcerns.Search(request);
     }
 }
示例#4
0
        public ActionResult Dealer(SearchRequest request)
        {
            ViewData["code"] = request.Code;
            ViewData["name"] = request.Name;
            ViewData["limit"] = request.Limit;

            var dealerSvc = new DealerLogic(Ticket);
            var model = dealerSvc.Search(request);

            return View(model);
        }
示例#5
0
        public ActionResult CustomerConcern(SearchRequest request)
        {
            ViewData["code"] = request.Code;
            ViewData["name"] = request.Name;
            ViewData["limit"] = request.Limit;

            var concernSvc = new CustomerConcernLogic(Ticket);
            var model = concernSvc.Search(request);

            return View(model);
        }
示例#6
0
        public List<SearchEntity> Execute(SearchRequest request)
        {
            var columnList = StringUtility.BuildList(",", _idColumn, _codeColumn, _nameColumn);
            var qry = Context.Sql.Select(_tableName)
                                 .Columns(columnList)
                                 .Top(request.Limit);

            if (!string.IsNullOrEmpty(request.Code))
            {
                qry.Where(_codeColumn, Criteria.Like(request.Code));
            }

            if (!string.IsNullOrEmpty(request.Name))
            {
                qry.Where(_nameColumn, Criteria.Like(request.Name));
            }

            if (_activeOnly)
            {
                qry.Where("IsActive", Criteria.IsEqualTo(true));
            }

            if (_siteId > 0)
            {
                qry.Where("SiteId", Criteria.IsEqualTo(_siteId));
            }

            if (!string.IsNullOrEmpty(request.OrderColumn))
            {
                qry.OrderAsc(request.OrderColumn);
            }

            var list = new List<SearchEntity>();
            using (var reader = qry.Build().ExecuteReader())
            {
                while (reader.Read())
                {
                    var obj = new SearchEntity();
                    obj.Id = reader.Get<int>(_idColumn);
                    obj.Code = reader.Get<string>(_codeColumn, "");
                    obj.Name = reader.Get<string>(_nameColumn, "");

                    list.Add(obj);
                }
            }

            return list;
        }
示例#7
0
        public ActionResult Labour(SearchRequest request)
        {
            ViewData["code"] = request.Code;
            ViewData["name"] = request.Name;
            ViewData["limit"] = request.Limit;

            var labourSvc = new LabourLogic(Ticket);
            var results = labourSvc.Search(request);

            ViewData.Model = results;
            ViewData.Add("resultsCount", results.Count);

            return View();
        }
示例#8
0
        public ActionResult RejectionReason(SearchRequest request)
        {
            ViewData["code"] = request.Code;
            ViewData["name"] = request.Name;
            ViewData["limit"] = request.Limit;

            var reasonSvc = new RejectionReasonLogic(Ticket);
            var model = reasonSvc.Search(request);

            return View(model);
        }
示例#9
0
        public ActionResult Miscellaneous(SearchRequest request)
        {
            ViewData["code"] = request.Code;
            ViewData["name"] = request.Name;
            ViewData["limit"] = request.Limit;

            var miscellaneousSvc = new MiscellaneousLogic(Ticket);
            var results = miscellaneousSvc.Search(request);

            ViewData.Model = results;
            ViewData.Add("resultsCount", results.Count);

            return View();
        }