Exemplo n.º 1
0
 /// <summary>
 /// 重新载入实时事件
 /// </summary>
 private void LoadRealTimeInfo()
 {
     try
     {
         if (IsOut)
         {
             int allNum = int.Parse(new Graphics_RealTimeBLL().GetEmpInMineCounts());
             this.labTitle.Text = "实时分布: 共有" + allNum.ToString() + "人下井";
             List<string> list = new Graphics_AreaRealtimeBLL().GetAreaInfoAndEmpcount();
             //trvRealTime.Nodes["qy"].Nodes.Clear();
             //foreach (string s in list)
             //{
             //    trvRealTime.Nodes["qy"].Nodes.Add(s);
             //}
             if (list.Count >= trvRealTime.Nodes["qy"].Nodes.Count)
             {
                 for (int i = 0; i < list.Count; i++)
                 {
                     if (trvRealTime.Nodes["qy"].Nodes.ContainsKey("qy" + i.ToString()))
                         trvRealTime.Nodes["qy"].Nodes["qy" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["qy"].Nodes.Add("qy" + i.ToString(), list[i]);
                 }
             }
             else
             {
                 for (int i = 0; i < trvRealTime.Nodes["qy"].Nodes.Count; i++)
                 {
                     if (i < list.Count)
                         trvRealTime.Nodes["qy"].Nodes["qy" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["qy"].Nodes.RemoveAt(i);
                 }
             }
             list = new Graphics_RealTimeBLL().GetEmpWorkTypeNumRealTime(allNum);
             //trvRealTime.Nodes["gz"].Nodes.Clear();
             //foreach (string s in list)
             //{
             //    trvRealTime.Nodes["gz"].Nodes.Add(s);
             //}
             if (list.Count >= trvRealTime.Nodes["gz"].Nodes.Count)
             {
                 for (int i = 0; i < list.Count; i++)
                 {
                     if (trvRealTime.Nodes["gz"].Nodes.ContainsKey("gz" + i.ToString()))
                         trvRealTime.Nodes["gz"].Nodes["gz" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["gz"].Nodes.Add("gz" + i.ToString(), list[i]);
                 }
             }
             else
             {
                 for (int i = 0; i < trvRealTime.Nodes["gz"].Nodes.Count; i++)
                 {
                     if (i < list.Count)
                         trvRealTime.Nodes["gz"].Nodes["gz" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["gz"].Nodes.RemoveAt(i);
                 }
             }
             list = new Graphics_RealTimeBLL().GetRealTimeEmpNumByDept();
             //trvRealTime.Nodes["bm"].Nodes.Clear();
             //foreach (string s in list)
             //{
             //    trvRealTime.Nodes["bm"].Nodes.Add(s);
             //}    
             if (list.Count >= trvRealTime.Nodes["bm"].Nodes.Count)
             {
                 for (int i = 0; i < list.Count; i++)
                 {
                     if (trvRealTime.Nodes["bm"].Nodes.ContainsKey("bm" + i.ToString()))
                         trvRealTime.Nodes["bm"].Nodes["bm" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["bm"].Nodes.Add("bm" + i.ToString(), list[i]);
                 }
             }
             else
             {
                 for (int i = 0; i < trvRealTime.Nodes["bm"].Nodes.Count; i++)
                 {
                     if (i < list.Count)
                         trvRealTime.Nodes["bm"].Nodes["bm" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["bm"].Nodes.RemoveAt(i);
                 }
             }
         }
         FlashStationInfo();
     }
     catch (Exception ex)
     {
         FlashTimer.Stop();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 重新载入实时事件
 /// </summary>
 private void LoadRealTimeInfo()
 {
     try
     {
         if (IsOut)
         {
             int allNum = 0;
             try
             {
                 if (isRealTime)
                 {
                     allNum = int.Parse(new Graphics_RealTimeBLL().GetEmpInMineCounts());
                     this.labTitle.Text = "实时分布: 共有" + allNum.ToString() + "人下井";
                 }
                 else
                 {
                     allNum = Convert.ToInt32(ghepb.GetHisEmpNum(this.hisStartTime, this.hisEndTime));
                     this.labTitle.Text = "该时段共有" + allNum.ToString() + "人次下井";
                 }
             }
             catch (Exception ex)
             {
                 this.labTitle.Text = "共有" + allNum.ToString() + "人下井";
             }
             List<string> list;
             if (isRealTime)
             {
                 list = new Graphics_AreaRealtimeBLL().GetAreaInfoAndEmpcount();
             }
             else
             {
                 list = ghepb.GetAllAreaEmpNum(hisStartTime, hisEndTime);
             }
             if (list.Count >= trvRealTime.Nodes["qy"].Nodes.Count)
             {
                 for (int i = 0; i < list.Count; i++)
                 {
                     if (trvRealTime.Nodes["qy"].Nodes.ContainsKey("qy" + i.ToString()))
                         trvRealTime.Nodes["qy"].Nodes["qy" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["qy"].Nodes.Add("qy" + i.ToString(), list[i]);
                 }
             }
             else
             {
                 for (int i = 0; i < trvRealTime.Nodes["qy"].Nodes.Count; i++)
                 {
                     if (i < list.Count)
                         trvRealTime.Nodes["qy"].Nodes["qy" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["qy"].Nodes.RemoveAt(i);
                 }
             }
             if (isRealTime)
                 list = new Graphics_RealTimeBLL().GetEmpWorkTypeNumRealTime(allNum);
             else
                 list = ghepb.GetHisEmpWorkTypeNum(allNum, this.hisStartTime, this.hisEndTime);
             if (list.Count >= trvRealTime.Nodes["gz"].Nodes.Count)
             {
                 for (int i = 0; i < list.Count; i++)
                 {
                     if (trvRealTime.Nodes["gz"].Nodes.ContainsKey("gz" + i.ToString()))
                         trvRealTime.Nodes["gz"].Nodes["gz" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["gz"].Nodes.Add("gz" + i.ToString(), list[i]);
                 }
             }
             else
             {
                 for (int i = 0; i < trvRealTime.Nodes["gz"].Nodes.Count; i++)
                 {
                     if (i < list.Count)
                         trvRealTime.Nodes["gz"].Nodes["gz" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["gz"].Nodes.RemoveAt(i);
                 }
             }
             if (isRealTime)
                 list = new Graphics_RealTimeBLL().GetRealTimeEmpNumByDept();
             else
                 list = ghepb.GetHisEmpNumByDept(hisStartTime, hisEndTime);
             if (list.Count >= trvRealTime.Nodes["bm"].Nodes.Count)
             {
                 for (int i = 0; i < list.Count; i++)
                 {
                     if (trvRealTime.Nodes["bm"].Nodes.ContainsKey("bm" + i.ToString()))
                         trvRealTime.Nodes["bm"].Nodes["bm" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["bm"].Nodes.Add("bm" + i.ToString(), list[i]);
                 }
             }
             else
             {
                 for (int i = 0; i < trvRealTime.Nodes["bm"].Nodes.Count; i++)
                 {
                     if (i < list.Count)
                         trvRealTime.Nodes["bm"].Nodes["bm" + i.ToString()].Text = list[i];
                     else
                         trvRealTime.Nodes["bm"].Nodes.RemoveAt(i);
                 }
             }
         }
         List<string> stationlist = new Graphics_RealTimeBLL().GetAllStationState();
         //trvRealTime.Nodes["bm"].Nodes.Clear();
         //foreach (string s in list)
         //{
         //    trvRealTime.Nodes["bm"].Nodes.Add(s);
         //}    
         if (stationlist.Count >= trvStation.Nodes["cf"].Nodes.Count)
         {
             for (int i = 0; i < stationlist.Count; i++)
             {
                 if (trvStation.Nodes["cf"].Nodes.ContainsKey("cf" + i.ToString()))
                     trvStation.Nodes["cf"].Nodes["cf" + i.ToString()].Text = stationlist[i];
                 else
                     trvStation.Nodes["cf"].Nodes.Add("cf" + i.ToString(), stationlist[i]);
             }
         }
         else
         {
             for (int i = 0; i < trvStation.Nodes["cf"].Nodes.Count; i++)
             {
                 if (i < stationlist.Count)
                     trvStation.Nodes["cf"].Nodes["cf" + i.ToString()].Text = stationlist[i];
                 else
                     trvStation.Nodes["cf"].Nodes.RemoveAt(i);
             }
         }
         
         FlashStationInfo();
     }
     catch (Exception ex)
     {
         FlashTimer.Stop();
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 重新载入实时事件
        /// </summary>
        private void LoadRealTimeInfo()
        {
            try
            {
                trvRealTime.Nodes.Add("zong", "下井总人数");
                trvRealTime.Nodes.Add("qy", "按区域划分");
                trvRealTime.Nodes.Add("gz", "按工种划分");
                trvRealTime.Nodes.Add("bm", "按部门划分");
                trvRealTime.Nodes.Add("cf", "传输分站状态");
                int allNum = int.Parse(new Graphics_RealTimeBLL().GetEmpInMineCounts());
                trvRealTime.Nodes["zong"].Text = "实时分布: 共有" + allNum.ToString() + "人下井";
                List<string> list = new Graphics_AreaRealtimeBLL().GetAreaInfoAndEmpcount();
                //trvRealTime.Nodes["qy"].Nodes.Clear();
                //foreach (string s in list)
                //{
                //    trvRealTime.Nodes["qy"].Nodes.Add(s);
                //}
                if (list.Count >= trvRealTime.Nodes["qy"].Nodes.Count)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (trvRealTime.Nodes["qy"].Nodes.ContainsKey("qy" + i.ToString()))
                            trvRealTime.Nodes["qy"].Nodes["qy" + i.ToString()].Text = list[i];
                        else
                            trvRealTime.Nodes["qy"].Nodes.Add("qy" + i.ToString(), list[i]);
                    }
                }
                else
                {
                    for (int i = 0; i < trvRealTime.Nodes["qy"].Nodes.Count; i++)
                    {
                        if (i < list.Count)
                            trvRealTime.Nodes["qy"].Nodes["qy" + i.ToString()].Text = list[i];
                        else
                            trvRealTime.Nodes["qy"].Nodes.RemoveAt(i);
                    }
                }
                list = new Graphics_RealTimeBLL().GetEmpWorkTypeNumRealTime(allNum);
                //trvRealTime.Nodes["gz"].Nodes.Clear();
                //foreach (string s in list)
                //{
                //    trvRealTime.Nodes["gz"].Nodes.Add(s);
                //}
                if (list.Count >= trvRealTime.Nodes["gz"].Nodes.Count)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (trvRealTime.Nodes["gz"].Nodes.ContainsKey("gz" + i.ToString()))
                            trvRealTime.Nodes["gz"].Nodes["gz" + i.ToString()].Text = list[i];
                        else
                            trvRealTime.Nodes["gz"].Nodes.Add("gz" + i.ToString(), list[i]);
                    }
                }
                else
                {
                    for (int i = 0; i < trvRealTime.Nodes["gz"].Nodes.Count; i++)
                    {
                        if (i < list.Count)
                            trvRealTime.Nodes["gz"].Nodes["gz" + i.ToString()].Text = list[i];
                        else
                            trvRealTime.Nodes["gz"].Nodes.RemoveAt(i);
                    }
                }
                list = new Graphics_RealTimeBLL().GetRealTimeEmpNumByDept();
                //trvRealTime.Nodes["bm"].Nodes.Clear();
                //foreach (string s in list)
                //{
                //    trvRealTime.Nodes["bm"].Nodes.Add(s);
                //}    
                if (list.Count >= trvRealTime.Nodes["bm"].Nodes.Count)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (trvRealTime.Nodes["bm"].Nodes.ContainsKey("bm" + i.ToString()))
                            trvRealTime.Nodes["bm"].Nodes["bm" + i.ToString()].Text = list[i];
                        else
                            trvRealTime.Nodes["bm"].Nodes.Add("bm" + i.ToString(), list[i]);
                    }
                }
                else
                {
                    for (int i = 0; i < trvRealTime.Nodes["bm"].Nodes.Count; i++)
                    {
                        if (i < list.Count)
                            trvRealTime.Nodes["bm"].Nodes["bm" + i.ToString()].Text = list[i];
                        else
                            trvRealTime.Nodes["bm"].Nodes.RemoveAt(i);
                    }
                }
                list = new Graphics_RealTimeBLL().GetAllStationState();
                //trvRealTime.Nodes["bm"].Nodes.Clear();
                //foreach (string s in list)
                //{
                //    trvRealTime.Nodes["bm"].Nodes.Add(s);
                //}    
                if (list.Count >= trvRealTime.Nodes["cf"].Nodes.Count)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (trvRealTime.Nodes["cf"].Nodes.ContainsKey("cf" + i.ToString()))
                            trvRealTime.Nodes["cf"].Nodes["cf" + i.ToString()].Text = list[i];
                        else
                            trvRealTime.Nodes["cf"].Nodes.Add("cf" + i.ToString(), list[i]);
                    }
                }
                else
                {
                    for (int i = 0; i < trvRealTime.Nodes["cf"].Nodes.Count; i++)
                    {
                        if (i < list.Count)
                            trvRealTime.Nodes["cf"].Nodes["cf" + i.ToString()].Text = list[i];
                        else
                            trvRealTime.Nodes["cf"].Nodes.RemoveAt(i);
                    }
                }
            }
            catch (Exception ex)
            {

            }
        }