コード例 #1
0
 // GET: Departments/Details/5
 public ActionResult Details(int?id)
 {
     try
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         Department department = _departmentManager.FindById((int)id);
         if (department == null)
         {
             return(HttpNotFound());
         }
         DepartmentViewModel departmentViewMode = Mapper.Map <DepartmentViewModel>(department);
         return(View(departmentViewMode));
     }
     catch (Exception ex)
     {
         return(View("Error", new HandleErrorInfo(ex, "Departments", "Details")));
     }
 }
コード例 #2
0
        public ActionResult Update(int id)
        {
            var department = _departmentManager.FindById(id);

            return(View(department));
        }