Exemplo n.º 1
0
        public ViewResult Details(int?id)
        {
            //ViewBag.Employee = employeeRespository.Get(id);
            //var employee = employeeRespository.Get(id);

            try
            {
                int.Parse(id.Value.ToString());
                var employee = employeeRespository.Get(id.Value);
                if (employee == null)
                {
                    //ViewBag.Id = id.Value;
                    return(View("~/Views/Error/EmployeeNotFound.cshtml", id.Value));
                }
                var detailviewmodel = new HomeDetailsViewModel()
                {
                    employee  = employeeRespository.Get(id ?? 1),
                    TitleName = "Employee Detail"
                };
                return(View(detailviewmodel));
            }
            catch (Exception e)
            {
                throw e;
            }
        }