public ActionResult Search(ServiceSearchCriteria criteria)
        {
            ViewData["OutstandingServices"] = db.ImmigrationServices.Where(i => i.IsOutstanding == true).ToList();
            ViewData["MetaData"]            = GetMetaData();
            var result = new List <ServiceByType>();

            var immigrationServicesReturned = db.ImmigrationServices.
                                              Where(i => (
                                                        (string.IsNullOrEmpty(criteria.q) || i.Title.Contains(criteria.q)) &&
                                                        (criteria.StateId == -1 || i.State == criteria.StateId) &&
                                                        (criteria.ImmigrationServiceTypeId == -1 || i.ImmigrationServiceType.Id == criteria.ImmigrationServiceTypeId)
                                                        ));

            foreach (var immigrationServiceType in db.ImmigrationServiceTypes.ToList())
            {
                var immigrationServices = immigrationServicesReturned.Where(i => i.Type == immigrationServiceType.Id).ToList();
                if (immigrationServices.Count() > 0)
                {
                    var obj = new ServiceByType();
                    obj.ImmigrationServiceState = immigrationServices.FirstOrDefault().State1.Name;
                    obj.LstImmigrationServices  = immigrationServices;

                    result.Add(obj);
                }
            }
            ViewData["ImmigrationServices"] = result.ToList();
            return(View("Index", criteria));
        }
        // GET: Service
        public ActionResult Index()
        {
            ViewData["OutstandingServices"] = db.ImmigrationServices.Where(i => i.IsOutstanding == true).ToList();
            ViewData["MetaData"]            = GetMetaData();
            var result = new List <ServiceByType>();

            foreach (var state in db.States.ToList())
            {
                var immigrationServices = db.ImmigrationServices.Where(i => i.State == state.Id).ToList();
                if (immigrationServices.Count() > 0)
                {
                    var obj = new ServiceByType();
                    obj.ImmigrationServiceState = immigrationServices.FirstOrDefault().State1.Name;
                    obj.LstImmigrationServices  = immigrationServices;

                    result.Add(obj);
                }
            }
            ViewData["ImmigrationServices"] = result.ToList();
            return(View(new ServiceSearchCriteria()));
        }