Exemplo n.º 1
0
        private void tbEdit_Click(object sender, EventArgs e)
        {
            if (lvReport.SelectedItems.Count == 0)
            {
                return;
            }
            if (tvType.SelectedNode.Level == 0)
            {
                MessageBox.Show("不能在第一级删除报表!!", "提示");
                return;
            }
            frmEditReport myEditReport = new frmEditReport();

            myEditReport.pFlag        = true;
            myEditReport.strName      = lvReport.SelectedItems[0].Text;
            myEditReport.txtName.Text = lvReport.SelectedItems[0].Text;
            myEditReport.cbType.Text  = tvType.SelectedNode.Text;

            foreach (TreeNode Node in tvType.TopNode.Nodes)
            {
                myEditReport.cbType.Properties.Items.Add(Node.Text);
            }

            if (myEditReport.ShowDialog() == DialogResult.OK)
            {
                FillType();
            }
            myEditReport.Dispose();
        }
Exemplo n.º 2
0
        private void tbNew_Click(object sender, EventArgs e)
        {
            frmEditReport myEditReport = new frmEditReport();

            myEditReport.pFlag = false;
            if (myEditReport.ShowDialog() == DialogResult.OK)
            {
                FillType();
            }
            myEditReport.Dispose();
        }