using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Diagnostics; namespace FPER { public partial class frmMapConfig : Form { MDIParent mdi = null; delegate void deleFormInit(); LogFileCreate LFC = new LogFileCreate(); //¼±Åà item // ListViewItem IGroup_selectItem; // QUERYMode IGroup_cmd; // ListViewItem IGroupDevice_selectItem; // QUERYMode IGroupDevice_cmd; //¼±Åà item ListViewItem OGroup_selectItem; QUERYMode OGroup_cmd; ListViewItem OGroupDevice_selectItem; QUERYMode OGroupDevice_cmd; QUERYMode Map_cmd; ListViewItem Map_selectItem; public frmMapConfig() { InitializeComponent(); // cyim 2013.7.12 µðÀÚÀΰ³¼±ÀÛ¾÷ : ¸Ê¼³Á¤ this.button_Menu_Group.BackgroundImage = (Image)Properties.Resources.ÅǸ޴º¹öư_ÁÖȲ_100_30; } public void Form_Init() { try { } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.Source), Application.ProductName); } } string receiver_id = null; // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® : warning Á¦°Å private void frmMapConfig_Load(object sender, EventArgs e) { // cyim 2013.8.1 : ´õºí¹öÆÛ¸µ Àû¿ë SetStyle(ControlStyles.UserPaint, true); //this.UpdateStyles(); SetStyle(ControlStyles.AllPaintingInWmPaint, true); //this.UpdateStyles(); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.UpdateStyles(); try { mdi = (MDIParent)this.MdiParent; txtThisReceiverID.Text = string.Format("{0:00}", mdi.myReceiverID); // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® : warning Á¦°Å receiver_id = Int32.Parse(txtThisReceiverID.Text).ToString(); /***********************************************************************/ /* ÀԷ±׷ì */ /***********************************************************************/ //VIEW¸ðµå·Î º¯°æÇÑ´Ù. /* Util.GroupUIChange(panelIGroup, UIMode.cancel); //±×·ìÀÇ µ¥ÀÌÅ͸¦ ÃʱâÈ­ÇÑ´Ù. IGroupSelectData(null); IGroup_getData(); IGroupDevice_getData(); */ /***********************************************************************/ /***********************************************************************/ /* Ãâ·Â±×·ì */ /***********************************************************************/ //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Util.GroupUIChange(panelOGroup, UIMode.cancel); //±×·ìÀÇ µ¥ÀÌÅ͸¦ ÃʱâÈ­ÇÑ´Ù. OGroupSelectData(null); OGroup_getData(); OGroupDevice_getData(); /***********************************************************************/ /***********************************************************************/ /* ¸Ê */ /***********************************************************************/ //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Util.GroupUIChange(panelMap, UIMode.cancel); //¸Ê µ¥ÀÌÅ͸¦ ÃʱâÈ­ÇÑ´Ù. MapSelectData(null); Map_getData(); //IMap_getData(); //OMap_getData(); /***********************************************************************/ } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void frmMapConfig_Activated(object sender, EventArgs e) { try { this.mdi.SelectMenuIndex = 2; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void frmMapConfig_Disposed(object sender, EventArgs e) { try { this.mdi.SelectMenuIndex = 0; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } /******************************************************* * [ÀԷ±׷ì] LISTVIEW¿¡ µ¥ÀÌÅÍ ºÒ·¯¿À±â ******************************************************/ /* private void IGroup_getData() { try { IGroupSelectData(null); DacMap dacMap = new DacMap(mdi.myReceiverID); DataTable dt = dacMap.Group_Select(null,code_GroupIO.Input); ListViewIGroup.Items.Clear(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { ListViewItem item = new ListViewItem(Convert.ToString(dr["GROUP_ID"])); item.SubItems.Add(dr["GROUP_NAME"].ToString()); ListViewIGroup.Items.Add(item); } } } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } */ /* //¸®½ºÆ®VIEW¿¡ ±×·ì¼±Åýà private void ListViewIGroup_SelectedIndexChanged(object sender, EventArgs e) { try { ListView lv = (ListView)sender; if (lv.SelectedItems.Count > 0) { ListViewItem itm = lv.SelectedItems[0]; IGroup_cmd = QUERYMode.update; //VIEW¸ðµå·Î º¯°æÇÑ´Ù.[ÀԷ±׷ì] Util.GroupUIChange(panelIGroup, UIMode.input); IGroupSelectData(itm); IGroupDevice_getData(); } else { IGroup_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Util.GroupUIChange(panelIGroup, UIMode.cancel); IGroupSelectData(null); } } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } */ //±×·ìÇ¥½Ã //ÀÔ·Â±×·ì µ¥ÀÌÅÍ Ç¥½Ã /* private void IGroupSelectData(ListViewItem itm) { try { IGroup_selectItem = itm; if (itm == null) { txtIGroupID.Text = ""; txtIGroupName.Text = ""; if (IGroup_cmd == QUERYMode.insert) { txtIGroupID.ReadOnly = false; txtIGroupID.BackColor = Color.White; txtIGroupName.ReadOnly = false; btnIGroupOK.Enabled = true; } else { txtIGroupID.ReadOnly = true; txtIGroupID.BackColor = SystemColors.Control; btnIGroupAdd.Enabled = true; btnIGroupDel.Enabled = false; btnIGroupOK.Enabled = false; } btnIGroupDeviceAdd.Enabled = false; btnIGroupDeviceSearch.Enabled = false; } else { txtIGroupID.Text = itm.Text; txtIGroupID.BackColor = SystemColors.Control; txtIGroupName.Text = itm.SubItems[1].Text; txtIGroupID.ReadOnly = true; btnIGroupAdd.Enabled = true; btnIGroupDel.Enabled = true; btnIGroupOK.Enabled = true; btnIGroupDeviceAdd.Enabled = true; btnIGroupDeviceSearch.Enabled = true; } IGroupDeviceSelectData(null); } catch(Exception ex) { Util.UErrorMessage(ex,0,0); } } //±×·ìÃß°¡ private void btnIGroupAdd_Click(object sender, EventArgs e) { try { //ÀԷ¸ðµå·Î º¯°æÇÑ´Ù. IGroup_cmd = QUERYMode.insert; Util.GroupUIChange(panelIGroup, UIMode.input); IGroupSelectData(null); txtIGroupID.Text = "GI"; txtIGroupID.Focus(); btnIGroupAdd.Enabled = false; btnIGroupDel.Enabled = false; btnIGroupCancel.Visible = true; btnIGroupOK.Enabled = true; } catch(Exception ex) { Util.UErrorMessage(ex,0,0); } } //±×·ìÀúÀå private void btnIGroupOK_Click(object sender, EventArgs e) { try { if (IGroup_cmd == QUERYMode.insert || IGroup_cmd == QUERYMode.update) { Util.ChkTxtBox(txtIGroupID, "ÀԷ±׷ìID"); Util.ChkTxtBox(txtIGroupName, "ÀԷ±׷ì¸í"); String GroupID = txtIGroupID.Text.Trim(); String GroupName = txtIGroupName.Text.Trim(); DacMap dacMap = new DacMap(mdi.myReceiverID); dacMap.Group_Update(IGroup_cmd, GroupID, code_GroupIO.Input, GroupName); } IGroup_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Util.GroupUIChange(panelIGroup, UIMode.cancel); //µ¥ÀÌÅÍ ºÒ·¯¿À±â IGroup_getData(); IGroupDevice_getData(); IGroupSelectData(null); btnIGroupCancel.Visible = false; } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //±×·ì»èÁ¦ private void btnIGroupDel_Click(object sender, EventArgs e) { try { IGroup_cmd = QUERYMode.delete; String GroupID = txtIGroupID.Text.Trim(); String GroupName = txtIGroupName.Text.Trim(); String msg = string.Format("{0}[{1}]À»/¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?", GroupName, GroupID); if (MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) { DacMap dacMap = new DacMap(mdi.myReceiverID); dacMap.Group_Update(QUERYMode.delete, GroupID, code_GroupIO.Input, GroupName); } //VIEW¸ðµå·Î º¯°æÇÑ´Ù. IGroup_cmd = QUERYMode.select; Util.GroupUIChange(panelIGroup, UIMode.cancel); //ÀÔ·Â CLEAR IGroupSelectData(null); //µ¥ÀÌÅÍ ºÒ·¯¿À±â IGroup_getData(); IGroupDevice_getData(); } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void txtIGroupID_TextChanged(object sender, EventArgs e) { try { Util.ToUpper(txtIGroupID); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void mskIGroupDeviceID_TextChanged(object sender, EventArgs e) { try { String dev_id_s = mskIGroupDeviceID.Text.Trim(); if (dev_id_s.Length == 13) { String GroupID = txtIGroupID.Text.Trim(); //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-ÀԷ±׷ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-##(ȸ·ÎID) MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); if (dev_id.Comm_id == 3) { DacIODeviceConfig dacIODeviceConfig = new DacIODeviceConfig(); DataTable dt = dacIODeviceConfig.Device_Select(mdi.MyReceiverID , dev_id.Board_id,dev_id.Device_id, dev_id.Inout_type); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; txtIGroupDeviceTypeCode.Text = dr["DEVICE_TYPE"].ToString(); txtIGroupDeviceTypeName.Text = dr["DEVICE_TYPE_NAME"].ToString(); txtIGroupDeviceMemo.Text = dr["DEVICE_NAME"].ToString(); txtIGroupPositionCode.Text = dr["POSITION_CODE"].ToString(); txtIGroupPositionName.Text = dr["POSITION_NAME"].ToString(); } } else { DacDeviceConfig dacDeviceConfig = new DacDeviceConfig(); DataTable dt = dacDeviceConfig.Device_Select(mdi.MyReceiverID , dev_id.Board_id, dev_id.Loop_no, dev_id.Repeater_id, dev_id.Device_id, dev_id.Inout_type); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; txtIGroupDeviceTypeCode.Text = dr["DEVICE_TYPE"].ToString(); txtIGroupDeviceTypeName.Text = dr["DEVICE_TYPE_NAME"].ToString(); txtIGroupDeviceMemo.Text = dr["DEVICE_NAME"].ToString(); txtIGroupPositionCode.Text = dr["POSITION_CODE"].ToString(); txtIGroupPositionName.Text = dr["POSITION_NAME"].ToString(); } } } } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } */ /******************************************************* * [ÀԷ±׷ì ȸ·ÎÁ¤º¸] LISTVIEW¿¡ µ¥ÀÌÅÍ ºÒ·¯¿À±â ******************************************************/ /* private void IGroupDevice_getData() { try { IGroupDeviceSelectData(null); String GroupID = txtIGroupID.Text.Trim(); DacMap dacMap = new DacMap(mdi.myReceiverID); DataTable dt = dacMap.Group_Device_Select(GroupID, mdi.MyReceiverID); ListViewIGroupDevice.Items.Clear(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-ÀԷ±׷ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-##(ȸ·ÎID) String dev_id = dr["DEVICE_ID"].ToString(); MskDeviceIDString dev_s = new MskDeviceIDString(int.Parse(dr["COMM_ID"].ToString()), int.Parse(dr["BOARD_ID"].ToString()), int.Parse(dr["LOOP_NO"].ToString()) , int.Parse(dr["REPEATER_ID"].ToString()), int.Parse(dr["DEVICE_ID"].ToString()), dr["INOUT_TYPE"].ToString()); ListViewItem item = new ListViewItem(dev_s.MskId); item.SubItems.Add(dr["DEVICE_TYPE"].ToString() + "-" + dr["DEVICE_TYPE_NAME"].ToString()); item.SubItems.Add(dr["POSITION_CODE"].ToString() + "-" + dr["POSITION_NAME"].ToString()); item.SubItems.Add(dr["DEVICE_NAME"].ToString()); ListViewIGroupDevice.Items.Add(item); } } } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //ÀԷ±׷ì ȸ·Î µ¥ÀÌÅÍ Ç¥½Ã private void IGroupDeviceSelectData(ListViewItem itm) { try { IGroupDevice_selectItem = itm; if (itm == null) { mskIGroupDeviceID.Text = ""; txtIGroupDeviceTypeCode.Text = ""; txtIGroupDeviceTypeName.Text = ""; txtIGroupDeviceMemo.Text = ""; txtIGroupPositionCode.Text = ""; txtIGroupPositionName.Text = ""; if (IGroupDevice_cmd == QUERYMode.insert) { //mskIGroupDeviceID.ReadOnly = false; //mskIGroupDeviceID.BackColor = Color.White; btnIGroupDeviceOK.Enabled = true; btnIGroupDeviceSearch.Enabled = true; } else { //mskIGroupDeviceID.ReadOnly = true; //mskIGroupDeviceID.BackColor = SystemColors.Control; //btnIGroupDeviceAdd.Enabled = true; btnIGroupDeviceDel.Enabled = false; btnIGroupDeviceOK.Enabled = false; btnIGroupDeviceSearch.Enabled = false; } } else { String dev_id_s = itm.Text; dev_id_s = dev_id_s.Replace("-", ""); if (dev_id_s.Substring(0, 1).Equals("I")) { //IOº¸µå mskIGroupDeviceID.Mask = "A-A-00-00"; } else { //Áß°è±â>AA-00-0-000-0 mskIGroupDeviceID.Mask = ">AA-00-0-000-0"; } mskIGroupDeviceID.Text = dev_id_s; //mskIGroupDeviceID.BackColor = SystemColors.Control; String GroupDeviceType = itm.SubItems[1].Text; if (GroupDeviceType.Length > 0) { int pos = GroupDeviceType.IndexOf("-"); if (pos != -1) { txtIGroupDeviceTypeCode.Text = GroupDeviceType.Substring(0, pos); txtIGroupDeviceTypeName.Text = GroupDeviceType.Substring(pos+1); } } String GroupPostion = itm.SubItems[2].Text; if (GroupPostion.Length > 0) { int pos = GroupPostion.IndexOf("-"); if (pos != -1) { txtIGroupPositionCode.Text = GroupPostion.Substring(0, pos); txtIGroupPositionName.Text = GroupPostion.Substring(pos + 1); } } txtIGroupDeviceMemo.Text = itm.SubItems[3].Text; //mskIGroupDeviceID.ReadOnly = true; //btnIGroupDeviceAdd.Enabled = true; btnIGroupDeviceSearch.Enabled = false; btnIGroupDeviceDel.Enabled = true; btnIGroupDeviceOK.Enabled = true; } } catch(Exception ex) { Util.UErrorMessage(ex,0,0); } } private void btnIGroupCancel_Click(object sender, EventArgs e) { try { //VIEW¸ðµå·Î º¯°æÇÑ´Ù. IGroup_cmd = QUERYMode.select; Util.GroupUIChange(panelIGroup, UIMode.cancel); IGroupSelectData(null); btnIGroupCancel.Visible = false; } catch(Exception ex) { Util.UErrorMessage(ex,0,0); } } private void btnIGroupDeviceAdd_Click(object sender, EventArgs e) { try { //ÀԷ¸ðµå·Î º¯°æÇÑ´Ù. IGroupDevice_cmd = QUERYMode.insert; //Util.GroupControlChange(panelIGroupDevice, UIMode.input); //mskIGroupDeviceID.ReadOnly = false; IGroupDeviceSelectData(null); btnIGroupDeviceSearch.Focus(); btnIGroupDeviceAdd.Enabled = false; btnIGroupDeviceDel.Enabled = false; btnIGroupDeviceCancel.Visible = true; btnIGroupDeviceOK.Enabled = true; } catch(Exception ex) { Util.UErrorMessage(ex,0,0); } } private void btnIGroupDeviceDel_Click(object sender, EventArgs e) { try { String GroupID = txtIGroupID.Text.Trim(); String dev_id_s = mskIGroupDeviceID.Text.Trim(); //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-ÀԷ±׷ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-#(ȸ·ÎID) MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); String msg = string.Format("{0}À»/¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?", dev_id_s); IGroupDevice_cmd = QUERYMode.delete; if (MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) { DacMap dacMap = new DacMap(mdi.myReceiverID); dacMap.Group_Device_Update(IGroupDevice_cmd, GroupID, mdi.MyReceiverID, dev_id.Comm_id, dev_id.Board_id, dev_id.Loop_no, dev_id.Repeater_id, dev_id.Device_id, dev_id.Inout_type); } //VIEW¸ðµå·Î º¯°æÇÑ´Ù. IGroupDevice_cmd = QUERYMode.select; //Util.GroupControlChange(panelIGroupDevice, UIMode.cancel); //mskIGroupDeviceID.ReadOnly = true; //ÀÔ·Â CLEAR IGroupDeviceSelectData(null); //µ¥ÀÌÅÍ ºÒ·¯¿À±â IGroupDevice_getData(); } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void btnIGroupDeviceCancel_Click(object sender, EventArgs e) { try { //VIEW¸ðµå·Î º¯°æÇÑ´Ù. IGroupDevice_cmd = QUERYMode.select; //Util.GroupControlChange(panelIGroupDevice, UIMode.cancel); //mskIGroupDeviceID.ReadOnly = true; IGroupDeviceSelectData(null); btnIGroupDeviceCancel.Visible = false; btnIGroupDeviceAdd.Enabled = true; btnIGroupDeviceSearch.Enabled = true; } catch(Exception ex) { Util.UErrorMessage(ex,0,0); } } private void btnIGroupDeviceOK_Click(object sender, EventArgs e) { try { if (IGroupDevice_cmd == QUERYMode.insert || IGroupDevice_cmd == QUERYMode.update) { Util.ChkTxtBox(mskIGroupDeviceID, "ȸ·Î¹øÈ£"); String GroupID = txtIGroupID.Text.Trim(); String dev_id_s = mskIGroupDeviceID.Text; //MI-##-#-##### :M(±¸ºÐ M-Áß°è±â,I-ÀԷ±׷ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-#(ȸ·ÎID) MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); DacMap dacMap = new DacMap(mdi.myReceiverID); dacMap.Group_Device_Update(IGroupDevice_cmd, GroupID, mdi.MyReceiverID, dev_id.Comm_id, dev_id.Board_id, dev_id.Loop_no, dev_id.Repeater_id, dev_id.Device_id, dev_id.Inout_type); } IGroupDevice_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. //Util.GroupControlChange(panelIGroupDevice, UIMode.cancel); //mskIGroupDeviceID.ReadOnly = true; //µ¥ÀÌÅÍ ºÒ·¯¿À±â IGroupDevice_getData(); IGroupDeviceSelectData(null); btnIGroupDeviceAdd.Enabled = true; btnIGroupDeviceCancel.Visible = false; } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void ListViewIGroupDevice_SelectedIndexChanged(object sender, EventArgs e) { try { ListView lv = (ListView)sender; if (lv.SelectedItems.Count > 0) { ListViewItem itm = lv.SelectedItems[0]; IGroupDevice_cmd = QUERYMode.update; //VIEW¸ðµå·Î º¯°æÇÑ´Ù.[ÀԷ±׷ì] //Util.GroupControlChange(panelIGroupDevice, UIMode.input); //mskIGroupDeviceID.ReadOnly = false; IGroupDeviceSelectData(itm); } else { IGroupDevice_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. //Util.GroupControlChange(panelIGroupDevice, UIMode.cancel); //mskIGroupDeviceID.ReadOnly = true; IGroupDeviceSelectData(null); } } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //ȸ·Î°Ë»ö¹öư Ŭ¸¯½Ã private void btnIGroupDeviceSearch_Click(object sender, EventArgs e) { try { frmModalDeviceList frm = new frmModalDeviceList(); SearchCodeVo vo = new SearchCodeVo(null); InputIDVo inputVo = new InputIDVo(); inputVo.ReceiverID = this.mdi.MyReceiverID; inputVo.InoutType = code_InOutType.Input; String dev_id_s = mskIGroupDeviceID.Text.Trim(); if (dev_id_s.Length == 13) { //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-ÀԷ±׷ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-##(ȸ·ÎID) MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); inputVo.BoardID = dev_id.Board_id; inputVo.CommID = dev_id.Comm_id; inputVo.LoopNo = dev_id.Loop_no; inputVo.DeviceID = dev_id.Device_id; } frm.SearchCode = vo; frm.InputVo = inputVo; frm.ShowDialog(); vo = frm.SearchCode; //¼±ÅÃÇÑ Äڵ尡 ÀÖ´Ù¸é if (vo.SearchOK) { InputIDVo[] inputVos = (InputIDVo[])vo.SelectObject; if (inputVos.Length > 0) { //if (inputVos.Length == 1) //{ // MskDeviceIDString dev_id = new MskDeviceIDString(inputVos[0].CommID, inputVos[0].BoardID // , inputVos[0].LoopNo, inputVos[0].RepeaterID // , inputVos[0].DeviceID, inputVos[0].InoutType); // mskIGroupDeviceID.Text = dev_id.MskId; //} //else //{ String GroupID = txtIGroupID.Text.Trim(); DacMap dacMap = new DacMap(mdi.myReceiverID); for (int i = 0; i < inputVos.Length; i++) { //String dev_id_s = mskIGroupDeviceID.Text; ////MI-##-#-##### :M(±¸ºÐ M-Áß°è±â,I-ÀԷ±׷ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-#(ȸ·ÎID) //MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); MskDeviceIDString dev_id = new MskDeviceIDString(inputVos[i].CommID, inputVos[i].BoardID , inputVos[i].LoopNo, inputVos[i].RepeaterID , inputVos[i].DeviceID, inputVos[i].InoutType); dacMap.Group_Device_Update(IGroupDevice_cmd, GroupID, mdi.MyReceiverID, dev_id.Comm_id, dev_id.Board_id, dev_id.Loop_no, dev_id.Repeater_id, dev_id.Device_id, dev_id.Inout_type); } IGroupDevice_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. //Util.GroupControlChange(panelIGroupDevice, UIMode.cancel); //mskIGroupDeviceID.ReadOnly = true; //µ¥ÀÌÅÍ ºÒ·¯¿À±â IGroupDevice_getData(); IGroupDeviceSelectData(null); btnIGroupDeviceAdd.Enabled = true; //btnIGroupDeviceCancel.Visible = false; //} } } } catch (Exception ex) { Util.UErrorMessage(ex,0,0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } /******************************************************* * [Ãâ·Â±×·ì] LISTVIEW¿¡ µ¥ÀÌÅÍ ºÒ·¯¿À±â ******************************************************/ private void OGroup_getData() { try { OGroupSelectData(null); DacMap dacMap = new DacMap(mdi.myReceiverID); // cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ // cyim 2014.8.14 ±×·ìÁ¤º¸´Â ¼ö½Å±â¾ÆÀ̵𿡠µû¶ó Ãâ·ÂµÊ //DataTable dt = dacMap.Group_Select(null, code_GroupIO.Output); DataTable dt = dacMap.Group_Select(null, code_GroupIO.Output, receiver_id); // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® ListViewOGroup.Items.Clear(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { ListViewItem item = new ListViewItem(Convert.ToString(dr["GROUP_ID"])); item.SubItems.Add(dr["GROUP_NAME"].ToString()); ListViewOGroup.Items.Add(item); } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //¸®½ºÆ®VIEW¿¡ ±×·ì¼±Åýà private void ListViewOGroup_SelectedIndexChanged(object sender, EventArgs e) { try { ListView lv = (ListView)sender; if (lv.SelectedItems.Count > 0) { ListViewItem itm = lv.SelectedItems[0]; OGroup_cmd = QUERYMode.update; //VIEW¸ðµå·Î º¯°æÇÑ´Ù.[Ãâ·Â±×·ì] Util.GroupUIChange(panelOGroup, UIMode.input); OGroupSelectData(itm); OGroupDevice_getData(); } else { OGroup_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Util.GroupUIChange(panelOGroup, UIMode.cancel); OGroupSelectData(null); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //±×·ìÇ¥½Ã //Ãâ·Â±×·ì µ¥ÀÌÅÍ Ç¥½Ã private void OGroupSelectData(ListViewItem itm) { try { OGroup_selectItem = itm; if (itm == null) { txtOGroupID.Text = ""; txtOGroupName.Text = ""; if (OGroup_cmd == QUERYMode.insert) { txtOGroupID.ReadOnly = false; txtOGroupID.BackColor = Color.White; txtOGroupName.ReadOnly = false; btnOGroupOK.Enabled = true; } else { txtOGroupID.ReadOnly = true; txtOGroupID.BackColor = SystemColors.Control; btnOGroupAdd.Enabled = true; btnOGroupDel.Enabled = false; btnOGroupOK.Enabled = false; } btnOGroupDeviceAdd.Enabled = false; btnOGroupDeviceSearch.Enabled = false; } else { txtOGroupID.Text = itm.Text; txtOGroupID.BackColor = SystemColors.Control; txtOGroupName.Text = itm.SubItems[1].Text; txtOGroupID.ReadOnly = true; btnOGroupAdd.Enabled = true; btnOGroupDel.Enabled = true; btnOGroupOK.Enabled = true; btnOGroupDeviceAdd.Enabled = true; btnOGroupDeviceSearch.Enabled = true; } OGroupDeviceSelectData(null); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } //±×·ìÃß°¡ private void btnOGroupAdd_Click(object sender, EventArgs e) { try { //Ãâ·Â¸ðµå·Î º¯°æÇÑ´Ù. OGroup_cmd = QUERYMode.insert; Util.GroupUIChange(panelOGroup, UIMode.input); OGroupSelectData(null); txtOGroupID.Text = "GO"; txtOGroupID.Focus(); btnOGroupAdd.Enabled = false; btnOGroupDel.Enabled = false; btnOGroupCancel.Visible = true; btnOGroupOK.Enabled = true; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } //±×·ìÀúÀå private void btnOGroupOK_Click(object sender, EventArgs e) { try { if (OGroup_cmd == QUERYMode.insert || OGroup_cmd == QUERYMode.update) { Util.ChkTxtBox(txtOGroupID, "Ãâ·Â±×·ìID"); Util.ChkTxtBox(txtOGroupName, "Ãâ·Â±×·ì¸í"); String GroupID = txtOGroupID.Text.Trim(); String GroupName = txtOGroupName.Text.Trim(); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ dacMap.Group_Update(OGroup_cmd, GroupID, code_GroupIO.Output, GroupName); } OGroup_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Util.GroupUIChange(panelOGroup, UIMode.cancel); //µ¥ÀÌÅÍ ºÒ·¯¿À±â OGroup_getData(); OGroupDevice_getData(); OGroupSelectData(null); btnOGroupCancel.Visible = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //±×·ì»èÁ¦ private void btnOGroupDel_Click(object sender, EventArgs e) { try { OGroup_cmd = QUERYMode.delete; String GroupID = txtOGroupID.Text.Trim(); String GroupName = txtOGroupName.Text.Trim(); String msg = string.Format("{0}[{1}]À»/¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?", GroupName, GroupID); if (MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) { DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ dacMap.Group_Update(QUERYMode.delete, GroupID, code_GroupIO.Output, GroupName); } //VIEW¸ðµå·Î º¯°æÇÑ´Ù. OGroup_cmd = QUERYMode.select; Util.GroupUIChange(panelOGroup, UIMode.cancel); //Ãâ·Â CLEAR OGroupSelectData(null); //µ¥ÀÌÅÍ ºÒ·¯¿À±â OGroup_getData(); OGroupDevice_getData(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void txtOGroupID_TextChanged(object sender, EventArgs e) { try { Util.ToUpper(txtOGroupID); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void mskOGroupDeviceID_TextChanged(object sender, EventArgs e) { try { String dev_id_s = mskOGroupDeviceID.Text.Trim(); if (dev_id_s.Length == 13) { String GroupID = txtOGroupID.Text.Trim(); //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-Ãâ·Â±×·ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-##(ȸ·ÎID) MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); if (dev_id.Comm_id == 3) { DacIODeviceConfig dacIODeviceConfig = new DacIODeviceConfig(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ DataTable dt = dacIODeviceConfig.Device_Select(mdi.myReceiverID , dev_id.Board_id, dev_id.Device_id, dev_id.Inout_type); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; txtOGroupDeviceTypeCode.Text = dr["DEVICE_TYPE"].ToString(); txtOGroupDeviceTypeName.Text = dr["DEVICE_TYPE_NAME"].ToString(); txtOGroupDeviceMemo.Text = dr["DEVICE_NAME"].ToString(); txtOGroupPositionCode.Text = dr["POSITION_CODE"].ToString(); txtOGroupPositionName.Text = dr["POSITION_NAME"].ToString(); } } else { DacDeviceConfig dacDeviceConfig = new DacDeviceConfig(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ DataTable dt = dacDeviceConfig.Device_Select(mdi.myReceiverID , dev_id.Board_id, dev_id.Loop_no, dev_id.Repeater_id, dev_id.Device_id, dev_id.Inout_type); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; txtOGroupDeviceTypeCode.Text = dr["DEVICE_TYPE"].ToString(); txtOGroupDeviceTypeName.Text = dr["DEVICE_TYPE_NAME"].ToString(); txtOGroupDeviceMemo.Text = dr["DEVICE_NAME"].ToString(); txtOGroupPositionCode.Text = dr["POSITION_CODE"].ToString(); txtOGroupPositionName.Text = dr["POSITION_NAME"].ToString(); } } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } /******************************************************* * [Ãâ·Â±×·ì ȸ·ÎÁ¤º¸] LISTVIEW¿¡ µ¥ÀÌÅÍ ºÒ·¯¿À±â ******************************************************/ private void OGroupDevice_getData() { try { OGroupDeviceSelectData(null); String GroupID = txtOGroupID.Text.Trim(); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ DataTable dt = dacMap.Group_Device_Select(GroupID, mdi.myReceiverID); ListViewOGroupDevice.Items.Clear(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-Ãâ·Â±×·ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-##(ȸ·ÎID) String dev_id = dr["DEVICE_ID"].ToString(); MskDeviceIDString dev_s = new MskDeviceIDString(int.Parse(dr["COMM_ID"].ToString()), int.Parse(dr["BOARD_ID"].ToString()), int.Parse(dr["LOOP_NO"].ToString()) , int.Parse(dr["REPEATER_ID"].ToString()), int.Parse(dr["DEVICE_ID"].ToString()), dr["INOUT_TYPE"].ToString()); ListViewItem item = new ListViewItem(dr["RECEIVER_ID"].ToString() + ":" + dev_s.MskId); // cyim 2014.8.12 ¼ö½Å±â ¾ÆÀ̵ð±îÁö ȸ·Î¹øÈ£·Î º¸À̵µ·Ï ¼öÁ¤ item.SubItems.Add(dr["DEVICE_TYPE"].ToString() + "-" + dr["DEVICE_TYPE_NAME"].ToString()); item.SubItems.Add(dr["POSITION_CODE"].ToString() + "-" + dr["POSITION_NAME"].ToString()); item.SubItems.Add(dr["DEVICE_NAME"].ToString()); ListViewOGroupDevice.Items.Add(item); } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //Ãâ·Â±×·ì ȸ·Î µ¥ÀÌÅÍ Ç¥½Ã private void OGroupDeviceSelectData(ListViewItem itm) { try { OGroupDevice_selectItem = itm; if (itm == null) { mskOGroupDeviceID.Text = ""; txtOGroupDeviceTypeCode.Text = ""; txtOGroupDeviceTypeName.Text = ""; txtOGroupDeviceMemo.Text = ""; txtOGroupPositionCode.Text = ""; txtOGroupPositionName.Text = ""; if (OGroupDevice_cmd == QUERYMode.insert) { //mskOGroupDeviceID.ReadOnly = false; //mskOGroupDeviceID.BackColor = Color.White; btnOGroupDeviceOK.Enabled = true; btnOGroupDeviceSearch.Enabled = true; } else { //mskOGroupDeviceID.ReadOnly = true; //mskOGroupDeviceID.BackColor = SystemColors.Control; //btnOGroupDeviceAdd.Enabled = true; btnOGroupDeviceDel.Enabled = false; btnOGroupDeviceOK.Enabled = false; btnOGroupDeviceSearch.Enabled = false; } } else { String dev_id_s = itm.Text; dev_id_s = dev_id_s.Replace("-", ""); if (dev_id_s.Substring(0, 1).Equals("I")) { //IOº¸µå mskOGroupDeviceID.Mask = "A-A-00-00"; } else { //Áß°è±â>AA-00-0-000-0 mskOGroupDeviceID.Mask = ">AA-00-0-000-0"; } mskOGroupDeviceID.Text = dev_id_s; //mskOGroupDeviceID.BackColor = SystemColors.Control; String GroupDeviceType = itm.SubItems[1].Text; if (GroupDeviceType.Length > 0) { int pos = GroupDeviceType.IndexOf("-"); if (pos != -1) { txtOGroupDeviceTypeCode.Text = GroupDeviceType.Substring(0, pos); txtOGroupDeviceTypeName.Text = GroupDeviceType.Substring(pos + 1); } } String GroupPostion = itm.SubItems[2].Text; if (GroupPostion.Length > 0) { int pos = GroupPostion.IndexOf("-"); if (pos != -1) { txtOGroupPositionCode.Text = GroupPostion.Substring(0, pos); txtOGroupPositionName.Text = GroupPostion.Substring(pos + 1); } } txtOGroupDeviceMemo.Text = itm.SubItems[3].Text; //mskOGroupDeviceID.ReadOnly = true; //btnOGroupDeviceAdd.Enabled = true; btnOGroupDeviceSearch.Enabled = false; btnOGroupDeviceDel.Enabled = true; btnOGroupDeviceOK.Enabled = true; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void btnOGroupCancel_Click(object sender, EventArgs e) { try { //VIEW¸ðµå·Î º¯°æÇÑ´Ù. OGroup_cmd = QUERYMode.select; Util.GroupUIChange(panelOGroup, UIMode.cancel); OGroupSelectData(null); btnOGroupCancel.Visible = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void btnOGroupDeviceAdd_Click(object sender, EventArgs e) { try { //Ãâ·Â¸ðµå·Î º¯°æÇÑ´Ù. OGroupDevice_cmd = QUERYMode.insert; //Util.GroupControlChange(panelOGroupDevice, UIMode.Output); //mskOGroupDeviceID.ReadOnly = false; OGroupDeviceSelectData(null); btnOGroupDeviceSearch.Focus(); btnOGroupDeviceAdd.Enabled = false; btnOGroupDeviceDel.Enabled = false; btnOGroupDeviceCancel.Visible = true; btnOGroupDeviceOK.Enabled = true; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void btnOGroupDeviceDel_Click(object sender, EventArgs e) { try { String GroupID = txtOGroupID.Text.Trim(); String dev_id_s = mskOGroupDeviceID.Text.Trim(); //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-Ãâ·Â±×·ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-#(ȸ·ÎID) MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); String msg = string.Format("{0}À»/¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?", dev_id_s); OGroupDevice_cmd = QUERYMode.delete; if (MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) { DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ dacMap.Group_Device_Update(OGroupDevice_cmd, GroupID, mdi.myReceiverID, dev_id.Comm_id, dev_id.Board_id, dev_id.Loop_no, dev_id.Repeater_id, dev_id.Device_id, dev_id.Inout_type); } //VIEW¸ðµå·Î º¯°æÇÑ´Ù. OGroupDevice_cmd = QUERYMode.select; //Util.GroupControlChange(panelOGroupDevice, UIMode.cancel); //mskOGroupDeviceID.ReadOnly = true; //Ãâ·Â CLEAR OGroupDeviceSelectData(null); //µ¥ÀÌÅÍ ºÒ·¯¿À±â OGroupDevice_getData(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void btnOGroupDeviceCancel_Click(object sender, EventArgs e) { try { //VIEW¸ðµå·Î º¯°æÇÑ´Ù. OGroupDevice_cmd = QUERYMode.select; //Util.GroupControlChange(panelOGroupDevice, UIMode.cancel); //mskOGroupDeviceID.ReadOnly = true; OGroupDeviceSelectData(null); btnOGroupDeviceCancel.Visible = false; btnOGroupDeviceAdd.Enabled = true; btnOGroupDeviceSearch.Enabled = true; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void btnOGroupDeviceOK_Click(object sender, EventArgs e) { try { if (OGroupDevice_cmd == QUERYMode.insert || OGroupDevice_cmd == QUERYMode.update) { Util.ChkTxtBox(mskOGroupDeviceID, "ȸ·Î¹øÈ£"); String GroupID = txtOGroupID.Text.Trim(); String dev_id_s = mskOGroupDeviceID.Text; //MI-##-#-##### :M(±¸ºÐ M-Áß°è±â,I-Ãâ·Â±×·ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-#(ȸ·ÎID) MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ dacMap.Group_Device_Update(OGroupDevice_cmd, GroupID, mdi.myReceiverID, dev_id.Comm_id, dev_id.Board_id, dev_id.Loop_no, dev_id.Repeater_id, dev_id.Device_id, dev_id.Inout_type); } OGroupDevice_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. //Util.GroupControlChange(panelOGroupDevice, UIMode.cancel); //mskOGroupDeviceID.ReadOnly = true; //µ¥ÀÌÅÍ ºÒ·¯¿À±â OGroupDevice_getData(); OGroupDeviceSelectData(null); btnOGroupDeviceAdd.Enabled = true; btnOGroupDeviceCancel.Visible = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void ListViewOGroupDevice_SelectedIndexChanged(object sender, EventArgs e) { try { ListView lv = (ListView)sender; if (lv.SelectedItems.Count > 0) { ListViewItem itm = lv.SelectedItems[0]; OGroupDevice_cmd = QUERYMode.update; //VIEW¸ðµå·Î º¯°æÇÑ´Ù.[Ãâ·Â±×·ì] //Util.GroupControlChange(panelOGroupDevice, UIMode.Output); //mskOGroupDeviceID.ReadOnly = false; OGroupDeviceSelectData(itm); } else { OGroupDevice_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. //Util.GroupControlChange(panelOGroupDevice, UIMode.cancel); //mskOGroupDeviceID.ReadOnly = true; OGroupDeviceSelectData(null); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //ȸ·Î°Ë»ö¹öư Ŭ¸¯½Ã private void btnOGroupDeviceSearch_Click(object sender, EventArgs e) { try { frmModalDeviceList frm = new frmModalDeviceList(mdi); // cyim 2016.12.07 : ¼ö½Å±â ¸ðµ¨º° ³»ºÎ ·ÎÁ÷ º¯°æ SearchCodeVo vo = new SearchCodeVo(null); InputIDVo inputVo = new InputIDVo(); inputVo.ReceiverID = this.mdi.myReceiverID; inputVo.InoutType = code_InOutType.Output; String dev_id_s = mskOGroupDeviceID.Text.Trim(); if (dev_id_s.Length == 13) { //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-Ãâ·Â±×·ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-##(ȸ·ÎID) MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); inputVo.BoardID = dev_id.Board_id; inputVo.CommID = dev_id.Comm_id; inputVo.LoopNo = dev_id.Loop_no; inputVo.DeviceID = dev_id.Device_id; } frm.SearchCode = vo; frm.InputVo = inputVo; frm.ShowDialog(); vo = frm.SearchCode; //¼±ÅÃÇÑ Äڵ尡 ÀÖ´Ù¸é if (vo.SearchOK) { //inputVo = (InputIDVo)vo.SelectObject; InputIDVo[] inputVos = (InputIDVo[])vo.SelectObject; if (inputVos.Length > 0) { //if (inputVos.Length == 1) //{ // MskDeviceIDString dev_id = new MskDeviceIDString(inputVos[0].CommID, inputVos[0].BoardID // , inputVos[0].LoopNo, inputVos[0].RepeaterID // , inputVos[0].DeviceID, inputVos[0].InoutType); // mskOGroupDeviceID.Text = dev_id.MskId; //} //else //{ //String dev_id_s = mskOGroupDeviceID.Text; ////MI-##-#-##### :M(±¸ºÐ M-Áß°è±â,I-Ãâ·Â±×·ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-#(ȸ·ÎID) //MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); String GroupID = txtOGroupID.Text.Trim(); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ for (int i = 0; i < inputVos.Length; i++) { //String dev_id_s = mskIGroupDeviceID.Text; ////MI-##-#-##### :M(±¸ºÐ M-Áß°è±â,I-ÀԷ±׷ì)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-#(ȸ·ÎID) //MskDeviceIDString dev_id = new MskDeviceIDString(dev_id_s); MskDeviceIDString dev_id = new MskDeviceIDString(inputVos[i].CommID, inputVos[i].BoardID , inputVos[i].LoopNo, inputVos[i].RepeaterID , inputVos[i].DeviceID, inputVos[i].InoutType); dacMap.Group_Device_Update(OGroupDevice_cmd, GroupID, mdi.myReceiverID, dev_id.Comm_id, dev_id.Board_id, dev_id.Loop_no, dev_id.Repeater_id, dev_id.Device_id, dev_id.Inout_type); } OGroupDevice_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. //Util.GroupControlChange(panelOGroupDevice, UIMode.cancel); //mskOGroupDeviceID.ReadOnly = true; //µ¥ÀÌÅÍ ºÒ·¯¿À±â OGroupDevice_getData(); OGroupDeviceSelectData(null); btnOGroupDeviceAdd.Enabled = true; btnOGroupDeviceCancel.Visible = false; //} } //MskDeviceIDString dev_id = new MskDeviceIDString(inputVo.CommID, inputVo.BoardID // , inputVo.LoopNo, inputVo.RepeaterID // , inputVo.DeviceID, inputVo.InoutType); //mskOGroupDeviceID.Text = dev_id.MskId; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //------------------------------------------------ /******************************************************* * [¸Ê] LISTVIEW¿¡ µ¥ÀÌÅÍ ºÒ·¯¿À±â ******************************************************/ private void Map_getData() { try { MapSelectData(null); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ DataTable dt = dacMap.Map_Select(0); ListViewMap.Items.Clear(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { ListViewItem item = new ListViewItem(Convert.ToString(dr["MAP_NO"])); item.SubItems.Add(dr["MAP_ID"].ToString()); item.SubItems.Add(dr["MAP_NAME"].ToString()); ListViewMap.Items.Add(item); } } ListViewIMap.Items.Clear(); ListViewOMap.Items.Clear(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //¸®½ºÆ®VIEW¿¡ ¸Ê¼±Åýà private void ListViewMap_SelectedIndexChanged(object sender, EventArgs e) { try { ListView lv = (ListView)sender; if (lv.SelectedItems.Count > 0) { ListViewItem itm = lv.SelectedItems[0]; Map_cmd = QUERYMode.update; //VIEW¸ðµå·Î º¯°æÇÑ´Ù.[¸Ê] Util.GroupUIChange(panelMap, UIMode.input); MapSelectData(itm); IMap_getData(); OMap_getData(); } else { Map_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Util.GroupUIChange(panelMap, UIMode.cancel); MapSelectData(null); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //¸ÊÇ¥½Ã //¸Ê µ¥ÀÌÅÍ Ç¥½Ã private void MapSelectData(ListViewItem itm) { try { Map_selectItem = itm; if (itm == null) { txtMapNo.Text = ""; txtMapID.Text = ""; txtMapName.Text = ""; if (Map_cmd == QUERYMode.insert) { txtMapNo.ReadOnly = false; txtMapNo.BackColor = Color.White; txtMapID.ReadOnly = false; txtMapName.ReadOnly = false; btnMapOK.Enabled = true; } else { txtMapNo.ReadOnly = true; txtMapNo.BackColor = SystemColors.Control; btnMapAdd.Enabled = true; btnMapDel.Enabled = false; btnMapOK.Enabled = false; } btnIMapGroupAdd.Enabled = false; btnIMapDeviceAdd.Enabled = false; btnIMapDel.Enabled = false; btnOMapGroupAdd.Enabled = false; btnOMapDeviceAdd.Enabled = false; btnOMapDel.Enabled = false; } else { txtMapNo.Text = itm.Text; txtMapNo.BackColor = SystemColors.Control; txtMapID.Text = itm.SubItems[1].Text; txtMapName.Text = itm.SubItems[2].Text; txtMapNo.ReadOnly = true; btnMapAdd.Enabled = true; btnMapDel.Enabled = true; btnMapOK.Enabled = true; btnIMapGroupAdd.Enabled = true; btnIMapDeviceAdd.Enabled = true; btnIMapDel.Enabled = false; btnOMapGroupAdd.Enabled = true; btnOMapDeviceAdd.Enabled = true; btnOMapDel.Enabled = false; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } //¸ÊÃß°¡ private void btnMapAdd_Click(object sender, EventArgs e) { try { //ÀԷ¸ðµå·Î º¯°æÇÑ´Ù. Map_cmd = QUERYMode.insert; Util.GroupUIChange(panelMap, UIMode.input); MapSelectData(null); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ txtMapNo.Text = string.Format("{0}", dacMap.Map_Max_Select()); txtMapID.Text = "MAP"; txtMapID.Focus(); btnMapAdd.Enabled = false; btnMapDel.Enabled = false; btnMapCancel.Visible = true; btnMapOK.Enabled = true; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } //¸ÊÀúÀå private void btnMapOK_Click(object sender, EventArgs e) { try { if (Map_cmd == QUERYMode.insert || Map_cmd == QUERYMode.update) { Util.ChkTxtBox(txtMapNo, "¸ÊNo"); Util.ChkTxtBox(txtMapID, "¸ÊID"); Util.ChkTxtBox(txtMapName, "¸Ê¸í"); int MapNo = Util.StrToInt(txtMapNo.Text, 0); String MapID = txtMapID.Text.Trim(); String MapName = txtMapName.Text.Trim(); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ dacMap.Map_Update(Map_cmd, MapNo, MapID, MapName); } Map_cmd = QUERYMode.select; //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Util.GroupUIChange(panelMap, UIMode.cancel); //µ¥ÀÌÅÍ ºÒ·¯¿À±â Map_getData(); IMap_getData(); OMap_getData(); MapSelectData(null); btnMapCancel.Visible = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } //¸Ê»èÁ¦ private void btnMapDel_Click(object sender, EventArgs e) { try { Map_cmd = QUERYMode.delete; int MapNo = Util.StrToInt(txtMapNo.Text, 0); String MapID = txtMapID.Text.Trim(); String MapName = txtMapName.Text.Trim(); String msg = string.Format("{0}[{1}]À»/¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?", MapName, MapID); if (MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) { DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ dacMap.Map_Update(QUERYMode.delete, MapNo, MapID, MapName); } //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Map_cmd = QUERYMode.select; Util.GroupUIChange(panelMap, UIMode.cancel); //¸Ê CLEAR MapSelectData(null); //µ¥ÀÌÅÍ ºÒ·¯¿À±â Map_getData(); IMap_getData(); OMap_getData(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void txMapID_TextChanged(object sender, EventArgs e) { try { Util.ToUpper(txtMapID); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void btnMapCancel_Click(object sender, EventArgs e) { try { //VIEW¸ðµå·Î º¯°æÇÑ´Ù. Map_cmd = QUERYMode.select; Util.GroupUIChange(panelMap, UIMode.cancel); MapSelectData(null); btnMapCancel.Visible = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } /******************************************************* * [ÀÔ·Â¸Ê È¸·ÎÁ¤º¸] LISTVIEW¿¡ µ¥ÀÌÅÍ ºÒ·¯¿À±â ******************************************************/ private void IMap_getData() { try { int MapNo = Util.StrToInt(txtMapNo.Text, 0); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ DataTable dt = dacMap.Map_Process_Select(MapNo, code_GroupIO.Input, 0); ListViewIMap.Items.Clear(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-ÀԷ¸Ê)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-##(ȸ·ÎID) String process_type = dr["PROCESS_TYPE"].ToString(); string process_id = ""; if (process_type.Equals("D")) { MskDeviceIDString dev_s = new MskDeviceIDString(int.Parse(dr["COMM_ID"].ToString()), int.Parse(dr["BOARD_ID"].ToString()), int.Parse(dr["LOOP_NO"].ToString()) , int.Parse(dr["REPEATER_ID"].ToString()), int.Parse(dr["DEVICE_ID"].ToString()), dr["INOUT_TYPE"].ToString()); process_id = dev_s.MskId; } else { process_id = dr["GROUP_ID"].ToString(); } ListViewItem item = new ListViewItem(dr["SEQ_NO"].ToString()); item.SubItems.Add(dr["RECEIVER_ID"].ToString() + ":" + process_id); // cyim 2014.8.12 ¼ö½Å±â ¾ÆÀ̵ð±îÁö ȸ·Î¹øÈ£·Î º¸À̵µ·Ï ¼öÁ¤ item.SubItems.Add(dr["PROCESS_NAME"].ToString()); ListViewIMap.Items.Add(item); } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void ListViewIMap_SelectedIndexChanged(object sender, EventArgs e) { try { ListView lv = (ListView)sender; if (lv.SelectedItems.Count > 0) { ListViewItem itm = lv.SelectedItems[0]; //VIEW¸ðµå·Î º¯°æÇÑ´Ù.[ÀԷ¸Ê] btnIMapDel.Enabled = true; } else { //VIEW¸ðµå·Î º¯°æÇÑ´Ù. btnIMapDel.Enabled = false; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void btnIMapDel_Click(object sender, EventArgs e) { try { if (ListViewIMap.SelectedItems.Count > 0) { ListViewItem itm = ListViewIMap.SelectedItems[0]; int seq_no = Util.StrToInt(itm.Text, 0); String process_id = itm.SubItems[1].Text; String process_name = itm.SubItems[2].Text; String msg = string.Format("{0}[{1}]À»/¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?", process_name, process_id); if (MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) { int map_no = Util.StrToInt(txtMapNo.Text, 0); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ dacMap.Map_Process_Update(QUERYMode.delete, map_no, code_GroupIO.Input, seq_no, "", null, 0, 0, 0, 0, 0, 0, null); btnIMapDel.Enabled = false; } } //µ¥ÀÌÅÍ ºÒ·¯¿À±â IMap_getData(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void btnIMapGroupAdd_Click(object sender, EventArgs e) { try { frmModalGroupList frm = new frmModalGroupList(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ SearchCodeVo vo = new SearchCodeVo(code_GroupIO.Input); frm.SearchCode = vo; frm.ShowDialog(); vo = frm.SearchCode; //¼±ÅÃÇÑ Äڵ尡 ÀÖ´Ù¸é if (vo.SearchOK) { int map_no = Util.StrToInt(txtMapNo.Text, 0); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ int seq_no = dacMap.Map_Process_Seq_Max_Select(map_no, code_GroupIO.Input); dacMap.Map_Process_Update(QUERYMode.InsertAndUpdate, map_no, code_GroupIO.Input, seq_no, "G", vo.Code, this.mdi.myReceiverID, -1, -1, -1, -1, -1, null); IMap_getData(); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void btnIMapDeviceAdd_Click(object sender, EventArgs e) { try { frmModalDeviceList frm = new frmModalDeviceList(mdi); // cyim 2016.12.07 : ¼ö½Å±â ¸ðµ¨º° ³»ºÎ ·ÎÁ÷ º¯°æ SearchCodeVo vo = new SearchCodeVo(null); InputIDVo inputVo = new InputIDVo(); inputVo.ReceiverID = this.mdi.myReceiverID; inputVo.InoutType = code_InOutType.Input; frm.SearchCode = vo; frm.InputVo = inputVo; frm.ShowDialog(); vo = frm.SearchCode; //¼±ÅÃÇÑ Äڵ尡 ÀÖ´Ù¸é if (vo.SearchOK) { int map_no = Util.StrToInt(txtMapNo.Text, 0); InputIDVo[] inputVos = (InputIDVo[])vo.SelectObject; if (inputVos.Length > 0) { DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ for (int i = 0; i < inputVos.Length; i++) { int seq_no = dacMap.Map_Process_Seq_Max_Select(map_no, code_GroupIO.Input); dacMap.Map_Process_Update(QUERYMode.InsertAndUpdate, map_no, code_GroupIO.Input, seq_no, "D", null, inputVos[i].ReceiverID, inputVos[i].CommID, inputVos[i].BoardID , inputVos[i].LoopNo, inputVos[i].RepeaterID, inputVos[i].DeviceID, inputVos[i].InoutType); } IMap_getData(); } //inputVo = (InputIDVo)vo.SelectObject; //ListViewItem item = new ListViewItem(seq_no); //MskDeviceIDString dev_id = new MskDeviceIDString(inputVo.CommID, inputVo.BoardID // , inputVo.LoopNo, inputVo.RepeaterID // , inputVo.DeviceID, inputVo.InoutType); //item.SubItems.Add(dev_id.MskId); //ListViewIMap.Items.Add(item); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } /******************************************************* * [Ãâ·Â¸Ê ȸ·ÎÁ¤º¸] LISTVIEW¿¡ µ¥ÀÌÅÍ ºÒ·¯¿À±â ******************************************************/ private void OMap_getData() { try { int MapNo = Util.StrToInt(txtMapNo.Text, 0); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ DataTable dt = dacMap.Map_Process_Select(MapNo, code_GroupIO.Output, 0); ListViewOMap.Items.Clear(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { //MI-##-#-###-# :M(±¸ºÐ M-Áß°è±â,I-ÀԷ¸Ê)I,O(ȸ·Î±¸ºÐ)-##(º¸µåID)-##(ȸ·ÎID) String process_type = dr["PROCESS_TYPE"].ToString(); string process_id = ""; if (process_type.Equals("D")) { MskDeviceIDString dev_s = new MskDeviceIDString(int.Parse(dr["COMM_ID"].ToString()), int.Parse(dr["BOARD_ID"].ToString()), int.Parse(dr["LOOP_NO"].ToString()) , int.Parse(dr["REPEATER_ID"].ToString()), int.Parse(dr["DEVICE_ID"].ToString()), dr["INOUT_TYPE"].ToString()); process_id = dev_s.MskId; } else { process_id = dr["GROUP_ID"].ToString(); } ListViewItem item = new ListViewItem(dr["SEQ_NO"].ToString()); item.SubItems.Add(dr["RECEIVER_ID"].ToString() + ":" + process_id); // cyim 2014.8.12 ¼ö½Å±â ¾ÆÀ̵ð±îÁö ȸ·Î¹øÈ£·Î º¸À̵µ·Ï ¼öÁ¤ item.SubItems.Add(dr["PROCESS_NAME"].ToString()); ListViewOMap.Items.Add(item); } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void ListViewOMap_SelectedIndexChanged(object sender, EventArgs e) { try { ListView lv = (ListView)sender; if (lv.SelectedItems.Count > 0) { ListViewItem itm = lv.SelectedItems[0]; //VIEW¸ðµå·Î º¯°æÇÑ´Ù.[Ãâ·Â¸Ê] btnOMapDel.Enabled = true; } else { //VIEW¸ðµå·Î º¯°æÇÑ´Ù. btnOMapDel.Enabled = false; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void btnOMapDel_Click(object sender, EventArgs e) { try { if (ListViewOMap.SelectedItems.Count > 0) { ListViewItem itm = ListViewOMap.SelectedItems[0]; int seq_no = Util.StrToInt(itm.Text, 0); String process_id = itm.SubItems[1].Text; String process_name = itm.SubItems[2].Text; String msg = string.Format("{0}[{1}]À»/¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?", process_name, process_id); if (MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) { int map_no = Util.StrToInt(txtMapNo.Text, 0); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ dacMap.Map_Process_Update(QUERYMode.delete, map_no, code_GroupIO.Output, seq_no, "", null, 0, 0, 0, 0, 0, 0, null); btnOMapDel.Enabled = false; } } //µ¥ÀÌÅÍ ºÒ·¯¿À±â OMap_getData(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void btnOMapGroupAdd_Click(object sender, EventArgs e) { try { frmModalGroupList frm = new frmModalGroupList(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ SearchCodeVo vo = new SearchCodeVo(code_GroupIO.Output); frm.SearchCode = vo; frm.ShowDialog(); vo = frm.SearchCode; //¼±ÅÃÇÑ Äڵ尡 ÀÖ´Ù¸é if (vo.SearchOK) { int map_no = Util.StrToInt(txtMapNo.Text, 0); DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ int seq_no = dacMap.Map_Process_Seq_Max_Select(map_no, code_GroupIO.Output); dacMap.Map_Process_Update(QUERYMode.InsertAndUpdate, map_no, code_GroupIO.Output, seq_no, "G", vo.Code, this.mdi.myReceiverID, -1, -1, -1, -1, -1, null); OMap_getData(); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void btnOMapDeviceAdd_Click(object sender, EventArgs e) { try { frmModalDeviceList frm = new frmModalDeviceList(mdi); // cyim 2016.12.07 : ¼ö½Å±â ¸ðµ¨º° ³»ºÎ ·ÎÁ÷ º¯°æ SearchCodeVo vo = new SearchCodeVo(null); InputIDVo inputVo = new InputIDVo(); inputVo.ReceiverID = this.mdi.myReceiverID; inputVo.InoutType = code_InOutType.Output; frm.SearchCode = vo; frm.InputVo = inputVo; frm.ShowDialog(); vo = frm.SearchCode; //¼±ÅÃÇÑ Äڵ尡 ÀÖ´Ù¸é if (vo.SearchOK) { int map_no = Util.StrToInt(txtMapNo.Text, 0); InputIDVo[] inputVos = (InputIDVo[])vo.SelectObject; if (inputVos.Length > 0) { DacMap dacMap = new DacMap(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ for (int i = 0; i < inputVos.Length; i++) { int seq_no = dacMap.Map_Process_Seq_Max_Select(map_no, code_GroupIO.Output); dacMap.Map_Process_Update(QUERYMode.InsertAndUpdate, map_no, code_GroupIO.Output, seq_no, "D", null, inputVos[i].ReceiverID, inputVos[i].CommID, inputVos[i].BoardID , inputVos[i].LoopNo, inputVos[i].RepeaterID, inputVos[i].DeviceID, inputVos[i].InoutType); } OMap_getData(); } //inputVo = (InputIDVo)vo.SelectObject; //DacMap dacMap = new DacMap(mdi.myReceiverID); //int seq_no = dacMap.Map_Process_Seq_Max_Select(map_no, code_GroupIO.Output); //dacMap.Map_Process_Update(QUERYMode.InsertAndUpdate, map_no, code_GroupIO.Output, seq_no, // "D", null, inputVo.ReceiverID, inputVo.CommID, inputVo.BoardID, inputVo.LoopNo, inputVo.RepeaterID, inputVo.DeviceID, inputVo.InoutType); //OMap_getData(); //ListViewItem item = new ListViewItem(seq_no); //MskDeviceIDString dev_id = new MskDeviceIDString(inputVo.CommID, inputVo.BoardID // , inputVo.LoopNo, inputVo.RepeaterID // , inputVo.DeviceID, inputVo.InoutType); //item.SubItems.Add(dev_id.MskId); //ListViewOMap.Items.Add(item); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } private void btnReset_Click(object sender, EventArgs e) { try { ////¼³Á¤Á¤º¸°¡ º¯°æµÇ¾ú´Ù¸é ´Ù½Ã Àоî¶ó~~~~~~ //if (ThisReceiverConfig_Change_Flag) //{ this.Cursor = Cursors.WaitCursor; LFC.Log("ŸÀÔ: ¼ö½Å±â Á¶ÀÛ ·Î±×, ¸Þ¼¼Áö: ¸Ê¼³Á¤-¿¬µ¿¸Ê Àû¿ë"); mdi.ui.ReceiverDBRead(); //¼³Á¤Á¤º¸ º¯°æ mdi.FireReset_Process(); //µ¥¸ó RESET ¸í·É //} } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; } finally { this.Cursor = Cursors.Default; } } private void btnWinClose_Click(object sender, EventArgs e) { try { this.Close(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } // // cyim 2013.7.12 µðÀÚÀΰ³¼±ÀÛ¾÷ : ¸Ê¼³Á¤ // private void button_Menu_Group_Click(object sender, EventArgs e) { button_Menu_Color_Init(); this.tabControl1.SelectTab(0); this.button_Menu_Group.BackgroundImage = (Image)Properties.Resources.ÅǸ޴º¹öư_ÁÖȲ_100_30; this.panel_Menu.Focus(); } private void button_Menu_OperSet_Click(object sender, EventArgs e) { button_Menu_Color_Init(); this.tabControl1.SelectTab(1); this.button_Menu_OperSet.BackgroundImage = (Image)Properties.Resources.ÅǸ޴º¹öư_ÁÖȲ_100_30; this.panel_Menu.Focus(); } private void button_Menu_Color_Init() { this.button_Menu_Group.BackgroundImage = (Image)Properties.Resources.ÅǸ޴º¹öư_ȸ»ö_100_30; this.button_Menu_OperSet.BackgroundImage = (Image)Properties.Resources.ÅǸ޴º¹öư_ȸ»ö_100_30; } } }