コード例 #1
0
        public ActionResult RenewAd(LeasersInformationViewModel listing)
        {
            var repo = new LeaserRepository();

            listing.UserId   = repo.GetUserId(User.Identity.Name);
            listing.Location = new Location {
                Id = listing.LocationId
            };
            var info = listing.ToViewModelSingle <LeasersInformationViewModel, LeasersInformation>();

            repo.RenewAdById(info);
            TempData["Recipient"] = "renew";
            return(RedirectToAction("EmailRecipient", "Home"));
        }
コード例 #2
0
        public ActionResult AddRental(LeasersInformationViewModel infoVM)
        {
            var repo = new LeaserRepository();

            infoVM.UserId   = repo.GetUserId(User.Identity.Name);
            infoVM.Location = new Location {
                Id = infoVM.LocationId
            };
            infoVM.Expiration = DateTime.Today.AddMonths(3);
            var info = infoVM.ToViewModelSingle <LeasersInformationViewModel, LeasersInformation>();

            repo.AddHouse(info);
            TempData["Recipient"] = "add";
            return(RedirectToAction("EmailRecipient", "Home"));
        }
コード例 #3
0
        public void Update(LeasersInformationViewModel listing)
        {
            var repo = new LeaserRepository();

            listing.UserId   = repo.GetUserId(User.Identity.Name);
            listing.Location = new Location {
                Id = listing.LocationId
            };
            var hello = listing;

            if (listing.ContactInfo == null)
            {
                return;
            }
            var info = listing.ToViewModelSingle <LeasersInformationViewModel, LeasersInformation>();

            repo.Update(info);
            repo.SaveChanges();
        }