Example #1
0
        private static void ExportDescription()
        {
            int            countCompany   = 0;
            StreamWriter   outfile        = new StreamWriter("ShortDescription.txt");
            List <string>  lst            = new List <string>();
            ProductAdapter productAdapter = new ProductAdapter(new SqlDb(Server.ConnectionString));
            List <long>    companyIds     = productAdapter.GetAllCompanyIdSystem();

            foreach (long companyID in companyIds)
            {
                foreach (DataRow rowInfo in productAdapter.GetDescriptionData(companyID).Rows)
                {
                    if (rowInfo["ShortDescription"] != DBNull.Value)
                    {
                        string data = rowInfo["ShortDescription"].ToString().Trim();
                        if (!string.IsNullOrEmpty(data))
                        {
                            outfile.Write(data + "\n:::::\n");
                        }
                    }
                }
                log.Info(string.Format("Success compay {0}/{1}", countCompany++, companyIds.Count));
            }
            outfile.Close();
            log.Info("OK");
        }