public List <ConventionList> QueryConventionapply() { var list = indexRepository.QueryConventionapply(); List <ConventionList> conventions = new List <ConventionList>(); for (int i = 0; i < list.Count; i++) { var teacher = indexRepository.QueryTeacherById(list[i].Contact); var section = indexRepository.QuerySectionById(teacher.Departmentid); if (teacher.Equals("")) { continue; } ConventionList convention = new ConventionList { id = list[i].Id, place = list[i].ConventionPlace, startTime = list[i].StartTime.ToString().Replace('T', ' '), endTime = list[i].EndTime.ToString().Replace('T', ' '), proposerName = teacher.Tname, proposerSection = section.Name, proposerPhone = teacher.Phone, }; if (list[i].ConventionState == 0) { convention.currentState = "正在审核"; } else if (list[i].ConventionState == 1) { convention.currentState = "通过申请"; } else { convention.currentState = "已被拒绝"; } conventions.Add(convention); } return(conventions); }