public async Task <IActionResult> Create([Bind("ID,AddressLine1,AddressLine2,FirstMidName,JoinDate,LastName,MemberType,PostCode,Town, TelephoneNo,MobileNo,EmailAddress,GeneralNotes")] Person person)
        {
            if (ModelState.IsValid)
            {
                _context.Add(person);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["PersonTypes"] = new SelectList(new[] { "Buyer", "Seller", "Landlord", "Tenant", "Viewer" });
            return(View(person));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ID,Notes,OfferAmount,OfferDate,OfferType,PersonID,RealEstateID")] Offer offer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(offer);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["PersonID"]     = new SelectList(_context.Persons, "ID", "FirstMidName", offer.PersonID);
            ViewData["RealEstateID"] = new SelectList(_context.RealEstates, "ID", "AddressLine1", offer.RealEstateID);
            return(View(offer));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("ID,Description,RentCommision,SaleCommission,ServiceType,FeeType,FixedSaleFee,FixedLetFee,StartDate,EndDate")] Service service)
        {
            if (ModelState.IsValid)
            {
                _context.Add(service);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["FeeTypes"]     = new SelectList(new[] { "Commission", "Fixed Fee" });
            ViewData["ServiceTypes"] = new SelectList(new[] { "Sale", "Let", "Sale&Let" });
            return(View(service));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("ID,Notes,PersonID,RealEstateID,ViewDate,ViewTime,ViewingType")] Viewing viewing)
        {
            if (ModelState.IsValid)
            {
                _context.Add(viewing);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["ViewingTypes"]  = new SelectList(new[] { "Single", "Block" });
            ViewData["Members"]       = new SelectList(_context.Persons, "ID", "FullName");
            ViewData["RealEstateIDs"] = new SelectList(_context.RealEstates, "ID", "AddressLine1");
            return(View(viewing));
        }
        public async Task <IActionResult> Create(
            [Bind("ID,AddressLine1,AddressLine2,PersonID,ServiceID,PostCode,RentalPrice,SalePrice,Town,PropertyType,BedroomQty,BathroomWCQty,BathroomQty,WCQty,FrontGarden,BackGarden,GenDescription")]
            RealEstate realEstate)
        {
            if (ModelState.IsValid)
            //if (true)
            {
                _context.Add(realEstate);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["PersonID"]  = new SelectList(_context.Persons, "ID", "FullName");
            ViewData["ServiceID"] = new SelectList(_context.Services, "ID", "ID");
            return(View(realEstate));
        }