public static List <Check> GetQuickbooksChecks(string qbFileName, string qbFileType) { if (qbFileName.Equals("unknown")) { // Return an emmpty list of checks. return(new List <Check>()); } // List<Check> quickbooksChecks = new List<Check>(); string pathToQuickbooksFile = System.Web.HttpContext.Current.Request.MapPath(string.Format("~/Uploads/{0}.{1}", qbFileName, qbFileType)); List <Check> quickbooksChecks = ExcelDataReader.GetQuickbooksChecks(pathToQuickbooksFile); /* * var quickbooksFile = Linq2Excel.GetFactory(pathToQuickbooksFile); * var vChecks = from vc in quickbooksFile.Worksheet<Check>("Sheet1") select vc; * * foreach (Check check in vChecks) * { * quickbookChecks.Add(check); * } */ return(quickbooksChecks); }
private bool ValidateQBFile(string fpath) { bool valid = true; try { var checks = ExcelDataReader.GetQuickbooksChecks(fpath); var clr = checks.Count(c => c.Clr.Equals("Unknown")); valid = clr == 0; } catch (Exception e) { valid = false; } return(valid); // return true; }
private bool ValidateRRCFile(string fpath) { bool valid = true; try { var checks = ExcelDataReader.GetQuickbooksChecks(fpath); // var clr = checks.Count(c => c.Clr.Equals("Unknown")); // var clr = 0; // PLB 1/19/17 If column Clr has no value it is not an error! // valid = clr == 0; valid = true; } catch { valid = false; } return(valid); }