Exemple #1
0
        private void lvGatewayList_DoubleClick(object sender, EventArgs e)
        {
            string           strGatewayID;
            cls_Gateway_Info gwTemp = new cls_Gateway_Info();

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

            strGatewayID = lvGatewayList.SelectedItems[0].Text.Trim();

            int i = 0;

            foreach (cls_Gateway_Info gi in this.gm.gateway_list)
            {
                if (gi.gateway_id == strGatewayID)
                {
                    gwTemp = this.gm.gateway_list[i];
                    break;
                }
                i++;
            }

            var frm = new frmEditGateway(SetGatewayInfo, gwTemp);

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

            gwTemp = null;

            RefreshGatewayList();
            lvGatewayList.Focus();
        }
Exemple #2
0
        private void btnAddGateway_Click(object sender, EventArgs e)
        {
            //var frm = new frmEditGateway();
            var frm = new frmEditGateway(SetGatewayInfo, CheckDuplicateGateway, false);

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

            delgGWManager(gm);
            RefreshGatewayList();
        }