Ejemplo n.º 1
0
        public List <Batch> GetBatchBySearch(BatchSearchCriteria model)
        {
            IQueryable <Batch> batches = db.Batches.Where(c => c.IsDeleted == false).AsQueryable();

            //if (!string.IsNullOrEmpty(model.Course.Name))
            //{
            //    batches = batches.Where(c => c.Course.Name.ToLower().Contains(model.Course.Name.ToLower()));
            //}

            if (!string.IsNullOrEmpty(model.Description))
            {
                batches = batches.Where(
                    c => c.Description.ToString().ToLower().Contains(model.Description.ToString().ToLower()));
            }
            if (!string.IsNullOrEmpty(model.Name))
            {
                batches = batches.Where(
                    c => c.Name.ToString().ToLower().Contains(model.Name.ToString().ToLower()));
            }

            if (!string.IsNullOrEmpty(model.StartDate.ToString()))
            {
                batches = batches.Where(c => c.StartDate >= model.StartDate);
            }

            //if (!string.IsNullOrEmpty(model.EndDate.ToString()))
            //{
            //    batches = batches.Where(c => c.EndDate <= model.EndDate);
            //}


            return(batches.ToList());
        }
Ejemplo n.º 2
0
Archivo: BS.cs Proyecto: Galib43/OEMS
        public ActionResult Index(BatchSearchCriteria model)
        {
            var batches = _batchManager.GetBatchBySearch(model);

            if (batches == null)
            {
                batches = new List <Batch>();
            }
            model.OrganizationListItem = GetOrganizationList();
            model.ListOfBatch          = batches;


            return(View(model));
        }
Ejemplo n.º 3
0
        //Index and Batch Search
        public ActionResult Index(BatchSearchCriteria model)
        {
            var batch = _batchManager.GetBatchBySearch(model);



            if (batch == null)
            {
                batch = new List <Batch>();
            }


            model.ListOfBatch = batch;

            return(View(model));
        }
Ejemplo n.º 4
0
        public List <Batch> GetBatchBySearch(BatchSearchCriteria model)
        {
            List <Batch> batches = _batchRepository.GetBatchBySearch(model);

            return(batches);
        }