private void StudentToolStripMenuItem_Click_1(object sender, EventArgs e) { this.Hide(); StudentSearch Stud = new StudentSearch(); Stud.ShowDialog(); }
private void searchToolStripMenuItem_Click(object sender, EventArgs e) { paneldetails.Controls.Clear(); StudentSearch newver = new StudentSearch(); paneldetails.Controls.Add(newver); }
/// <summary> /// this method is get list of employee and return json /// </summary> /// <returns></returns> public JsonResult GetStudentList(StudentSearch ss) { //var StudentList = db.Students.Where(a => a.IsActive == true || a.IsActive == null).ToList(); //return Json(StudentList, JsonRequestBehavior.AllowGet); using (var db = new StudentContext()) { db.Database.Initialize(force: false); var cmd = db.Database.Connection.CreateCommand(); cmd.CommandText = "Student_Listing"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@ID", ss.ID)); cmd.Parameters.Add(new SqlParameter("@FirstName", ss.FirstName)); cmd.Parameters.Add(new SqlParameter("@PageSize", ss.PageSize)); cmd.Parameters.Add(new SqlParameter("@CurrentPage", ss.CurrentPage)); db.Database.Connection.Open(); var reader = cmd.ExecuteReader(); List <StudentModel> StudentList = new List <StudentModel>(); StudentList = ((IObjectContextAdapter)db).ObjectContext.Translate <StudentModel>(reader).ToList(); reader.NextResult(); TotalRecord tr = new TotalRecord(); tr = ((IObjectContextAdapter)db).ObjectContext.Translate <TotalRecord>(reader).Single(); MainDataSet mds = new MainDataSet(); mds.StudentModelList = StudentList; mds.TotalRec = tr; return(Json(mds, JsonRequestBehavior.AllowGet)); } }
public IEnumerable <StudentInfo> GetAll(StudentSearch searchModel) { var query = from student in ctx.Students join classDetail in ctx.ClassDetail on student.StudentID equals classDetail.StudentID into classDetailGroup from ClassDetailGroup in classDetailGroup.DefaultIfEmpty() join classes in ctx.Classes on ClassDetailGroup.ClassID equals classes.ClassID into classesGroup from ClassesGroup in classesGroup.DefaultIfEmpty() select new { student, ClassesGroup }; if (!string.IsNullOrEmpty(searchModel.ParentId)) { query = query.Where(x => x.student.ParentId.Equals(searchModel.ParentId)); } if (!string.IsNullOrEmpty(searchModel.Name)) { query = query.Where(x => string.Format("{0} {1}", x.student.StudentLastName, x.student.StudentName).Contains(searchModel.Name)); } if (searchModel.ClassLevel != null) { query = query.Where(x => x.ClassesGroup.LevelID == searchModel.ClassLevel.Value); } if (searchModel.Limit != null) { query = query.Take(searchModel.Limit.Value); } if (searchModel.Offset != null) { query = query.Skip(searchModel.Offset.Value); } return(query.Select(x => new StudentInfo() { StudentId = x.student.StudentID , StudentLastName = x.student.StudentLastName , StudentName = x.student.StudentName , Gender = x.student.Gender , BirthDate = x.student.BirthDate , ParentId = x.student.ParentId , ImageLink = x.student.ImageLink , ClassName = x.ClassesGroup == null ? null : x.ClassesGroup.ClassName , ClassLevel = x.ClassesGroup == null ? null : (int?)x.ClassesGroup.LevelID }).ToList()); }
public ReturnListModel <StudentInfo> Get(StudentSearch searchModel) { //ReturnListModel<StudentInfo> returnList = new ReturnListModel<StudentInfo>(); StudentBL studentBL = new StudentBL(); //returnList.Items = studentBL.GetAll(searchModel); //returnList.Total = returnList.Items == null ? 0 : returnList.Items.Count(); return(new ReturnListModel <StudentInfo>(studentBL.GetAll(searchModel))); }
public async Task <ActionResult <StudentSearch> > GetStudentResponse() { var students = await _studentService.ListAsync(); var resources = _mapper.Map <IEnumerable <Student>, IEnumerable <StudentResource> >(students); var response = new StudentSearch(); response.number = resources.Count(); response.results = resources.ToArray(); return(response); }
public async Task OnSearchStudent() { if (String.IsNullOrEmpty(StudentSearch) || String.IsNullOrWhiteSpace(StudentSearch)) { await _confirmationDialogHelper.ErrorWindowShow("Veuillez remplir le champ de recherche."); } else { Students.Clear(); if (firstNameOrLastName.IsMatch(StudentSearch)) { for (int i = 0; i < GetStudents.Count; i++) { if (GetStudents[i].FirstName.ToLower().Contains(StudentSearch.ToLower())) { Students.Add(GetStudents[i]); } else if (GetStudents[i].LastName.ToLower().Contains(StudentSearch.ToLower())) { Students.Add(GetStudents[i]); } } } else if (fullNameRx.IsMatch(StudentSearch)) { var word = StudentSearch.Split(' '); var countWord = word.Length; foreach (var student in GetStudents) { int i = 0; var fullname = student.FirstName + " " + student.LastName; do { if (fullname.ToLower().Contains((word[i]).ToLower())) { if (i == countWord - 1) { Students.Add(student); } i++; } else { break; } } while (i < countWord); } } } }
public IList <Student> StudentSearch(StudentSearch model) { try { DynamicParameters parameters = new DynamicParameters(); parameters.Add("@SearchValue", model.SearchValue); parameters.Add("@SearchId", model.SearchId); IList <Student> list = SqlMapper.Query <Student>(con, "sp_StudentSearch", param: parameters, commandType: CommandType.StoredProcedure).ToList(); return(list); } catch (Exception ex) { throw ex; } }
private bool IsEditMode = false; //ForEditMode public Assignment() { InitializeComponent(); TeacherSearch.ForeColor = Color.Gray; TeacherSearch.Text = "Search Teacher's Name"; TeacherSearch.Select(TeacherSearch.TextLength, 0); StudentSearch.ForeColor = Color.Gray; StudentSearch.Text = "Search Student's Name"; StudentSearch.Select(StudentSearch.TextLength, 0); StatusSearch.ForeColor = Color.Gray; StatusSearch.Text = "Search Status's Name"; StatusSearch.Select(StatusSearch.Text.Length, 0); //ForDataSearch }
public async Task <IEnumerable <Models.Entity.Student> > GetStudentsAsync(StudentSearch search) { //Expression<Func<Models.Entity.Student, bool>> expression = c => // string.IsNullOrEmpty(search.Name) // || c.FirstName == search.Name; Expression <Func <Models.Entity.Student, bool> > expression = null; if (null != search) { Models.Entity.Student student = new Models.Entity.Student(); where.Equal("FirstName", search.Name, "and"); where.LessThanOrEqual(nameof(student.Birthday), search.Birthday, "and"); expression = where.GetExpression(); } return(await service.GetListAsync(expression)); }
public IActionResult StudentSearch(StudentSearch model) { ViewBag.SearchList = GetSearchList(); return(View(_StudentRepository.StudentSearch(model))); }
private void StudentSearch_Enter(object sender, EventArgs e) { StudentSearch.Clear(); StudentSearch.ForeColor = Color.Black; }
public IEnumerable <Models.Entity.Student> GetStudents(StudentSearch search) { return(service.GetList(c => string.IsNullOrEmpty(search.Name) || c.FirstName == search.Name)); }
public IEnumerable <StudentInfo> GetAll(StudentSearch searchModel) { return(new StudentDA().GetAll(searchModel)); }
public Task <BaseResultModel <Models.Entity.Student> > GetPageStudentsAsync(int pageIndex, int pageSize, Dictionary <string, string> sortDic, StudentSearch search) { throw new NotImplementedException(); }
public Task <IEnumerable <Models.Entity.Student> > GetStudentsAsync(StudentSearch studentSearch) { throw new NotImplementedException(); }
public async Task <BaseResultModel <Models.Entity.Student> > GetPageStudentsAsync(int pageIndex, int pageSize, Dictionary <string, string> sortDic, StudentSearch search) { Expression <Func <Models.Entity.Student, bool> > expression = null; if (null != search) { Models.Entity.Student student = new Models.Entity.Student(); where.Equal("FirstName", search.Name, "and"); where.LessThanOrEqual(nameof(student.Birthday), search.Birthday, "and"); expression = where.GetExpression(); } return(await service.GetPageListAsync(pageIndex, pageSize, sortDic, expression)); }