public async Task <IActionResult> Edit(string id, [Bind("Flat_ID,Flat_No,Floor,Block,FlatBuyDate,BHKs,CurrentStatus,FlatInchargeFirstName,FlatInchargeLastName,FlatInchargeContactNumber,FlatInchargeAlternateContactNumber,FlatInchargeEmail,AnnualMaintainaceCharges,OwnerID,Remarks")] FlatDetails flatDetails) { if (id != flatDetails.Flat_ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(flatDetails); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FlatDetailsExists(flatDetails.Flat_ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(flatDetails)); }
public async Task <IActionResult> Create([Bind("Flat_ID,Flat_No,Floor,Block,FlatBuyDate,BHKs,CurrentStatus,FlatInchargeFirstName,FlatInchargeLastName,FlatInchargeContactNumber,FlatInchargeAlternateContactNumber,FlatInchargeEmail,AnnualMaintainaceCharges,OwnerID,Remarks")] FlatDetails flatDetails) { if (ModelState.IsValid) { _context.Add(flatDetails); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(flatDetails)); }