コード例 #1
0
        public ActionResult GetfilteredAds(string State, string District, string Mandal, string CategoryId, string Keyword)
        {
            int TotalPageNumber = 0;

            InformationServiceWrapper objservice = new InformationServiceWrapper();
            DropDownWrapperModel      ModelObj   = new DropDownWrapperModel();

            ModelObj             = objservice.GetDropDownValues();
            ViewBag.DistrictLIst = ModelObj.District;
            ViewBag.MandalList   = ModelObj.Mandal;

            AdFilterModel Model = new AdFilterModel();

            Model.txtState    = State == ""?null:State;            // form["ddlStateText"];
            Model.txtDistrict = District == "" ? null : District;; //form["ddlDistrict"];
            Model.txtMandal   = Mandal == "" ? null :Mandal;       // form["ddlMandal"];
            Model.CategoryId  = Convert.ToInt32(CategoryId);       //Convert.ToInt32(form["ddlCategory"]);
            Model.TxtKeyWord  = Keyword == "" ? null :Keyword;     //form["txtSearchWord"];

            List <AdDetailsModel> LisModelObj = new List <AdDetailsModel>();

            LisModelObj             = objservice.GetfilteredAds(Model, out TotalPageNumber);
            ViewBag.Adlist          = LisModelObj;
            ViewBag.TotalPageNumber = TotalPageNumber;

            return(View("FilteredAds"));
        }
コード例 #2
0
        public ActionResult _AdSearch(string State, string District, string DistrictId, string Mandal, string MandalId, string CategoryId, Int32 PageNumber)
        {
            int TotalPageNumber = 0;

            ViewBag.CurrentPageNumber = PageNumber;

            InformationServiceWrapper objservice = new InformationServiceWrapper();

            AdFilterModel Model = new AdFilterModel();

            Model.txtState    = State == "" ? null : State;       //form["ddlStateText"];
            Model.txtDistrict = District == "" ? null : District; //form["ddlDistrict"];
            Model.txtMandal   = Mandal == "" ? null : Mandal;     //form["ddlMandal"];
            Model.CategoryId  = Convert.ToInt32(CategoryId);      //form["ddlCategory"];
            // Model.TxtKeyWord = Keyword == "" ? null : Keyword; //form["txtSearchWord"];
            Model.INTPAGENUMBER = PageNumber;
            Model.INTPAGESIZE   = 10;
            List <AdDetailsModel> LisModelObj = new List <AdDetailsModel>();

            LisModelObj             = objservice.GetfilteredAds(Model, out TotalPageNumber);
            ViewBag.Adlist          = LisModelObj;
            ViewBag.TotalPageNumber = TotalPageNumber;

            @ViewBag.CategoryId         = Model.CategoryId;
            @ViewBag.selectedState      = Model.txtState;
            @ViewBag.SelectedDistrictId = DistrictId;
            @ViewBag.selectedMandalId   = MandalId;

            return(PartialView("AdSearch"));
        }
コード例 #3
0
        public async Task <ActionResult> GetUserAds(AdFilterModel model)
        {
            User user = await _userManager.GetUserAsync(User);

            model.Ads = _adService.GetAdsByUserId(model, user.Id);

            return(View("Index", model));
        }
コード例 #4
0
        public List <AdDetailsModel> GetfilteredAds(AdFilterModel Obj, out int TotalPageNumber)
        {
            List <AdDetailsModel>  listObj       = new List <AdDetailsModel>();
            List <AdDetailsEntity> EntityListObj = new List <AdDetailsEntity>();

            AdFilterEntity Entity = new AdFilterEntity();

            ServiceLayer.InformationService obj       = new InformationService();
            InformationObjectMapper         ObjMapper = new InformationObjectMapper();

            Entity        = ObjMapper.MapAdFilterModelToAdFilterEntity(Obj);
            EntityListObj = obj.GetFilteredAds(Entity, out TotalPageNumber);
            listObj       = ObjMapper.MapAdDetailsListEntityToAdDetailsModel(EntityListObj);
            return(listObj);
        }
コード例 #5
0
        public List <AdModel> GetAdsByUserId(AdFilterModel model, int userId)
        {
            using (var unitOfWork = _unitOfWorkFactory.Create())
            {
                List <Ad> ads = unitOfWork.Ads.GetAllByUserId(userId)
                                .ByKeyWord(model.KeyWord)
                                .ByCategory(model.CategoryId)
                                .ByPriceFrom(model.PriceFrom)
                                .ByPriceTo(model.PriceTo)
                                .ByImages(model.OnlyWithImages)
                                .OrderBy(x => x.UpdatedOnDate)
                                .ToList();
                model.CategorySelect = GetCategorySelect();

                return(Mapper.Map <List <AdModel> >(ads));
            }
        }
コード例 #6
0
 internal AdFilterEntity MapAdFilterModelToAdFilterEntity(AdFilterModel Model)
 {
     if (Model != null)
     {
         AdFilterEntity Entity = new AdFilterEntity();
         Entity.txtState      = Model.txtState;
         Entity.txtMandal     = Model.txtMandal;
         Entity.txtDistrict   = Model.txtDistrict;
         Entity.CategoryId    = Model.CategoryId;
         Entity.TxtKeyWord    = Model.TxtKeyWord;
         Entity.INTPAGENUMBER = Model.INTPAGENUMBER;
         Entity.INTPAGESIZE   = Model.INTPAGESIZE;
         return(Entity);
     }
     else
     {
         return(null);
     }
 }
コード例 #7
0
 public ActionResult IndexAjax(AdFilterModel model)
 {
     return(PartialView("_IndexTable", this.AdRepository.GetList(model)));
 }
コード例 #8
0
 public IActionResult Index(AdFilterModel model)
 {
     model.Ads = _adService.GetAllAds(model);
     return(View(model));
 }