Exemple #1
0
        public ActionResult Step4(Step4ViewModel model)
        {
            if (ModelState.IsValid)
            {
                _listingService.SaveListingStep4(model, User.Identity.GetUserId());
                return(RedirectToAction(nameof(Step5), new { id = model.Id }));
            }

            model.StepsProgressModel.ListingId = model.Id;
            model.StepsProgressModel.Step      = 4;


            if (model.Step4FlatForRent != null)
            {
                return(View("FlatForRent/Step4", model));
            }
            if (model.Step4FlatForSale != null)
            {
                return(View("FlatForSale/Step4", model));
            }
            if (model.Step4HouseForRent != null)
            {
                return(View("HouseForRent/Step4", model));
            }
            if (model.Step4HouseForSale != null)
            {
                return(View("HouseForSale/Step4", model));
            }
            if (model.Step4LandForSale != null)
            {
                return(View("LandForSale/Step4", model));
            }
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public ActionResult Step4(int id)
        {
            Step4ViewModel model = _listingService.GetStep4ById(id);

            model.StepsProgressModel.Step      = 4;
            model.StepsProgressModel.ListingId = id;
            if (model.Step4FlatForRent != null)
            {
                return(View("FlatForRent/Step4", model));
            }
            if (model.Step4FlatForSale != null)
            {
                return(View("FlatForSale/Step4", model));
            }
            if (model.Step4HouseForRent != null)
            {
                return(View("HouseForRent/Step4", model));
            }
            if (model.Step4HouseForSale != null)
            {
                return(View("HouseForSale/Step4", model));
            }
            if (model.Step4LandForSale != null)
            {
                return(View("LandForSale/Step4", model));
            }
            if (model.Step4RoomForRent != null)
            {
                return(View("RoomForRent/Step4", model));
            }
            return(RedirectToAction("Index"));
        }
Exemple #3
0
        public async Task <IActionResult> Step4(int id)
        {
            var currentUser = await _userManager.GetUserAsync(User);

            if (!_createManager.IsStepValid(id, currentUser))
            {
                return(RedirectToAction("Step1"));
            }

            var model = new Step4ViewModel()
            {
                Id = id
            };

            return(View(model));
        }
Exemple #4
0
        public async Task <IActionResult> Step4(Step4ViewModel model)
        {
            if (ModelState.IsValid)
            {
                var currentUser = await _userManager.GetUserAsync(User);

                if (!_createManager.IsStepValid(model.Id, currentUser))
                {
                    return(RedirectToAction("Step1"));
                }

                var window = await _dbContext.Window.SingleOrDefaultAsync(x => x.Id == model.Id);

                window.GeneralDescription = model.GenerelDescription;
                window.AcceptConditions   = model.AcceptConditions;
                window.Title          = model.Title;
                window.WindowStatusId = 1;
                _dbContext.Window.Update(window);
                await _dbContext.SaveChangesAsync();

                return(RedirectToAction("Index", "Ads"));
            }
            return(View(model));
        }
 public Step4Page()
 {
     InitializeComponent();
     BindingContext = new Step4ViewModel(this.Navigation);
 }
Exemple #6
0
        public ActionResult AddMixedLand(Step4ViewModel model)
        {
            List <MixedLandViewModel> list = _listingService.AddMixedLand(model, User.Identity.GetUserId());

            return(PartialView("Property/_MixedLandTablePartial", list));
        }