Ejemplo n.º 1
0
        void createXMLFile()
        {
            using (this.con)
                using (StreamWriter sw = System.IO.File.CreateText(string.Format("./Loads{0:ddMMyy}.xml", DateTime.Now)))
                {
                    if (con.State == ConnectionState.Closed)
                    {
                        con.Open();
                    }

                    string         sqlAccounts = @"select distinct ACCNO, ACCNAME from View_Kite_LoadReport_ACCNO";
                    SqlDataAdapter adp         = new SqlDataAdapter(sqlAccounts, con);
                    DataSet        dst         = new DataSet();
                    adp.Fill(dst, "ACCOUNTS");

                    LoadsXMLCreator loads = new LoadsXMLCreator(dst.Tables["ACCOUNTS"]);
                    string          xml   = loads.HeaderFields("ACCNO", "ACCNAME").DetailFields("CORTEXDATE", "CRDPRODUCT", "PROGRAMID", "ACCTYPE", "DESCRIPTION", "AMTBILL").Create();
                    sw.Write(xml);
                    sw.Close();
                }
        }
Ejemplo n.º 2
0
        void createXMLFile()
        {
            using(this.con)
            using (StreamWriter sw = System.IO.File.CreateText(string.Format("./Loads{0:ddMMyy}.xml", DateTime.Now)))
            {
                if (con.State==ConnectionState.Closed) con.Open();

                string sqlAccounts = @"select distinct ACCNO, ACCNAME from View_Kite_LoadReport_ACCNO";
                SqlDataAdapter adp = new SqlDataAdapter(sqlAccounts, con);
                DataSet dst = new DataSet();
                adp.Fill(dst, "ACCOUNTS");

                LoadsXMLCreator loads = new LoadsXMLCreator(dst.Tables["ACCOUNTS"]);
                string xml = loads.HeaderFields("ACCNO", "ACCNAME").DetailFields("CORTEXDATE", "CRDPRODUCT", "PROGRAMID", "ACCTYPE", "DESCRIPTION", "AMTBILL").Create();
                sw.Write(xml);
                sw.Close();
            }
        }