be1a57dfe30c23f2d99fc0f8d0c0c6329be546fc.svn-base 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Janus.Windows.GridEX;
  10. namespace IControls_FireManager
  11. {
  12. public partial class Form_Check_Device : Form
  13. {
  14. // 수신기 ID를 저장하기 위해서
  15. string Receiver_ID = null;
  16. public Form_Check_Device(string RECEIVER_ID)
  17. {
  18. InitializeComponent();
  19. // 수신기 ID 저장
  20. Receiver_ID = RECEIVER_ID;
  21. //** Form_ConfigMAP폼에서 전달됨 -> 컨텍스메뉴에서 회로정보 확인을 클릭하였을 경우 받는 이벤트
  22. _Event.Form_ConfigMAP_SendMessage_Event += new _Event.Form_ConfigMAP_SendMessage_Handler(_Event_Form_ConfigMAP_SendMessage_Event);
  23. }
  24. //** 해당 출력그룹에 출력 디바이스를 셋팅하는 함수
  25. public void _Event_Form_ConfigMAP_SendMessage_Event(string GroupID)
  26. {
  27. // 먼저 클리어 시키고 시작
  28. GridEX_Device.ClearItems();
  29. // No.를 출력하기 위해서
  30. int i = 1;
  31. //** TB_GROUP_DEVICE 테이블에서 해당그룹을 모두 가지고 와서 GridEX_OutDevice_IN_Group에 보여준다
  32. DataRowCollection DB_TABLE_DEVICE = _Db.ExecuteRead_SqlDataAdapter(_Sql.Search_Gruop_DeviceTable(GroupID, Receiver_ID));
  33. if (DB_TABLE_DEVICE != null)
  34. {
  35. foreach (DataRow dr in DB_TABLE_DEVICE)
  36. {
  37. try
  38. {
  39. if (_Convert.Exception_Into_object(dr[6], dr[7], dr[8], dr[9], dr[10]) == true)
  40. {
  41. // 매개변수 순서 => COMM_ID, BOARD_ID, LOOP_NO, REPEATER_ID, DEVICE_ID, INOUT_TYPE
  42. MskDeviceIDString dev_s = new MskDeviceIDString(
  43. _Convert.Null_to_IntZero(dr[6].ToString()),
  44. _Convert.Null_to_IntZero(dr[7].ToString()),
  45. _Convert.Null_to_IntZero(dr[8].ToString()),
  46. _Convert.Null_to_IntZero(dr[9].ToString()),
  47. _Convert.Null_to_IntZero(dr[10].ToString()),
  48. dr[11].ToString(), Receiver_ID); // cyim 2016.12.05 : 수신기 모델별 내부 로직 변경
  49. GridEXRow row;
  50. row = GridEX_Device.AddItem();
  51. row.BeginEdit();
  52. row.Cells["Number"].Value = i++;
  53. row.Cells["Receiver_ID"].Value = Receiver_ID;
  54. row.Cells["ID"].Value = dev_s.MskId;
  55. row.Cells["DeviceType"].Value = dr[0].ToString();
  56. row.Cells["Position"].Value = dr[1].ToString();
  57. row.Cells["DeviceName"].Value = dr[2].ToString();
  58. row.EndEdit();
  59. }
  60. }
  61. catch (Exception e)
  62. {
  63. // LOG
  64. _Event.DebugView_SendMessage_Write(e.ToString());
  65. // 정보를 가지고 오는데 문제가 발생하였습니다
  66. _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.ProblemMessage, 0);
  67. }
  68. }
  69. }
  70. }
  71. //** 폼 클로우즈
  72. private void Form_Check_Device_FormClosed(object sender, FormClosedEventArgs e)
  73. {
  74. //** 이벤트 해제
  75. _Event.Form_ConfigMAP_SendMessage_Event -= new _Event.Form_ConfigMAP_SendMessage_Handler(_Event_Form_ConfigMAP_SendMessage_Event);
  76. }
  77. }
  78. }