public StringMapInt calcAllClass(out intMapString gidMapGname) { StringMapInt result = new StringMapInt(); intMapString gidMapGnameBuffer = new intMapString(); using (var context = new sail_heEntities()) { var ugradeList = context.ugrade.ToList(); ugradeList.ForEach(ele => { string gname = ele.gname; gidMapGnameBuffer.Add(ele.gid, ele.gname); result.Add(gname, ele.gid); }); } gidMapGname = gidMapGnameBuffer; return(result); }
public List <StudentInfo> calcAll(intMapString gidMapGname) { List <StudentInfo> studentS = new List <StudentInfo>(); StringMapInt result = new StringMapInt(); using (var context = new sail_heEntities()) { var resultList = context.ustudent.ToList(); resultList.ForEach(ele => { StudentInfo temp = new StudentInfo( ele.sname , (ele.ssexy) == "男" ? EnumGender.MALE : EnumGender.WOMAN , DateTime.Parse(ele.sbdate) , gidMapGname[int.Parse(ele.gid)] , ele.stele ); temp.setSduId(ele.sid); temp.ClassId = int.Parse(ele.gid); studentS.Add(temp); }); } return(studentS); }