Esempio n. 1
0
        private bool ValidateAPFile(string fpath)
        {
            bool valid = true;

            try
            {
                List <DispositionRow> rows = ExcelDataReader.GetResearchRows(fpath);

                int zeroRecords = rows.Count(r => r.InterviewRecordID == 0);

                valid = (zeroRecords == 0);
            } catch (Exception e)
            {
                valid = false;
            }

            return(valid);
            // return true;
        }
Esempio n. 2
0
        public static List <DispositionRow> GetResearchRows(string apFileName, string apFileType)
        {
            // List<DispositionRow> originalRows = new List<DispositionRow>();
            //  string pathToApricotReportFile = System.Web.HttpContext.Current.Request.MapPath(string.Format("~/App_Data/Public/{0}.{1}", apFileName, apFileType));
            string pathToResearchReportFile = System.Web.HttpContext.Current.Request.MapPath(string.Format("~/Uploads/{0}.{1}", apFileName, apFileType));

            List <DispositionRow> resRows = ExcelDataReader.GetResearchRows(pathToResearchReportFile);

            /*
             * var apricotReportFile = Linq2Excel.GetFactory(pathToApricotReportFile);
             * Linq2Excel.PrepareApricotMapping(apricotReportFile);
             *
             * var apricotRows = from d in apricotReportFile.Worksheet<DispositionRow>("Sheet1") select d;
             *
             * foreach (DispositionRow d in apricotRows)
             * {
             *  originalRows.Add(d);
             * }
             */

            return(resRows);
        }