Example #1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            FrmFilterData frmFilter = new FrmFilterData();

            Hide();
            frmFilter.Show();
        }
        private void btnnext_Click(object sender, EventArgs e)
        {
            List <DataDetail> data = new List <DataDetail>();

            data = GetListCheck();

            if (data.Count == 0)
            {
                MessageBox.Show("Chưa chọn Danh sách");
                return;
            }

            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Indent = true;

            XmlWriter writer = XmlWriter.Create(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\dataSrcExportCheck.xml", settings);

            writer.WriteStartDocument();
            writer.WriteComment("This file is generated by the program.");
            writer.WriteStartElement("Root");

            foreach (var item in data)
            {
                writer.WriteStartElement("Function");
                writer.WriteElementString("ID", item.ID);
                writer.WriteElementString("Name", item.Name);
                writer.WriteElementString("Table", item.Table);
                writer.WriteElementString("Condition", item.Condition);
                writer.WriteElementString("Language", item.Language);
                foreach (var itemdetail in detail)
                {
                    if (itemdetail.ID == item.ID)
                    {
                        writer.WriteStartElement("Detail");

                        writer.WriteAttributeString("Ref", itemdetail.ConditionDetail);

                        writer.WriteString(itemdetail.DetailName);
                        writer.WriteEndElement();
                    }
                }

                writer.WriteEndElement();
                //}
            }
            writer.WriteEndElement();
            writer.WriteEndDocument();
            writer.Flush();
            writer.Close();

            FrmFilterData frmFilter = new FrmFilterData();

            Hide();
            frmFilter.Show();
        }