Sajid Hussain

Sajid Hussain

  • 1.2k
  • 514
  • 100.6k

how do remove employee When one used

Mar 13 2015 7:09 AM
During my rdlc development client demand that base on total beats ,then there is employee available then put it ,or else put empty row ,i am using following code,but problem is that same employee is repeated, i thought that if we remove employee from the list when it is used,then it could be done.
 int SecBeat2 = _service.GetBeatBySector_Id(sectorId).Count();  
for (int i = 1; i <= SecBeat2; i++ )
{
var bsec4 = _service.GetAllBeatStatus().Where(x => x.Date == dt && x.Sector_Id == sectorId && x.Shift == 1).FirstOrDefault();
if (bsec4 != null)
{ Employee emp = _service.GetEmployee(bsec4.Employee_Id);
Beat beat = beats.FirstOrDefault(x => x.Id == bsec4.Beat_Id && x.Sector_Id == sectorId);
dataset.Beat.Rows.Add( emp.Name, emp.Id,
emp.CellNo //bs1.HasWireless );
}
else
{
dataset.Beat.Rows.Add("", "", "");
}
}