private void filterGv(int job) { List <int> emID = new List <int>(); List <EmployeeScore> s = new List <EmployeeScore>(); EmployeeJobRepository ej = new EmployeeJobRepository(); DataTable dt = ej.findEmployeeByJob(job); EmployeeScore ss = new EmployeeScore(); for (int i = 0; i < dt.Rows.Count; i++) { emID.Add(dt.Rows[i][1].ToString().ToInt()); ss = er.getEmployeeScore(emID[i]); s.Add(ss); } DataTable data = new DataTable(); data = OnlineTools.ToDataTable(s); gvEmployees.DataSource = data; gvEmployees.DataBind(); for (int i = 0; i < data.Rows.Count; i++) { GridViewRow row = gvEmployees.Rows[i]; var input = new HtmlInputGenericControl("number"); input = (HtmlInputGenericControl)row.FindControl("Score"); input.Value = er.getEmployeeScore(emID[i]).Score.ToString(); } }
public EmployeeScore getEmployeeScore(int id) { EmployeeScore em = new EmployeeScore(); em = ( from r in database.EmployeeScores where r.EmployeeID == id orderby r.Score select r).FirstOrDefault(); return(em); }