//получить список элементов - вопрос, респондент, балл public List <PersonPoint> GetPersonPointList(Query query, List <Person> allPersons) { List <PersonPoint> personPointList = new List <PersonPoint>(); foreach (var pers in allPersons) { PersonPoint personPoint = new PersonPoint(); personPoint.Query = query; personPoint.Person = pers; personPoint.Point = IsPersonAnswersRight(query, pers) ? query.Point : 0; personPointList.Add(personPoint); } return(personPointList.OrderBy(e => e.Person.Id).ToList()); }
private void UpdatePerson(KeyValuePair <string, Point> item) { //根据对象ID找组 if (idDic.ContainsKey(item.Key)) { string groupid = idDic[item.Key]; var person = Obj.screenMap.DrawElementList.Where(o => MapGroupTypes.Person_.ToString() + item.Key == o.Key).ToArray(); if (person != null && person.Length == 1) { Obj.screenMap.MainMap.Dispatcher.BeginInvoke(new Action(() => { //修改位置 PersonPoint personPoint = person[0].Value as PersonPoint; if (personPoint != null) { if (personPoint.ElementTag != null && personPoint.ElementTag is MapPointEx) { MapPointEx p = personPoint.ElementTag as MapPointEx; if (p.X != item.Value.X || p.Y != item.Value.Y) { //移动位置 Obj.screenMap.RemoveElement(MapGroupTypes.Person_.ToString() + item.Key); Obj.screenMap.AddElement(personPoint, Obj.screenMap.GetMapPointEx(item.Value.X, item.Value.Y)); } } } })); } else { //添加 var group = Obj.screenMap.DrawElementList.Where(o => MapGroupTypes.MonitorGroup_.ToString() + groupid == o.Key).ToArray(); if (group != null && group.Length == 1) { Obj.screenMap.MainMap.Dispatcher.BeginInvoke(new Action(() => { OrgToMapStyle orgPoint = group[0].Value as OrgToMapStyle; PP_OrgInfo orginfo = orgPoint.OrgInfo; PersonPoint personPoint = new PersonPoint(orginfo, ObjDic[item.Key] as PP_PersonInfo); personPoint.ContextMenu = GetContextMenu(); Obj.screenMap.AddElement(personPoint, Obj.screenMap.GetMapPointEx(item.Value.X, item.Value.Y)); })); } } } }
private void itemTrack_Click(object sender, RoutedEventArgs e) { MenuItem item = sender as MenuItem; ContextMenu menu = item.Parent as ContextMenu; var target = menu.PlacementTarget as PersonPoint; if (target != null) { PP_OrgInfo orgInfo = target.OrgInfo; PP_PersonInfo personInfo = target.PersonInfo; PersonPoint group = new PersonPoint(orgInfo, personInfo); Track.TrackCondition conTrack = new Track.TrackCondition(group); conTrack.VehicleNum = personInfo.GUID; conTrack.Owner = VisualTreeHelperExtension.GetParentObject <System.Windows.Window>(Element); conTrack.Show(); } }
public void MakePeople(PersonPoint person) { peopleManager.MakePeople(person, scoreManager.GetNumPeople()); }