123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026 |
- 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;
- using System.Collections;
- using Janus.Windows.GridEX.EditControls;
- namespace IControls_FireManager
- {
-
-
-
-
-
- public partial class Form_AddDevice_Emergency : Form
- {
-
- Form DialogPopup_Del = new Form();
- Form DialogPopup_Save = new Form();
-
- ArrayList DeviceType = new ArrayList();
-
- ArrayList Sequence = new ArrayList();
-
- string Receiver_ID = null;
-
- string form_type = null;
-
-
- string device_type = null;
- public Form_AddDevice_Emergency(string RECEIVER_ID, string Form_Type, string InOutType)
- {
- InitializeComponent();
-
- Receiver_ID = RECEIVER_ID;
-
- form_type = Form_Type;
-
- device_type = InOutType;
-
- if (device_type == "I")
- this.Text = "입력 회로조회";
- if (device_type == "O")
- this.Text = "출력 회로조회";
-
- UI_Initialize();
-
- this.EditBox_Position.Text = _Data.Temp_Position;
- this.EditBox_DeviceName.Text = _Data.Temp_DeviceName;
-
-
-
- this.StartPosition = FormStartPosition.CenterScreen;
- this.Location = new System.Drawing.Point(MousePosition.X, MousePosition.Y);
-
- this.uiTabPage_IOboard.TabVisible = false;
- }
-
- public void UI_Initialize()
- {
-
- UiComboBox_Board_Receiver.Text = Receiver_ID;
- UiComboBox_IO_Receiver.Text = Receiver_ID;
-
- if (device_type == "I")
- {
- UiComboBox_Board_Receiver.Enabled = false;
- UiComboBox_IO_Receiver.Enabled = false;
- }
-
- if (device_type == "O" && form_type == "Group")
- {
- UiComboBox_Board_Receiver.Enabled = false;
- UiComboBox_IO_Receiver.Enabled = false;
- }
-
-
- CheckedComboBox_DeviceType.Clear();
-
- DataRowCollection DB_TABLE_DEVICE_TYPE = _Db.ExecuteRead_SqlDataAdapter(_Sql.SearchAll_Table_Value("TB_DEVICE_TYPE", null));
- if (DB_TABLE_DEVICE_TYPE != null && CheckedComboBox_DeviceType.DropDownList != null)
- {
- foreach (DataRow dr in DB_TABLE_DEVICE_TYPE)
- {
-
- GridEXRow row;
- row = CheckedComboBox_DeviceType.DropDownList.AddItem();
- row.BeginEdit();
- row.Cells["Device_Type"].Value = dr["DEVICE_TYPE_NAME"].ToString();
- row.EndEdit();
- }
- }
- }
-
- private void Form_AddDevice_FormClosed(object sender, FormClosedEventArgs e)
- {
- if (form_type == "Group")
- {
-
- _Event.Form_AddDevice_SendMessage_Write(DEVICE_EVENT.GROUP_SELECTIONMODE);
- }
- else if (form_type == "Map")
- {
-
- _Event.Form_AddDevice_SendMessage_Write(DEVICE_EVENT.MAP_SELECTIONMODE);
- }
- }
-
- private void UiButton_Search_Click(object sender, EventArgs e)
- {
-
- _Data.Temp_Position = this.EditBox_Position.Text;
- _Data.Temp_DeviceName = this.EditBox_DeviceName.Text;
-
-
-
- if (uiTabPage_board.Selected == true)
- {
-
- GridEX_Device.ClearItems();
-
- int i = 1;
-
-
- DataRowCollection DB_TABLE_DEVICE = null;
-
- if (((_RECEIVER)_Data.HASH_RECEIVER[Receiver_ID]).MODEL == "IFC3300")
- {
- DB_TABLE_DEVICE = _Db.ExecuteRead_SqlDataAdapter(
- _Sql.Search_DEVICETable_With_EMERGENCY_BigReceiver("1", device_type, UiComboBox_Board.Text, _Data.UI_CH_TO_LOOP(UiComboBox_Channel.Text), UiComboBox_Repeater.Text, EditBox_Position.Text, "", EditBox_DeviceName.Text, UiComboBox_Board_Receiver.Text, editBoxArea.Text, editBoxStair.Text, editBoxFloor.Text, this.uiCheckBox_Emergency.Checked));
- }
- else
- {
- if (UiComboBox_Board.Text.Length == 0)
- {
-
- DB_TABLE_DEVICE = _Db.ExecuteRead_SqlDataAdapter(
- _Sql.Search_DEVICETable_With_EMERGENCY("1", device_type, "15", _Data.UI_CH_TO_LOOP(UiComboBox_Channel.Text), UiComboBox_Repeater.Text, EditBox_Position.Text, "", EditBox_DeviceName.Text, UiComboBox_Board_Receiver.Text, editBoxArea.Text, editBoxStair.Text, editBoxFloor.Text, this.uiCheckBox_Emergency.Checked));
- }
- else
- {
-
- DB_TABLE_DEVICE = _Db.ExecuteRead_SqlDataAdapter(
- _Sql.Search_DEVICETable_With_EMERGENCY("1", device_type, UiComboBox_Board.Text, _Data.UI_CH_TO_LOOP(UiComboBox_Channel.Text), UiComboBox_Repeater.Text, EditBox_Position.Text, "", EditBox_DeviceName.Text, UiComboBox_Board_Receiver.Text, editBoxArea.Text, editBoxStair.Text, editBoxFloor.Text, this.uiCheckBox_Emergency.Checked));
- }
- }
- if (DB_TABLE_DEVICE != null)
- {
- foreach (DataRow dr in DB_TABLE_DEVICE)
- {
- try
- {
- if (_Convert.Exception_Into_object(dr[3], dr[4], dr[5], dr[6], dr[7]) == true)
- {
-
- if (DeviceType.Count == 0)
- {
-
- MskDeviceIDString dev_s = new MskDeviceIDString(
- _Convert.Null_to_IntZero(dr[3].ToString()),
- _Convert.Null_to_IntZero(dr[4].ToString()),
- _Convert.Null_to_IntZero(dr[5].ToString()),
- _Convert.Null_to_IntZero(dr[6].ToString()),
- _Convert.Null_to_IntZero(dr[7].ToString()),
- dr[8].ToString(), dr[9].ToString());
- GridEXRow row;
- row = GridEX_Device.AddItem();
- row.BeginEdit();
- row.Cells["Number"].Value = i++;
- 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.Cells["Receiver_ID"].Value = dr[9].ToString();
-
- row.Cells["Emergency"].Value = dr[10].ToString() + "-" + dr[11].ToString() + "-" + dr[12].ToString();
- row.EndEdit();
- }
- else
- {
- if (DeviceType.Contains(dr[0].ToString()) == true)
- {
-
- MskDeviceIDString dev_s = new MskDeviceIDString(
- _Convert.Null_to_IntZero(dr[3].ToString()),
- _Convert.Null_to_IntZero(dr[4].ToString()),
- _Convert.Null_to_IntZero(dr[5].ToString()),
- _Convert.Null_to_IntZero(dr[6].ToString()),
- _Convert.Null_to_IntZero(dr[7].ToString()),
- dr[8].ToString(), dr[9].ToString());
- GridEXRow row;
- row = GridEX_Device.AddItem();
- row.BeginEdit();
- row.Cells["Number"].Value = i++;
- 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.Cells["Receiver_ID"].Value = dr[9].ToString();
-
- row.Cells["Emergency"].Value = dr[10].ToString() + "-" + dr[11].ToString() + "-" + dr[12].ToString();
- row.EndEdit();
- }
- }
- }
- }
- catch (Exception Err1)
- {
-
- _Event.DebugView_SendMessage_Write(Err1.ToString());
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.ProblemMessage, 0);
- }
- }
- }
- }
-
-
-
- if (uiTabPage_IOboard.Selected == true)
- {
-
- GridEX_Device.ClearItems();
-
- int i = 1;
-
- if (UiComboBox_IOBoard.Text.Length == 0)
- {
- DataRowCollection DB_TABLE_DEVICE = null;
-
-
- if (((_RECEIVER)_Data.HASH_RECEIVER[Receiver_ID]).MODEL == "IFC3300")
- {
- DB_TABLE_DEVICE = _Db.ExecuteRead_SqlDataAdapter(_Sql.Search_DEVICETable_NoneBoardID_BigReceiver("3", device_type, "", "", "", "", "", UiComboBox_IO_Receiver.Text));
- }
- else
- {
- DB_TABLE_DEVICE = _Db.ExecuteRead_SqlDataAdapter(_Sql.Search_DEVICETable("3", device_type, "15", "", "", "", "", "", UiComboBox_IO_Receiver.Text));
- }
- if (DB_TABLE_DEVICE != null)
- {
- foreach (DataRow dr in DB_TABLE_DEVICE)
- {
- try
- {
- if (_Convert.Exception_Into_object(dr[3], dr[4], dr[5], dr[6], dr[7]) == true)
- {
-
- MskDeviceIDString dev_s = new MskDeviceIDString(
- _Convert.Null_to_IntZero(dr[3].ToString()),
- _Convert.Null_to_IntZero(dr[4].ToString()),
- _Convert.Null_to_IntZero(dr[5].ToString()),
- _Convert.Null_to_IntZero(dr[6].ToString()),
- _Convert.Null_to_IntZero(dr[7].ToString()),
- dr[8].ToString(), dr[9].ToString());
- GridEXRow row;
- row = GridEX_Device.AddItem();
- row.BeginEdit();
- row.Cells["Number"].Value = i++;
- 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.Cells["Receiver_ID"].Value = dr[9].ToString();
-
- row.Cells["Emergency"].Value = dr[10].ToString() + "-" + dr[11].ToString() + "-" + dr[12].ToString();
- row.EndEdit();
- }
- }
- catch (Exception Err3)
- {
-
- _Event.DebugView_SendMessage_Write(Err3.ToString());
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.ProblemMessage, 0);
- }
- }
- }
- }
-
- else
- {
- DataRowCollection DB_TABLE_DEVICE = _Db.ExecuteRead_SqlDataAdapter(_Sql.Search_DeviceTable("3", device_type, UiComboBox_IOBoard.Text, "", "", "", "", "", UiComboBox_IO_Receiver.Text));
- if (DB_TABLE_DEVICE != null)
- {
- foreach (DataRow dr in DB_TABLE_DEVICE)
- {
- try
- {
- if (_Convert.Exception_Into_object(dr[3], dr[4], dr[5], dr[6], dr[7]) == true)
- {
-
- MskDeviceIDString dev_s = new MskDeviceIDString(
- _Convert.Null_to_IntZero(dr[3].ToString()),
- _Convert.Null_to_IntZero(dr[4].ToString()),
- _Convert.Null_to_IntZero(dr[5].ToString()),
- _Convert.Null_to_IntZero(dr[6].ToString()),
- _Convert.Null_to_IntZero(dr[7].ToString()),
- dr[8].ToString(), dr[9].ToString());
- GridEXRow row;
- row = GridEX_Device.AddItem();
- row.BeginEdit();
- row.Cells["Number"].Value = i++;
- 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.Cells["Receiver_ID"].Value = dr[9].ToString();
-
- row.Cells["Emergency"].Value = dr[10].ToString() + "-" + dr[11].ToString() + "-" + dr[12].ToString();
- row.EndEdit();
- }
- }
- catch (Exception Err4)
- {
-
- _Event.DebugView_SendMessage_Write(Err4.ToString());
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.ProblemMessage, 0);
- }
- }
- }
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- private void CheckedComboBox_DeviceType_CheckedValuesChanged(object sender, EventArgs e)
- {
-
- DeviceType.Clear();
-
- CheckedComboBox checkedcombobox = (CheckedComboBox)sender;
-
-
- if (checkedcombobox.Text.Length != 0)
- {
-
- UiButton_Search.Focus();
-
- GridEXRow[] GridEx_Rows = this.CheckedComboBox_DeviceType.DropDownList.GetRows();
- foreach (GridEXRow row in GridEx_Rows)
- {
- if (row.Cells["Check"].Value.ToString() == "True")
- DeviceType.Add(row.Cells["Device_Type"].Value.ToString());
- }
- }
- }
-
- private void uiTab_Device_SelectedTabChanged(object sender, Janus.Windows.UI.Tab.TabEventArgs e)
- {
-
- GridEX_Device.ClearItems();
-
-
- UiComboBox_Board.Text = null;
- UiComboBox_Channel.Text = null;
- UiComboBox_Repeater.Text = null;
- EditBox_Position.Text = null;
- CheckedComboBox_DeviceType.Text = null;
- EditBox_DeviceName.Text = null;
-
- UiComboBox_IOBoard.Text = null;
- }
-
- private void UiComboBox_Board_Receiver_DroppingDown(object sender, CancelEventArgs e)
- {
-
- UiComboBox_Board_Receiver.Items.Clear();
- UiComboBox_Board_Receiver.Items.Add(_Text.Null);
- foreach (string receive in _Data.LIST_XMLRECEIVER_ID)
- {
- UiComboBox_Board_Receiver.Items.Add(receive);
- }
-
- UiComboBox_Board.Text = null;
- UiComboBox_Channel.Text = null;
- UiComboBox_Repeater.Text = null;
- }
-
- private void UiComboBox_Board_DroppingDown(object sender, CancelEventArgs e)
- {
-
- UiComboBox_Board.Text = null;
- UiComboBox_Board.Items.Clear();
-
- if (UiComboBox_Board_Receiver.Text.Length == 0) return;
- UiComboBox_Board.Items.Clear();
- DataRowCollection DB_TABLE_BOARD = _Db.ExecuteRead_SqlDataAdapter(_Sql.Search_BoardTable("1", "", "Y", UiComboBox_Board_Receiver.Text));
- if (DB_TABLE_BOARD != null)
- {
-
- UiComboBox_Board.Items.Add("");
- foreach (DataRow dr in DB_TABLE_BOARD)
- {
-
- UiComboBox_Board.Items.Add(dr["BOARD_ID"]);
- }
- }
-
- UiComboBox_Channel.Text = null;
- UiComboBox_Repeater.Text = null;
- }
-
- private void UiComboBox_Channel_DroppingDown(object sender, CancelEventArgs e)
- {
-
- UiComboBox_Channel.Text = null;
- UiComboBox_Channel.Items.Clear();
-
- if (UiComboBox_Board.Text.Length == 0) return;
-
- UiComboBox_Channel.Items.Clear();
- DataRowCollection DB_TABLE_BOARD = _Db.ExecuteRead_SqlDataAdapter(_Sql.Search_BoardTable("1", UiComboBox_Board.Text, "Y", UiComboBox_Board_Receiver.Text));
- if (DB_TABLE_BOARD != null)
- {
-
- if (UiComboBox_Channel.Items.Contains("") == false) UiComboBox_Channel.Items.Add("");
- foreach (DataRow dr in DB_TABLE_BOARD)
- {
- if (dr["LOOP0_USE_FLAG"].ToString() == "Y")
- {
- if (UiComboBox_Channel.Items.Contains("0") == false)
- UiComboBox_Channel.Items.Add("CH1");
- }
- if (dr["LOOP1_USE_FLAG"].ToString() == "Y")
- {
- if (UiComboBox_Channel.Items.Contains("1") == false)
- UiComboBox_Channel.Items.Add("CH2");
- }
- if (((_RECEIVER)_Data.HASH_RECEIVER[Receiver_ID]).MODEL == "IFC3300")
- {
- if (dr["LOOP2_USE_FLAG"].ToString() == "Y")
- {
- if (UiComboBox_Channel.Items.Contains("2") == false)
- UiComboBox_Channel.Items.Add("CH3");
- }
- if (dr["LOOP3_USE_FLAG"].ToString() == "Y")
- {
- if (UiComboBox_Channel.Items.Contains("3") == false)
- UiComboBox_Channel.Items.Add("CH4");
- }
- }
- }
- }
-
- UiComboBox_Repeater.Text = null;
- }
-
- private void UiComboBox_Repeater_DroppingDown(object sender, CancelEventArgs e)
- {
-
- UiComboBox_Repeater.Text = null;
- UiComboBox_Repeater.Items.Clear();
-
- if (UiComboBox_Channel.Text.Length == 0) return;
- DataRowCollection DB_TABLE_TB_REPEATER = _Db.ExecuteRead_SqlDataAdapter(_Sql.Search_RepeaterTable("1", UiComboBox_Board.Text, _Data.UI_CH_TO_LOOP(UiComboBox_Channel.Text), UiComboBox_Board_Receiver.Text));
- if (DB_TABLE_TB_REPEATER != null)
- {
-
- if (UiComboBox_Repeater.Items.Contains("") == false) UiComboBox_Repeater.Items.Add("");
- foreach (DataRow dr in DB_TABLE_TB_REPEATER)
- {
- if (UiComboBox_Repeater.Items.Contains(dr["REPEATER_ID"].ToString()) == false)
- UiComboBox_Repeater.Items.Add(dr["REPEATER_ID"].ToString());
- }
- }
- }
-
- private void UiComboBox_IO_Receiver_DroppingDown(object sender, CancelEventArgs e)
- {
-
- UiComboBox_IO_Receiver.Items.Clear();
- UiComboBox_IO_Receiver.Items.Add(_Text.Null);
- foreach (string receive in _Data.LIST_XMLRECEIVER_ID)
- {
- UiComboBox_IO_Receiver.Items.Add(receive);
- }
-
- UiComboBox_IOBoard.Text = null;
- }
-
- private void UiComboBox_IOBoard_DroppingDown(object sender, CancelEventArgs e)
- {
-
- UiComboBox_IOBoard.Text = null;
- UiComboBox_IOBoard.Items.Clear();
-
- if (UiComboBox_IO_Receiver.Text.Length == 0) return;
- DataRowCollection DB_TABLE_IOBOARD = _Db.ExecuteRead_SqlDataAdapter(_Sql.Search_BoardTable("3", "", "Y", UiComboBox_IO_Receiver.Text));
- if (DB_TABLE_IOBOARD != null)
- {
-
- UiComboBox_IOBoard.Items.Add("");
- foreach (DataRow dr in DB_TABLE_IOBOARD)
- {
-
- if (
- (((_RECEIVER)_Data.HASH_RECEIVER[Receiver_ID]).MODEL == "IFC3300" && dr["BOARD_ID"].ToString() != "0")
- || (((_RECEIVER)_Data.HASH_RECEIVER[Receiver_ID]).MODEL != "IFC3300" && dr["BOARD_ID"].ToString() != "15")
- )
-
- {
- if (UiComboBox_IOBoard.Items.Contains(dr["BOARD_ID"].ToString()) == false)
- UiComboBox_IOBoard.Items.Add(dr["BOARD_ID"]);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
- }
- }
-
- private void UiButton_Clear_Click(object sender, EventArgs e)
- {
-
- UiComboBox_Board_Receiver.Text = "";
- UiComboBox_Board.Text = "";
- UiComboBox_Channel.Text = "";
- UiComboBox_Repeater.Text = "";
- EditBox_Position.Text = "";
- CheckedComboBox_DeviceType.Text = "";
- EditBox_DeviceName.Text = "";
-
- UiComboBox_IO_Receiver.Text = "";
- UiComboBox_IOBoard.Text = "";
-
- editBoxArea.Text = "";
- editBoxStair.Text = "";
- editBoxFloor.Text = "";
- uiCheckBox_Emergency.Checked = false;
- }
-
- private void UiButton_Close_Click(object sender, EventArgs e)
- {
- this.Close();
- }
-
- private void UiButton_DelDevice_Click(object sender, EventArgs e)
- {
-
- int SelectRowCount = GridEX_Device.SelectedItems.Count;
-
- if (SelectRowCount == 0)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.InDeviceNotChoice, 0);
- return;
- }
-
- DialogPopup_Del = _Popup.Create(Popup_Type.Dialog, Popup_Style.Normal, _Text.OK, 300, 150, _Text.BroadcastionInfo_Delete_Continue, 0);
-
- _Event.PopupClose_SendMessage_Event += new _Event.PopupClose_SendMessage_Handler(_Event_PopupClose_SendMessage_Event_DeletBroadcastion);
- }
- public void _Event_PopupClose_SendMessage_Event_DeletBroadcastion(object sender, object etc)
- {
-
- Form popup = (Form)sender;
- if (DialogPopup_Del.Name == popup.Name && etc.ToString() == _Text.OK)
- {
-
- _Data.ProJect_Save_Complete = false;
-
- int SelectRowCount = GridEX_Device.SelectedItems.Count;
- for (int number = 0; number < SelectRowCount; number++)
- {
- GridEXRow row = GridEX_Device.SelectedItems[number].GetRow();
- string Broadcation_Receiver = row.Cells["Receiver_ID"].Value.ToString();
- string Device_ID = row.Cells["ID"].Value.ToString();
-
- MskDeviceIDString device_id = new MskDeviceIDString(Device_ID, Broadcation_Receiver);
- int COMM_ID = device_id.Comm_id;
- int BOARD_ID = device_id.Board_id;
- int LOOP_NO = device_id.Loop_no;
- int REPEATER_ID = device_id.Repeater_id;
- int DEVICE_ID = device_id.Device_id;
- string INOUT_TYPE = device_id.Inout_type;
-
- _Db.Execute(_Sql.Delete_Table("TB_EMERGENCY_BROADCASTION", "RECEIVER_ID", Receiver_ID, "COMM_ID", COMM_ID, "BOARD_ID", BOARD_ID,
- "LOOP_NO", LOOP_NO, "REPEATER_ID", REPEATER_ID, "DEVICE_ID", DEVICE_ID, "INOUT_TYPE", INOUT_TYPE, Broadcation_Receiver));
-
- row.BeginEdit();
-
- row.Cells["Emergency"].Value = "-" + "-";
- row.EndEdit();
- }
-
- if (((_RECEIVER)_Data.HASH_RECEIVER[Receiver_ID]).MODEL == "IFC3300")
- {
-
- ((_ImportPoint)_Data.Hash_ImportPoint[Receiver_ID]).IN_Points = _Db.ExecuteRead_SqlDataAdapter(
- _Sql.Search_DEVICETable_With_EMERGENCY_BigReceiver("1", "I", "", "", "", "", "", "", Receiver_ID, "", "", "", false));
- }
- else
- {
-
- ((_ImportPoint)_Data.Hash_ImportPoint[Receiver_ID]).IN_Points = _Db.ExecuteRead_SqlDataAdapter(
- _Sql.Search_DEVICETable_With_EMERGENCY("1", "I", "15", "", "", "", "", "", Receiver_ID, "", "", "", false));
- }
-
- _Event.EmergencyCodeEdit_SendMessage_Write(Receiver_ID);
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.DelInform, 0);
- }
-
- _Event.PopupClose_SendMessage_Event -= new _Event.PopupClose_SendMessage_Handler(_Event_PopupClose_SendMessage_Event_DeletBroadcastion);
- }
-
- private void UiButton_AddDevice_Click(object sender, EventArgs e)
- {
-
- int SelectRowCount = GridEX_Device.SelectedItems.Count;
-
- if (SelectRowCount == 0)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.InDeviceNotChoice, 0);
- return;
- }
- if (EditBox_Area.Text.Length == 0)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.AreaNotInput, 0);
- return;
- }
- if (EditBox_Area.Text.Length != 2)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.AreaProblemInput, 0);
- return;
- }
- if (EditBox_Stair.Text.Length == 0)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.StairNotInput, 0);
- return;
- }
- if (EditBox_Stair.Text.Length != 2)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.StairProblemInput, 0);
- return;
- }
- if (EditBox_Floor.Text.Length == 0)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.FloorNotInput, 0);
- return;
- }
- if (EditBox_Floor.Text.Length != 2)
- {
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.FloorProblemInput, 0);
- return;
- }
-
- DialogPopup_Save = _Popup.Create(Popup_Type.Dialog, Popup_Style.Normal, _Text.OK, 300, 150, _Text.BroadcastionInfo_Update_Continue, 0);
-
- _Event.PopupClose_SendMessage_Event += new _Event.PopupClose_SendMessage_Handler(_Event_PopupClose_SendMessage_Event_AddBroadcastion);
- }
- public void _Event_PopupClose_SendMessage_Event_AddBroadcastion(object sender, object etc)
- {
-
- Form popup = (Form)sender;
- if (DialogPopup_Save.Name == popup.Name && etc.ToString() == _Text.OK)
- {
-
- _Data.ProJect_Save_Complete = false;
-
- int SelectRowCount = GridEX_Device.SelectedItems.Count;
- for (int number = 0; number < SelectRowCount; number++)
- {
- GridEXRow row = GridEX_Device.SelectedItems[number].GetRow();
- string Broadcation_Receiver = row.Cells["Receiver_ID"].Value.ToString();
- string Device_ID = row.Cells["ID"].Value.ToString();
-
- MskDeviceIDString device_id = new MskDeviceIDString(Device_ID, Broadcation_Receiver);
- int COMM_ID = device_id.Comm_id;
- int BOARD_ID = device_id.Board_id;
- int LOOP_NO = device_id.Loop_no;
- int REPEATER_ID = device_id.Repeater_id;
- int DEVICE_ID = device_id.Device_id;
- string INOUT_TYPE = device_id.Inout_type;
-
-
-
-
-
-
-
-
- _Db.Execute(_Sql.Delete_Table("TB_EMERGENCY_BROADCASTION", "RECEIVER_ID", Receiver_ID, "COMM_ID", COMM_ID, "BOARD_ID", BOARD_ID,
- "LOOP_NO", LOOP_NO, "REPEATER_ID", REPEATER_ID, "DEVICE_ID", DEVICE_ID, "INOUT_TYPE", INOUT_TYPE, Broadcation_Receiver));
-
- _Db.ADD("TB_EMERGENCY_BROADCASTION",
- "RECEIVER_ID=" + Receiver_ID +
- ";COMM_ID=" + COMM_ID +
- ";BOARD_ID=" + BOARD_ID +
- ";LOOP_NO=" + LOOP_NO +
- ";REPEATER_ID=" + REPEATER_ID +
- ";DEVICE_ID=" + DEVICE_ID +
- ";INOUT_TYPE=" + INOUT_TYPE +
- ";AREA_CODE=" + EditBox_Area.Text +
- ";STAIR_CODE=" + EditBox_Stair.Text +
- ";FLOOR_CODE=" + EditBox_Floor.Text +
- ";UPDATE_TIME=" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
-
- row.BeginEdit();
-
- row.Cells["Emergency"].Value = EditBox_Area.Text + "-" + EditBox_Stair.Text + "-" + EditBox_Floor.Text;
- row.EndEdit();
- }
-
-
- if (((_RECEIVER)_Data.HASH_RECEIVER[Receiver_ID]).MODEL == "IFC3300")
- {
-
- ((_ImportPoint)_Data.Hash_ImportPoint[Receiver_ID]).IN_Points = _Db.ExecuteRead_SqlDataAdapter(
- _Sql.Search_DEVICETable_With_EMERGENCY_BigReceiver("1", "I", "", "", "", "", "", "", Receiver_ID, "", "", "", false));
- }
- else
- {
-
- ((_ImportPoint)_Data.Hash_ImportPoint[Receiver_ID]).IN_Points = _Db.ExecuteRead_SqlDataAdapter(
- _Sql.Search_DEVICETable_With_EMERGENCY("1", "I", "15", "", "", "", "", "", Receiver_ID, "", "", "", false));
- }
-
- _Event.EmergencyCodeEdit_SendMessage_Write(Receiver_ID);
-
-
- _Popup.Create(Popup_Type.Confirm, Popup_Style.Normal, _Text.OK, 250, 150, _Text.SaveInform, 0);
- }
-
- _Event.PopupClose_SendMessage_Event -= new _Event.PopupClose_SendMessage_Handler(_Event_PopupClose_SendMessage_Event_AddBroadcastion);
- }
- }
- }
|