Пример #1
0
        //private void formNameToolStripMenuItem_Click(object sender, EventArgs e)
        //{
        //    Token_Dlg td = new Token_Dlg();
        //    td.Show();
        //}
        private void visibleColumnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            VisibleColumns vis = new VisibleColumns();
            vis.MdiParent = this;

            vis.Show();
               // this.Close();
        }
Пример #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            // string g = a;

            parameter = (string)dataGridView1.Rows[0].Cells[0].Value;
            portfalio = (string)dataGridView1.Rows[0].Cells[1].Value;
            Token_1 = (string)dataGridView1.Rows[0].Cells[2].Value;
            Token_2 = (string)dataGridView1.Rows[0].Cells[3].Value;

            XmlDocument MyXmlDocument = new XmlDocument();
            MyXmlDocument.Load(Application.StartupPath + "\\UserParameter.xml");
            XmlElement ParentElement = MyXmlDocument.CreateElement("Parameters");
            XmlElement PARAMETER = MyXmlDocument.CreateElement("PARAMETER");
            PARAMETER.InnerText = parameter;
            XmlElement PORTFOLIO = MyXmlDocument.CreateElement("PORTFOLIO");
            PORTFOLIO.InnerText = portfalio;
            XmlElement TOKEN_1 = MyXmlDocument.CreateElement("TOKEN_1");
            TOKEN_1.InnerText = Token_1;
            XmlElement TOKEN_2 = MyXmlDocument.CreateElement("TOKEN_2");
            TOKEN_2.InnerText = Token_2;

            ParentElement.AppendChild(PARAMETER);
            ParentElement.AppendChild(PORTFOLIO);
            ParentElement.AppendChild(TOKEN_1);
            ParentElement.AppendChild(TOKEN_2);

            MyXmlDocument.DocumentElement.AppendChild(ParentElement);
            MyXmlDocument.Save(Application.StartupPath + "\\UserParameter.xml");

            MessageBox.Show("Records Add Successfully");
            this.Close();

            VisibleColumns f = new VisibleColumns();
            f.Show();
        }