Sajid Hussain

Sajid Hussain

  • 1.2k
  • 514
  • 100.6k

How Do I Print All Employees Passes On One Click

Apr 27 2015 1:52 AM
i have a requirement to print all employee Service Card when user click on one button,
i have entered all employee records in one table. problem is that when
i click on the button only one employee record is shown. i am using following code to test my requirements .
 
  protected void EmpSC_Click(object sender, EventArgs e)
 {
EmployeeSpDataSet dataset = new EmployeeSpDataSet();
 var AllEmp = _service.GetAllEmployeeDuty().OrderByDescending(x => x.EndDate)
.GroupBy(x => x.Employee_Id).Select(x => x.First()).Take(3).ToList();
 if (AllEmp != null)
{
for (int i = 1; i <= 3; i++)
{
 var empsp = AllEmp.FirstOrDefault();
var emp = _service.GetAllEmployee().Where(x => x.Id == empsp.Employee_Id).FirstOrDefault();
 dataset.EmployeeScpass.Rows.Add(emp.Id,
 emp.Name,
 emp.Cnic,
 empsp.ToSectorName,
 emp.ImgBody
 );
AllEmp.Remove(empsp);
}
}
is there is any way to get that thing on track.

Answers (1)