using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Janus.Windows.GridEX; namespace IControls_FireManager { public partial class Form_Check_Device : Form { // 수신기 ID를 저장하기 위해서 string Receiver_ID = null; public Form_Check_Device(string RECEIVER_ID) { InitializeComponent(); // 수신기 ID 저장 Receiver_ID = RECEIVER_ID; //** Form_ConfigMAP폼에서 전달됨 -> 컨텍스메뉴에서 회로정보 확인을 클릭하였을 경우 받는 이벤트 _Event.Form_ConfigMAP_SendMessage_Event += new _Event.Form_ConfigMAP_SendMessage_Handler(_Event_Form_ConfigMAP_SendMessage_Event); } //** 해당 출력그룹에 출력 디바이스를 셋팅하는 함수 public void _Event_Form_ConfigMAP_SendMessage_Event(string GroupID) { // 먼저 클리어 시키고 시작 GridEX_Device.ClearItems(); // No.를 출력하기 위해서 int i = 1; //** TB_GROUP_DEVICE 테이블에서 해당그룹을 모두 가지고 와서 GridEX_OutDevice_IN_Group에 보여준다 DataRowCollection DB_TABLE_DEVICE = _Db.ExecuteRead_SqlDataAdapter(_Sql.Search_Gruop_DeviceTable(GroupID, Receiver_ID)); if (DB_TABLE_DEVICE != null) { foreach (DataRow dr in DB_TABLE_DEVICE) { try { if (_Convert.Exception_Into_object(dr[6], dr[7], dr[8], dr[9], dr[10]) == true) { // 매개변수 순서 => COMM_ID, BOARD_ID, LOOP_NO, REPEATER_ID, DEVICE_ID, INOUT_TYPE MskDeviceIDString dev_s = new MskDeviceIDString( _Convert.Null_to_IntZero(dr[6].ToString()), _Convert.Null_to_IntZero(dr[7].ToString()), _Convert.Null_to_IntZero(dr[8].ToString()), _Convert.Null_to_IntZero(dr[9].ToString()), _Convert.Null_to_IntZero(dr[10].ToString()), dr[11].ToString(), Receiver_ID); // cyim 2016.12.05 : 수신기 모델별 내부 로직 변경 GridEXRow row; row = GridEX_Device.AddItem(); row.BeginEdit(); row.Cells["Number"].Value = i++; row.Cells["Receiver_ID"].Value = Receiver_ID; row.Cells["ID"].Value = dev_s.MskId; row.Cells["DeviceType"].Value = dr[0].ToString(); row.Cells["Position"].Value = dr[1].ToString(); row.Cells["DeviceName"].Value = dr[2].ToString(); row.EndEdit(); } } catch (Exception e) { // LOG _Event.DebugView_SendMessage_Write(e.ToString()); // 정보를 가지고 오는데 문제가 발생하였습니다 _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.ProblemMessage, 0); } } } } //** 폼 클로우즈 private void Form_Check_Device_FormClosed(object sender, FormClosedEventArgs e) { //** 이벤트 해제 _Event.Form_ConfigMAP_SendMessage_Event -= new _Event.Form_ConfigMAP_SendMessage_Handler(_Event_Form_ConfigMAP_SendMessage_Event); } } }