123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- namespace FPER
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public partial class FireDesk_Operation : Form
- {
-
- public _Timer_WindowBase Timer_WindowBase_FireDesk_Operation = new _Timer_WindowBase();
-
- public FireDesk_Operation()
- {
- InitializeComponent();
-
-
-
-
- this.FormClosing += new FormClosingEventHandler(FireDesk_Operation_FormClosing);
-
-
-
-
- this.dataGridView_Main.Dock = DockStyle.Fill;
- this.dataGridView_Main.RowHeadersVisible = false;
- this.dataGridView_Main.AllowUserToAddRows = false;
- this.dataGridView_Main.Font = new System.Drawing.Font("굴림", 11F, System.Drawing.FontStyle.Bold);
- this.dataGridView_Main.Columns.Add("0", "연동타입");
-
- foreach (string id in _Data.Hash_Receiver_keys)
- {
- this.dataGridView_Main.Columns.Add(id, "수신기" + id);
-
- this.dataGridView_Main.Columns[id].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
- }
- this.dataGridView_Main.Columns[0].FillWeight = 170;
- this.dataGridView_Main.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
- this.dataGridView_Main.ScrollBars = ScrollBars.Both;
-
-
- this.Width = 170 + _Data.Hash_Receiver_keys.Length * 100;
- this.StartPosition = FormStartPosition.CenterScreen;
- this.TopMost = true;
-
-
-
- Timer_WindowBase_FireDesk_Operation.Create("FireDesk_Operation_Timer", 5000, FireDesk_Operation_Timer_Tick, true);
-
-
-
-
- _Data.FireDesk_Operation_Enable = true;
-
- GetOeprationCurrentStatus();
- }
-
- public void FireDesk_Operation_FormClosing(object sender, FormClosingEventArgs e)
- {
-
- this.Hide();
-
- _Data.FireDesk_Operation_Enable = false;
-
- Timer_WindowBase_FireDesk_Operation.Delete("FireDesk_Operation_Timer");
- }
-
- public void GetOeprationCurrentStatus()
- {
- this.dataGridView_Main.Rows.Clear();
-
- ArrayList DeviceTypeNames = new ArrayList();
-
-
-
-
-
- Hashtable ReceiverDeviceTypeNames = new Hashtable();
-
- foreach (string id in _Data.Hash_Receiver_keys)
- {
-
- _DacFireDesk DacFireDesk = new _DacFireDesk(id);
- DataTable dt = DacFireDesk.TB_DEVICE_TYPE_From_SelectAll();
- foreach (DataRow dr in dt.Rows)
- {
-
- string temp = dr["DEVICE_TYPE"].ToString();
-
- if (DeviceTypeNames.Contains(temp) == false)
- DeviceTypeNames.Add(temp);
- }
- if (ReceiverDeviceTypeNames.ContainsKey(id) == false)
- ReceiverDeviceTypeNames.Add(id, dt);
- }
-
-
-
- foreach (string DeviceTypeName in DeviceTypeNames)
- {
-
- string[] data = new string[ReceiverDeviceTypeNames.Count + 1];
-
-
-
- int i = 0;
-
- foreach (string id in _Data.Hash_Receiver_keys)
- {
- DataTable dt = (DataTable)ReceiverDeviceTypeNames[id];
- DataRow[] result = dt.Select(string.Format("DEVICE_TYPE='{0}'", DeviceTypeName));
-
- if (result.Length != 0)
- {
-
- data[0] = result[0]["DEVICE_TYPE_NAME"].ToString();
- string use_flag = result[0]["USE_FLAG"].ToString();
- string seq_no = result[0]["SEQ_NO"].ToString();
- string device_type = result[0]["DEVICE_TYPE"].ToString();
- i++;
- if (device_type == "OA")
- {
- data[i] = (use_flag == "Y") ? "O" : "X";
- }
- else if (seq_no != "0")
- {
- data[i] = (use_flag == "Y") ? "O" : "X";
- }
- else
- data[i] = "";
- }
- }
-
- int Cnt = 0;
- foreach (string id in _Data.Hash_Receiver_keys)
- {
- if (data[i] == null || data[i].Length == 0)
- {
- Cnt++;
- }
- }
-
- if (Cnt != ReceiverDeviceTypeNames.Count)
- {
- this.dataGridView_Main.Rows.Add(data);
- }
- }
- }
-
-
-
- public void FireDesk_Operation_Timer_Tick(object sender, EventArgs e)
- {
-
-
-
- GetOeprationCurrentStatus();
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
|