// GET: Paychecks public ActionResult Index() { var paychecks = dbBusiness.Paychecks.OrderByDescending(p => p.paycheck_date); List <PaycheckViewModel> paycheckModels = new List <PaycheckViewModel>(); foreach (var i in paychecks) { var iModel = PaycheckViewModel.ToModel(i); paycheckModels.Add(iModel); } return(View(paycheckModels)); }
// GET: Paychecks/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PaycheckViewModel paycheck = PaycheckViewModel.ToModel(dbBusiness.Paychecks.Find(id)); if (paycheck == null) { return(HttpNotFound()); } ViewBag.ActionTitle = "Detailed "; return(View(paycheck)); }