コード例 #1
0
        // 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));
        }
コード例 #2
0
        //// 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);
        }
コード例 #3
0
        // GET: AssetType/Delete/5
        public ActionResult Delete(int id)
        {
            var assetType = AssetTypeManager.Find(id);

            return(View(assetType));
        }