コード例 #1
0
        public async Task <IActionResult> Create([Bind("LeaserId,FirstName,LastName,Email,Address,City,State,ZipCode,Comments,PhoneNumber")] PropertyLeaser propertyLeaser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(propertyLeaser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(propertyLeaser));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("PaymentId,TotalPayments,TotalPaid,TotalLate,TotalMonths")] PaymentHistory paymentHistory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(paymentHistory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(paymentHistory));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("MaintenanceId,PropertyId,Description,Documents,Priority")] MaintenanceRequest maintenanceRequest)
        {
            if (ModelState.IsValid)
            {
                _context.Add(maintenanceRequest);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PropertyId"] = new SelectList(_context.Property, "PropertyId", "PropertyId", maintenanceRequest.PropertyId);
            return(View(maintenanceRequest));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("PropertyId,OwnerId,LeaserId,Picture,Address,SquareFeet,Bedrooms,Baths,Year,Features,MonthlyRate,Utilities,ContractTime,PaymentId")] Property @property)
        {
            if (ModelState.IsValid)
            {
                _context.Add(@property);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LeaserId"]  = new SelectList(_context.PropertyLeaser, "LeaserId", "LeaserId", @property.LeaserId);
            ViewData["OwnerId"]   = new SelectList(_context.PropertyOwner, "OwnerId", "OwnerId", @property.OwnerId);
            ViewData["PaymentId"] = new SelectList(_context.PaymentHistory, "PaymentId", "PaymentId", @property.PaymentId);
            return(View(@property));
        }