private void btnAddDBConfig_Click(object sender, EventArgs e)
        {
            frmEditDBConfig frm = new frmEditDBConfig(CheckDuplicateDBConfig, SetDBConfigInfo, SetupDBSerialIDIndex, this.gateway_mgr, this.dbm.serial_id_index);

            frm.Owner = this;
            frm.ShowDialog();

            delgDBManager(dbm);
            RefreshDBConfigList();
        }
        private void lvDBConfigList_DoubleClick(object sender, EventArgs e)
        {
            string      strSerial;
            string      strGatewayID;
            string      strDeviceID;
            cls_DB_Info dbTemp = new cls_DB_Info();

            if (lvDBConfigList.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select the DB config first!", "Error");
                return;
            }

            strSerial    = lvDBConfigList.SelectedItems[0].Text.Trim();
            strGatewayID = lvDBConfigList.SelectedItems[0].SubItems[1].Text.Trim();
            strDeviceID  = lvDBConfigList.SelectedItems[0].SubItems[2].Text.Trim();

            int i = 0;

            foreach (cls_DB_Info db in this.dbm.dbconfig_list)
            {
                if (db.serial_id == strSerial)
                {
                    dbTemp = this.dbm.dbconfig_list[i];
                    break;
                }
                i++;
            }

            frmEditDBConfig frm = new frmEditDBConfig(SetDBConfigInfo, this.gateway_mgr, dbTemp, strGatewayID, strDeviceID, false);

            frm.Owner = this;
            frm.ShowDialog();

            dbTemp = null;

            delgDBManager(dbm);
            RefreshDBConfigList();
            lvDBConfigList.Focus();
        }