public List <AwardPunishList> QueryAwardPunish() { var list = indexRepository.QueryAwardPunish(); List <AwardPunishList> awardpunishList = new List <AwardPunishList>(); for (int i = 0; i < list.Count; i++) { var student = indexRepository.QueryStudentById(list[i].Sid); if (student.Equals("")) { continue; } var awardpunish = new AwardPunishList { id = list[i].Id, title = list[i].Title, applyTime = list[i].ApplyTime.ToString().Replace('T', ' '), checkTime = list[i].CheckTime.ToString().Replace('T', ' '), }; if (list[i].State == 0) { awardpunish.state = "等待审核"; } else if (list[i].State == 1) { awardpunish.state = "已通过"; } else { awardpunish.state = "已拒绝"; } awardpunishList.Add(awardpunish); } return(awardpunishList); }
public List <Award> QueryAllAwardDetail() { var list = indexRepository.QueryAwardPunish(); List <Award> awardList = new List <Award>(); for (int i = 0; i < list.Count; i++) { var student = indexRepository.QueryStudentById(list[i].Sid); if (student == null) { continue; } var awardDetail = new Award { id = list[i].Id, Sid = list[i].Sid, issue = list[i].Issue, content = list[i].Content, studentName = student.Name, studentClass = student.Class, grade = student.Grade, sex = student.Sex, title = list[i].Title, applyTime = list[i].ApplyTime.ToString().Replace('T', ' '), checkTime = list[i].CheckTime.ToString().Replace('T', ' '), }; if (list[i].PunishContent > 3) { awardDetail.awardContent = list[i].AwardContent; } else { continue; } if (list[i].State == 0) { awardDetail.state = "等待审核"; } else if (list[i].State == 1) { awardDetail.state = "已通过"; } else { awardDetail.state = "已拒绝"; } awardList.Add(awardDetail); } return(awardList); }