public ActionResult ViewOrderByUserID(int UserID) { ActionResult response; try { //mapping all the data to the view page List <OrdersDO> _Orders = _OrdersDAO.ViewOrderByUserID(UserID); List <OrdersPO> Orders = Mapper.OrdersListDOtoPO(_Orders); response = View(Orders); } //logging errors and redirecting catch (SqlException sqlEx) { Logger.SqlErrorLog(sqlEx); response = View("Error"); } catch (Exception ex) { Logger.ErrorLog(ex); response = View("Error"); } return(response); }