Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Notes,PersonID,RealEstateID,ViewDate,ViewTime,ViewingType")] Viewing viewing)
        {
            if (id != viewing.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(viewing);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ViewingExists(viewing.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Notes,OfferAmount,OfferDate,OfferType,PersonID,RealEstateID")] Offer offer)
        {
            if (id != offer.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(offer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OfferExists(offer.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
Пример #3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Description,RentCommision,SaleCommission,ServiceType,FeeType,FixedSaleFee,FixedLetFee,StartDate,EndDate")] Service service)
        {
            if (id != service.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(service);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ServiceExists(service.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["FeeTypes"]     = new SelectList(new[] { "Commission", "Fixed Fee" });
            ViewData["ServiceTypes"] = new SelectList(new[] { "Sale", "Let", "Sale&Let" });
            return(View(service));
        }
        public async Task <IActionResult> Edit(int id,
                                               [Bind("ID,AddressLine1,AddressLine2,PersonID,ServiceID,PostCode,RentalPrice,SalePrice,Town,PropertyType,BedroomQty,BathroomWCQty,BathroomQty,WCQty,FrontGarden,BackGarden,GenDescription")]
                                               RealEstate realEstate)
        {
            if (id != realEstate.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            //if (true)
            {
                try
                {
                    _context.Update(realEstate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RealEstateExists(realEstate.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["PersonID"]  = new SelectList(_context.Persons, "ID", "FullName");
            ViewData["ServiceID"] = new SelectList(_context.Services, "ID", "ID");
            return(View(realEstate));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,AddressLine1,AddressLine2,FirstMidName,JoinDate,LastName,MemberType,PostCode,Town,TelephoneNo,MobileNo,EmailAddress,GeneralNotes")] Person person)
        {
            if (id != person.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(person);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonExists(person.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["PersonTypes"] = new SelectList(new[] { "Buyer", "Seller", "Landlord", "Tenant", "Viewer" });
            return(View(person));
        }