// GET: AssetTypes/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var assetType = AssetTypeManager.Find((int)id); if (assetType == null) { return(NotFound()); } return(View(assetType)); }
//// GET: AssetTypes/Delete/5 //public async Task<IActionResult> Delete(int? id) //{ // if (id == null) // { // return NotFound(); // } // var assetType = await _context.AssetTypes // .FirstOrDefaultAsync(m => m.Id == id); // if (assetType == null) // { // return NotFound(); // } // return View(assetType); //} //// POST: AssetTypes/Delete/5 //[HttpPost, ActionName("Delete")] //[ValidateAntiForgeryToken] //public async Task<IActionResult> DeleteConfirmed(int id) //{ // var assetType = await _context.AssetTypes.FindAsync(id); // _context.AssetTypes.Remove(assetType); // await _context.SaveChangesAsync(); // return RedirectToAction(nameof(Index)); //} private bool AssetTypeExists(int id) { bool result = AssetTypeManager.Find(id) == null ? false : true; return(result); }
// GET: AssetType/Delete/5 public ActionResult Delete(int id) { var assetType = AssetTypeManager.Find(id); return(View(assetType)); }