コード例 #1
0
 private void itemLIVEMonitor_Click(object sender, RoutedEventArgs e)
 {
     if (tv_PersonPlan.SelectedItem != null)
     {
         PP_OrgInfo orgInfo = tv_PersonPlan.SelectedItem as PP_OrgInfo;
         if (orgInfo != null)
         {
             ScheduleDetail[] scheduleDetails = Utility.getOrgGroupsBySchedule(Obj.Activity.Guid, Obj.Activity.ActivityStage);
             var obj = scheduleDetails.Where(itm =>
             {
                 if (itm.ScheduleOrgs != null && itm.ScheduleOrgs.Length > 0 && itm.ScheduleOrgs[0].OrgInfo.GUID == orgInfo.GUID)
                 {
                     return(true);
                 }
                 else
                 {
                     return(false);
                 }
             }).ToArray();
             if (obj != null && obj.Length == 1)
             {
                 string areaid          = obj[0].ScheduleOrgs[0].AREA_GUID;
                 Monitor.MonitorView rh = new Monitor.MonitorView(areaid, new List <PP_OrgInfo> {
                     orgInfo
                 });
                 rh.Title = "现场监测情况";
                 rh.ShowDialog();
             }
         }
     }
 }
コード例 #2
0
        /// <summary>
        /// 现场监测情况
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void itemLIVEMonitor_Click(object sender, RoutedEventArgs e)
        {
            MenuItem item = sender as MenuItem;

            if (item != null && item.Tag != null)
            {
                string AreaId = item.Tag.ToString();
                var    area   = Obj.ActivityPlaces.Where(itm => itm.Guid == AreaId).ToArray();
                if (area == null || area.Length == 0)
                {
                    MessageBox.Show("没有区域信息");
                    return;
                }
                else
                {
                    ScheduleDetail[] scheduleDetails = Utility.getOrgGroupsBySchedule(Obj.Activity.Guid, Obj.Activity.ActivityStage);
                    if (scheduleDetails == null)
                    {
                        MessageBox.Show("此区域没有相关信息!");
                        return;
                    }
                    var obj = scheduleDetails.Where(itm =>
                    {
                        if (itm.ScheduleOrgs != null && itm.ScheduleOrgs.Length > 0 && itm.ScheduleOrgs[0].AREA_GUID == AreaId)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }).ToArray();
                    if (obj != null && obj.Length > 0)
                    {
                        List <PP_OrgInfo> orgs = new List <PP_OrgInfo>();
                        foreach (var itm in obj)
                        {
                            orgs.Add(itm.ScheduleOrgs[0].OrgInfo);
                        }
                        string areaid          = obj[0].ScheduleOrgs[0].AREA_GUID;
                        Monitor.MonitorView rh = new Monitor.MonitorView(AreaId, orgs);
                        rh.Title = "现场监测情况";
                        rh.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("此区域没有相关信息!");
                        return;
                    }
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// 历史监测记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void itemHistoryMonitor_Click(object sender, RoutedEventArgs e)
        {
            MenuItem item = sender as MenuItem;

            if (item != null && item.Tag != null)
            {
                string AreaId = item.Tag.ToString();
                ActivityPlaceInfo[] placeInfo = Obj.ActivityPlaces.Where(itm => itm.Guid == AreaId).ToArray();
                if (placeInfo != null && placeInfo.Length == 1)
                {
                    Monitor.MonitorView rh = new Monitor.MonitorView(placeInfo[0]);
                    rh.Title = "历史监测记录";
                    rh.ShowDialog();
                }
            }
        }