public ActionResult Equipments() { var equipmentTypeList = new EquipmentTypeServices().GetAllOrderedEquipmentTypes() ?? new List <EquipmentType>(); if (!equipmentTypeList.Any()) { return(RedirectToAction("EquipmentTypes", "EquipmentType")); } var equipmentList = new EquipmentServices().GetAllOrderedEquipments() ?? new List <Equipment>(); if (!equipmentList.Any()) { ViewBag.Edit = 1; ViewBag.Title = "Equipment Type SetUp"; return(View(Tuple.Create(equipmentTypeList, new List <Equipment>()))); } equipmentList.ForEach(m => { m.EquipmentLicenseStatus = m.LicenseStatus ? "Licensed" : "Unlicensed"; }); var txx = Tuple.Create(equipmentTypeList, equipmentList); ViewBag.Title = "Manage Equipments"; return(View(txx)); }
public ActionResult Reports() { var equipmentList = new EquipmentServices().GetAllOrderedEquipments() ?? new List <Equipment>(); if (!equipmentList.Any()) { ViewBag.Edit = 1; ViewBag.Title = "Equipment List"; return(View(new List <Equipment>())); } equipmentList.ForEach(m => { m.EquipmentLicenseStatus = m.LicenseStatus ? "Licensed" : "Unlicensed"; }); ViewBag.Title = "Equipment List"; return(View(equipmentList)); }