Hi Team
I have a problem, my data on excel is duplicating data. While on the front end it does not. For example if i search by year 2020 and week 52 . Front end shows no record. But my excel keeps duplicating any year and record closer to that year.
What I have tried:
<pre> public IList<ExtractionViewModel> GetExtractionViewModels()
{
var db = new ProductionManagementEntities();
var scheduleList = (from p in db.ProductionDays
from m in db.Models
join w in db.Weeks on p.WeekId equals w.WeekId
orderby w.Year descending, m.Name descending, p.ProductionDate descending,w.WeekNum descending
where(m.InActive == true)
select new ExtractionViewModel
{
Year = w.Year,
Day = p.ProductionDate,
Week = w.WeekNum,
VW250 = m.Name,
VW270 = m.Name,
VW2502PA = m.Name,
VW270PA = m.Name
}).ToList();
return scheduleList;
}
public class ExtractionViewModel
{
public string Year { get; set; }
public int Week { get; set; }
[DataType(DataType.Date)]
public DateTime Day { get; set; }
public string VW250 { get; set; }
public string VW270 { get; set; }
public string VW2502PA { get; set; }
public string VW270PA { get; set; }
}
// SQL tables for both ProductionDays and Weeks
SELECT TOP (1000) [ProductionDayId]
,[WeekId]
,[ProductionDate]
,[DayOfWeek]
,[CreatedDate]
,[CreatedBy]
,[ModifiedDate]
,[ModifiedBy]
,[InActive]
FROM [ProductionManagement].[Schedule].[ProductionDay]
Order by ProductionDate
SELECT TOP (1000) [WeekId]
,[WeekNum]
,[Year]
,[CreatedDate]
,[CreatedBy]
,[ModifiedDate]
,[ModifiedBy]
,[InActive]
FROM [ProductionManagement].[Schedule].[Week]