Hi All
http://img7.imageshack.us/img7/3050/downtime.png
I have two calendar pickers ( To and From ) I need to build the Year1 -> 4 dynamicly. I am also getting dupplicate records for 1 items that have values for 2006 and 2009. They can select 100 years if they wanted too.Check attached image.
public ActionResult DownTimeSummaryTabular(int Start,int End)
{
var q = from item in new iSppms.Models.iSppmsDataContext().Incidents
group item by new
{
item.Supplier.Id,
item.Supplier.Name,
item.SupplierPlant,item.DownTime
}
into supplier
select new
{
SupplierId = supplier.Key.Id,
SupplierName = supplier.Key.Name,
SupplierPlant = supplier.Key.SupplierPlant.Plant,
Years = from incident in supplier
let year = incident.IncidentDate.Year
where year <= End and year >= Start
group incident by year into incidentForYear
select incidentForYear.DownTime
};
return View();
}