예제 #1
0
        public void returnAddress()
        {
            var repo = new PersonExport(new PersonExporterRepo());
            var data = repo.OrderByAddress();

            Assert.IsTrue(data != null && data.Any());
        }
예제 #2
0
        public void returnNameFreOutPut()
        {
            var repo = new PersonExport(new PersonExporterRepo());
            var data = repo.NameByFrequency();

            Assert.IsTrue(data != null && data.Any());
        }
예제 #3
0
        // GET: PersonExporter
        public ActionResult ExportByName()
        {
            var    filterdata1     = new PersonExport().NameByFrequency();
            string ActivityLogFile = Convert.ToString(ConfigurationManager.AppSettings["NameByFrequency"]);

            foreach (var item in filterdata1)
            {
                var message = item.Key + "," + item.Value;
                Logger.WriteActivityLog(message, ActivityLogFile);
            }

            byte[] fileBytes = System.IO.File.ReadAllBytes(LogPath + ActivityLogFile);
            string fileName  = ActivityLogFile;

            return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName));
            // return RedirectToAction("Index", "Home");
        }