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 DataTable LoadAllSubGroups() { return(OnlineTools.ToDataTable((from r in DB.Groups where r.FatherID != -1 select r ).ToList())); }
public DataTable searchStudents(string searchtxt, List <string> stuCodes) { List <string> los = new List <string>(); using (SchoolDBEntities sd = conn.GetContext()) { var pl = from r in sd.vStudents where r.StudentCode.Contains(searchtxt) || r.FirstName.Contains(searchtxt) || r.LastName.Contains(searchtxt) || r.FathersFirstName.Contains(searchtxt) || r.GradeTitle.Contains(searchtxt) select r.StudentCode; los = pl.ToList().Except(stuCodes).ToList(); } using (SchoolDBEntities sd = conn.GetContext()) { List <vStudent> lvs = new List <vStudent>(); var query = sd.vStudents.Where(v => los.Contains(v.StudentCode)); lvs = query.ToList(); return(OnlineTools.ToDataTable(lvs)); } }
public DataTable getAllGrades() { var query = from r in db.Grades select r; return(OnlineTools.ToDataTable(query.ToList())); }
public DataTable getStatesInfo() { var query = from r in database.States select new { r.StateID, r.StateName }; return(OnlineTools.ToDataTable(query.ToList())); }
public DataTable getCitiesInfoByStateID(int sid) { var query = from r in database.Cities where r.StateID == sid select new { r.CityID, r.CityName }; return(OnlineTools.ToDataTable(query.ToList())); }
public DataTable getJavabeTamrinInfoByTamrinID_OzviatID(int tamrinid, int ozviatid) { SchoolDBEntities db = new SchoolDBEntities(); var query = from r in db.JavabeTamrins where r.OzviatID == ozviatid && r.TamrinID == tamrinid select r; return(OnlineTools.ToDataTable(query.ToList())); }
public DataTable getTopEmploees() { var pl = (from r in database.EmployeeScores join h in database.Employees on r.EmployeeID equals h.EmployeeID orderby r.Score select new { r.FullName, r.Score, r.EmployeeID, h.empImage }).Take(5); return(OnlineTools.ToDataTable(pl.ToList())); }
public DataTable getEmployeeForScore() { List <EmployeeScore> result = new List <EmployeeScore>(); var pl = ( from r in database.EmployeeScores orderby r.Score descending select r); result = pl.ToList(); return(OnlineTools.ToDataTable(result.ToList())); }
public DataTable GetAllStudents() { List <vStudent> result = new List <vStudent>(); SchoolDBEntities sd = conn.GetContext(); var pl = from r in sd.vStudents select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); }
public DataTable FindByLGID(int lgid) { List <vOzviat> result = new List <vOzviat>(); SchoolDBEntities sd = conn.GetContext(); IEnumerable <vOzviat> pl = from r in sd.vOzviats where r.LGID == lgid select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); }
public DataTable FindByYeartest(string year) { List <vLessonGroup> result = new List <vLessonGroup>(); SchoolDBEntities sd = conn.GetContext(); IEnumerable <vLessonGroup> pl = from r in sd.vLessonGroups where r.Year.Contains(year) select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); }
public DataTable GetSessionByLGID(int lgid) { List <Sessoin> result = new List <Sessoin>(); SchoolDBEntities sd = conn.GetContext(); IEnumerable <Sessoin> pl = from r in sd.Sessoins where r.LGID == lgid orderby r.SessionID select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); }
public DataTable GetAllLessonGroups() { List <vLessonGroup> result = new List <vLessonGroup>(); SchoolDBEntities sd = conn.GetContext(); IEnumerable <vLessonGroup> pl = from r in sd.vLessonGroups orderby r.LGID select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); }
public DataTable FindByOzviat(string ozviat) { List <vbarnameHaftegi> result = new List <vbarnameHaftegi>(); SchoolDBEntities sd = conn.GetContext(); IEnumerable <vbarnameHaftegi> pl = from r in sd.vbarnameHaftegis where r.StudentCode == ozviat select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); }
protected void subgroup() { diverror.InnerHtml = ""; if (ddlSubGroups.SelectedValue != "-2") { ArticleRepository artrep = new ArticleRepository(); List <Article> articles = artrep.ReturnArticlesByCategory(ddlSubGroups.SelectedValue.ToInt()); if (articles.Count != 0) { gvPosts.DataSource = null; gvPosts.DataBind(); gvPosts.DataSource = OnlineTools.ToDataTable(articles); gvPosts.DataBind(); } else { gvPosts.DataSource = null; gvPosts.DataBind(); diverror.InnerHtml = " در این بخش مقاله ای وجود ندارد! "; } } else { if (ddlGroups.SelectedValue != "-2") { GroupsRepository Groupsrepo = new GroupsRepository(); List <int> subgroupsid = Groupsrepo.getSubGroupsIDByFatherID(ddlGroups.SelectedValue.ToInt()); ArticleRepository artrep = new ArticleRepository(); List <Article> articles = artrep.ReturnArticlesByCategory(subgroupsid); if (articles.Count != 0) { gvPosts.DataSource = null; gvPosts.DataSource = OnlineTools.ToDataTable(articles); gvPosts.DataBind(); } else { gvPosts.DataSource = null; gvPosts.DataBind(); diverror.InnerHtml = " در این بخش مقاله ای وجود ندارد! "; } } else { group(); } } }
public DataTable FindByHand(bool hand) { List <vStudent> result = new List <vStudent>(); using (SchoolDBEntities sd = conn.GetContext()) { IEnumerable <vStudent> pl = from r in sd.vStudents where r.Hand == hand select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); } }
public DataTable FindByFullName(string fullName) { List <vStudent> result = new List <vStudent>(); using (SchoolDBEntities sd = conn.GetContext()) { IEnumerable <vStudent> pl = from r in sd.vStudents where r.FirstName.Contains(fullName) || r.LastName.Contains(fullName) select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); } }
public DataTable GetAllLessons() { List <Lesson> result = new List <Lesson>(); using (SchoolDBEntities sd = conn.GetContext()) { IEnumerable <Lesson> pl = from r in sd.Lessons orderby r.LessonID select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); } }
public DataTable GetAllStudents() { List <vStudent> result = new List <vStudent>(); using (SchoolDBEntities sd = conn.GetContext()) { IEnumerable <vStudent> pl = from r in sd.vStudents orderby r.LastName select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); } }
public DataTable FindByBirthDate(string date) { List <vStudent> result = new List <vStudent>(); using (SchoolDBEntities sd = conn.GetContext()) { IEnumerable <vStudent> pl = from r in sd.vStudents where r.BirthDate == date select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); } }
public DataTable FindByTitle(string Name) { List <Lesson> result = new List <Lesson>(); using (SchoolDBEntities sd = conn.GetContext()) { IEnumerable <Lesson> pl = from r in sd.Lessons where r.LessonTitle.Contains(Name) select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); } }
public DataTable FindByFullName(string firstName, string lastName) { List <Karmand> result = new List <Karmand>(); using (SchoolDBEntities sd = conn.GetContext()) { IEnumerable <Karmand> pl = from r in sd.Karmands where r.FirstName.Contains(firstName) && r.LastName.Contains(lastName) select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); } }
public DataTable GetAllEmployees() { List <Karmand> result = new List <Karmand>(); using (SchoolDBEntities sd = conn.GetContext()) { IEnumerable <Karmand> pl = from r in sd.Karmands orderby r.LastName select r; result = pl.ToList(); return(OnlineTools.ToDataTable(result)); } }
public DataTable searchLessonsGroups(string text) { SchoolDBEntities pb = conn.GetContext(); List <vLessonGroup> llg = new List <vLessonGroup>(); var query = from r in pb.vLessonGroups where r.LessonTitle.Contains(text) || r.FirstName.Contains(text) || r.LastName.Contains(text) || r.GradeTitle.Contains(text) || r.Year.Contains(text) select r; llg = query.ToList(); return(OnlineTools.ToDataTable(llg)); }
public DataTable getPaymentHistoryByStuCode(string stuCode) { SchoolDBEntities pb = conn.GetContext(); var query = from r in pb.vPaymentHistories where r.StuCode == stuCode orderby r.HID descending select r; List <vPaymentHistory> lp = new List <vPaymentHistory>(); lp = query.ToList(); remainedSalary = lp.Sum(p => p.Mablagh); return(OnlineTools.ToDataTable(lp)); }
public DataTable searchStudents(string searchtxt) { List <vStudent> lvs = new List <vStudent>(); SchoolDBEntities sd = conn.GetContext(); var pl = from r in sd.vStudents where r.StudentCode.Contains(searchtxt) || r.FirstName.Contains(searchtxt) || r.LastName.Contains(searchtxt) || r.FathersFirstName.Contains(searchtxt) || r.GradeTitle.Contains(searchtxt) select r; lvs = pl.ToList(); return(OnlineTools.ToDataTable(lvs)); }
public void LoadSelectedStudents() { string id = Session["LGIDForClassMembers"].ToString(); List <vOzviat> vs = new List <vOzviat>(); List <string> St = or.FindStudentCodeByLGID(id.ToInt()); for (int i = 0; i < St.Count; i++) { vs.Add(or.FindStudentinOzviat(St[i])); } gvSelectedStudents.DataSource = OnlineTools.ToDataTable(vs);; gvSelectedStudents.DataBind(); lblStudentsCount.InnerText = St.Count.ToString(); vLessonGroup lgg = lg.FindByLGID(id.ToInt()); lblTeacherName.InnerText = lgg.FirstName + " " + lgg.LastName; lblClass.InnerText = lgg.Class; lblLesson.InnerText = lgg.LessonTitle; }
public DataTable GetAllStudentsExcept(List <string> stuCodes) { List <string> result1 = new List <string>(); using (SchoolDBEntities sd = conn.GetContext()) { IEnumerable <string> pl = from r in sd.vStudents select r.StudentCode; result1 = pl.ToList().Except(stuCodes).ToList(); List <vStudent> result2 = new List <vStudent>(); var query = sd.vStudents.Where(v => result1.Contains(v.StudentCode)); result2 = query.ToList(); return(OnlineTools.ToDataTable(result2)); } }
public DataTable searchEmployeeForScores(string s) { int a = -1; try { a = s.ToInt(); } catch { } List <EmployeeScore> result = new List <EmployeeScore>(); var pl = ( from r in database.EmployeeScores where r.FullName.Contains(s) || r.StateCity.Contains(s) || r.UserName.Contains(s) orderby r.Score select r); result = pl.ToList(); return(OnlineTools.ToDataTable(result.ToList())); }