123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- 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 frmModalLoopSelect : Form
- {
- MDIParent mdi = null;
- public frmModalLoopSelect(MDIParent pMDIParent)
- {
- InitializeComponent();
- mdi = pMDIParent; // cyim 2017.01.12 : 모델에 따라 선택할수 있는 통신보드가 틀리다
- }
- //입력값을 받고, 넘기기위한 VO
- private InputIDVo inputVo;
- public InputIDVo InputVo { get { return this.inputVo; } set { this.inputVo = value; } }
- //화면이동을 위해---------------
- private Boolean MoveOK = true;
- private Point mouseOffset;
- /********************************************************/
- /* MdiParent 화면이동 */
- /********************************************************/
- private void frmModalLoopSelect_MouseDown(object sender, MouseEventArgs e)
- {
- try
- {
- if (MoveOK)
- {
- mouseOffset = new Point(-e.X, -e.Y);
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- private void frmModalLoopSelect_MouseMove(object sender, MouseEventArgs e)
- {
- try
- {
- if (MoveOK && (e.Button == MouseButtons.Left))
- {
- Point mousePos = Control.MousePosition;
- mousePos.Offset(mouseOffset.X, mouseOffset.Y);
- this.Location = mousePos;
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- /********************************************************/
- private void frmModalLoopSelect_Load(object sender, EventArgs e)
- {
- try
- {
- txtReceiverId.Text = String.Format("{0:00}", inputVo.ReceiverID);
- //cboBoardId 에 item넣기-통신보드ID
- DacBoardConfig dacBoardConfig = new DacBoardConfig(inputVo.ReceiverID); // cyim 2015.7.30 데이타베이스 접속 루틴 변경
- ArrayList ary = dacBoardConfig.Board_List(inputVo.ReceiverID, mdi);
- Util.ComboSetting(cboBoardId, ary, null);
- cboBoardId.SelectedValue = inputVo.BoardID.ToString();
- cboLoopNo.SelectedValue = inputVo.LoopNo.ToString();
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- private void btnClose_Click(object sender, EventArgs e)
- {
- try
- {
- this.inputVo.InputOK = false;
- this.Close();
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- private void btnOK_Click(object sender, EventArgs e)
- {
- try
- {
- this.inputVo.ReceiverID = Util.StrToInt(this.txtReceiverId.Text, inputVo.ReceiverID);
- String selectedValue1 = cboBoardId.SelectedValue.ToString();
- String selectedValue2 = cboLoopNo.SelectedValue.ToString();
- int BoardId = Util.StrToInt(selectedValue1, -1);
- int LoopNo = Util.StrToInt(selectedValue2, -1);
- this.inputVo.BoardID = BoardId;
- this.inputVo.LoopNo = LoopNo;
- this.inputVo.InputOK = true;
- this.Close();
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- private void cboBoardId_SelectedIndexChanged(object sender, EventArgs e)
- {
- try
- {
- String selectedValue = cboBoardId.SelectedValue.ToString();
- int BoardId = Util.StrToInt(selectedValue, -1);
- //cboBoardId 에 item넣기-LoopNo
- DacBoardConfig dacBoardConfig = new DacBoardConfig(this.inputVo.ReceiverID); // cyim 2015.7.30 데이타베이스 접속 루틴 변경
- ArrayList ary = dacBoardConfig.Loop_List(this.inputVo.ReceiverID, BoardId);
- Util.ComboSetting(cboLoopNo, ary, null);
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- }
- }
|