Ejemplo n.º 1
0
 private void AddWarn(int cointype)
 {
     AddWarn form2 = new AddWarn();//新建一个NewForm窗口(NewForm是自己定义的Form)
     form2.command_cointype(cointype);
     form2.ShowDialog(); //新窗口显现
     warn_to_list(0);
     warn_to_list(1);
 }
Ejemplo n.º 2
0
        private void EditWarn(int cointype)
        {
            if (cointype == 0)
            {
                curlistwiew = listViewBTC;
            }
            else
            {
                curlistwiew = listViewLTC;
            }

            if (curlistwiew == null)
            {
                return;
            }

            int BTCorLTC = -1;
            if (listViewBTC == curlistwiew)
            {
                BTCorLTC = 0;
            }
            else if (listViewLTC == curlistwiew)
            {
                BTCorLTC = 1;
            }
            if (BTCorLTC == -1)
            {
                return;
            }
            int index = -1;
            ListView.SelectedListViewItemCollection items = curlistwiew.SelectedItems;

            foreach (ListViewItem item in items)
            {
                index = item.Index;
            }
            if (index >= 0)
            {
                AddWarn form2 = new AddWarn();//新建一个NewForm窗口(NewForm是自己定义的Form)
                form2.command(BTCorLTC, index);
                form2.ShowDialog(); //新窗口显现
                warn_to_list(0);
                warn_to_list(1);
            }
            else
            {
                MessageBox.Show(this, "请选择将要修改的预警!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }