frmModalLoopSelect.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Collections;
  9. namespace FPER
  10. {
  11. public partial class frmModalLoopSelect : Form
  12. {
  13. MDIParent mdi = null;
  14. public frmModalLoopSelect(MDIParent pMDIParent)
  15. {
  16. InitializeComponent();
  17. mdi = pMDIParent; // cyim 2017.01.12 : 모델에 따라 선택할수 있는 통신보드가 틀리다
  18. }
  19. //입력값을 받고, 넘기기위한 VO
  20. private InputIDVo inputVo;
  21. public InputIDVo InputVo { get { return this.inputVo; } set { this.inputVo = value; } }
  22. //화면이동을 위해---------------
  23. private Boolean MoveOK = true;
  24. private Point mouseOffset;
  25. /********************************************************/
  26. /* MdiParent 화면이동 */
  27. /********************************************************/
  28. private void frmModalLoopSelect_MouseDown(object sender, MouseEventArgs e)
  29. {
  30. try
  31. {
  32. if (MoveOK)
  33. {
  34. mouseOffset = new Point(-e.X, -e.Y);
  35. }
  36. }
  37. catch (Exception ex)
  38. {
  39. Util.UErrorMessage(ex, 0, 0);
  40. }
  41. }
  42. private void frmModalLoopSelect_MouseMove(object sender, MouseEventArgs e)
  43. {
  44. try
  45. {
  46. if (MoveOK && (e.Button == MouseButtons.Left))
  47. {
  48. Point mousePos = Control.MousePosition;
  49. mousePos.Offset(mouseOffset.X, mouseOffset.Y);
  50. this.Location = mousePos;
  51. }
  52. }
  53. catch (Exception ex)
  54. {
  55. Util.UErrorMessage(ex, 0, 0);
  56. }
  57. }
  58. /********************************************************/
  59. private void frmModalLoopSelect_Load(object sender, EventArgs e)
  60. {
  61. try
  62. {
  63. txtReceiverId.Text = String.Format("{0:00}", inputVo.ReceiverID);
  64. //cboBoardId 에 item넣기-통신보드ID
  65. DacBoardConfig dacBoardConfig = new DacBoardConfig(inputVo.ReceiverID); // cyim 2015.7.30 데이타베이스 접속 루틴 변경
  66. ArrayList ary = dacBoardConfig.Board_List(inputVo.ReceiverID, mdi);
  67. Util.ComboSetting(cboBoardId, ary, null);
  68. cboBoardId.SelectedValue = inputVo.BoardID.ToString();
  69. cboLoopNo.SelectedValue = inputVo.LoopNo.ToString();
  70. }
  71. catch (Exception ex)
  72. {
  73. Util.UErrorMessage(ex, 0, 0);
  74. }
  75. }
  76. private void btnClose_Click(object sender, EventArgs e)
  77. {
  78. try
  79. {
  80. this.inputVo.InputOK = false;
  81. this.Close();
  82. }
  83. catch (Exception ex)
  84. {
  85. Util.UErrorMessage(ex, 0, 0);
  86. }
  87. }
  88. private void btnOK_Click(object sender, EventArgs e)
  89. {
  90. try
  91. {
  92. this.inputVo.ReceiverID = Util.StrToInt(this.txtReceiverId.Text, inputVo.ReceiverID);
  93. String selectedValue1 = cboBoardId.SelectedValue.ToString();
  94. String selectedValue2 = cboLoopNo.SelectedValue.ToString();
  95. int BoardId = Util.StrToInt(selectedValue1, -1);
  96. int LoopNo = Util.StrToInt(selectedValue2, -1);
  97. this.inputVo.BoardID = BoardId;
  98. this.inputVo.LoopNo = LoopNo;
  99. this.inputVo.InputOK = true;
  100. this.Close();
  101. }
  102. catch (Exception ex)
  103. {
  104. Util.UErrorMessage(ex, 0, 0);
  105. }
  106. }
  107. private void cboBoardId_SelectedIndexChanged(object sender, EventArgs e)
  108. {
  109. try
  110. {
  111. String selectedValue = cboBoardId.SelectedValue.ToString();
  112. int BoardId = Util.StrToInt(selectedValue, -1);
  113. //cboBoardId 에 item넣기-LoopNo
  114. DacBoardConfig dacBoardConfig = new DacBoardConfig(this.inputVo.ReceiverID); // cyim 2015.7.30 데이타베이스 접속 루틴 변경
  115. ArrayList ary = dacBoardConfig.Loop_List(this.inputVo.ReceiverID, BoardId);
  116. Util.ComboSetting(cboLoopNo, ary, null);
  117. }
  118. catch (Exception ex)
  119. {
  120. Util.UErrorMessage(ex, 0, 0);
  121. }
  122. }
  123. }
  124. }