DataTable dtFinal = new DataTable("final"); // data table if needed to modify any in the final after public _1172_Avanti_NewBusiness_DB1(bool inTestMode) { TestMode = inTestMode; JAR_NewBusiness oNB = new JAR_NewBusiness(TestMode, ClientName, Author, ClientGroup, FilePath, FileName, FileExt, LayoutFile, DataBase); // read the data in, since they're in different layouts partially, and need to be modified ReadAllData(oNB); if (dtData.Rows.Count >= 1) { // pass the data back in so we can keep this rolling in our library oNB.TransferDTBack(dtData); // update data as needed via the library oNB.EvaluateData_TransferToFinal(DataBase, false, true, true, 60); // get the final sheet out, and make any necessary adjustments to the data before passing back in for the rest of the functions dtFinal = oNB.returnTableToModify_Final(); FinalizeNB(); oNB.TransferDTBack_Final(dtFinal); // each of these should be included, just need to toggle the flag whether they're used or not // start doing the special things, if they are set to true oNB.Best2Phones(); // find the best 2 phones, and make sure they're all valid oNB.AD1_LengthScrub(); // if AD1 is too long, load the rest to AD2 oNB.ScrubSSN(); // scrub socials that aren't valid oNB.Find501R(DataBase, true); // 501R date oNB.AlphaCheck(false); oNB.Note_Deduper(); // remove duplicate notes as needed across CLA# oNB.NBPH(); // NBPH magic - same on EBO/DB1 (as soon as EBO's is live) oNB.MakeACMT(DataBase, false); // create the ACMT line, based off of which fields are loaded oNB.DateUpdater(DataBase, true); // set to false due to dodChecker after oNB.GuarIsMinor(true); // determine if the guarantor is a minor oNB.DupeCheck(); // duplicate check, by default is a hard dupe oNB.SmallBal("CLA#", 0.00, true); // small balance removal (used same logic from old woodlawn) oNB.SplitTableResults(); // move the tables into their appropriate tables (small bal and dupes, and final to pass through) if (!inTestMode) { JAR_NewBusinessFunctions.SendClientReports(dtFinal, oNB.dt_Saver, ClientName, ClientGroup, DataBase, TestMode, FilePath, null, null, null, null, null, null, null, null, true); } oNB.CallNBForm(null, TestMode); } else { Console.WriteLine("\nNo data was found to process.\nPlease check the data folder and try again.\n\nPress any key or close the process to continue."); Console.ReadLine(); Environment.Exit(1); } }
/// <summary> /// Take any of the weird format ones and make sure the name itself is all good. /// </summary> private void FinalizeNB() { foreach (DataRow dr in dtFinal.Rows) { // format the dates so they don't have time stamps at the end if (dr["DOB"].ToString() != string.Empty) { dr["DOB"] = Convert.ToDateTime(dr["DOB"].ToString()).ToString("MM/dd/yyyy"); } if (dr["ADATA:AT2"].ToString() != string.Empty) { dr["ADATA:AT2"] = Convert.ToDateTime(dr["ADATA:AT2"].ToString()).ToString("MM/dd/yyyy"); } if (dr["LAD"].ToString() != string.Empty) { dr["LAD"] = Convert.ToDateTime(dr["LAD"].ToString()).ToString("MM/dd/yyyy"); } if (dr["ADATA:AU5"].ToString() != string.Empty) { dr["ADATA:AU5"] = Convert.ToDateTime(dr["ADATA:AU5"].ToString()).ToString("MM/dd/yyyy"); } if (dr["ADATA:AU6"].ToString() != string.Empty) { dr["ADATA:AU6"] = Convert.ToDateTime(dr["ADATA:AU6"].ToString()).ToString("MM/dd/yyyy"); } dr["PATIENT"] = JAR_NewBusinessFunctions.RemoveExtraSpaces(dr["PATIENT"].ToString().Trim()); dr["ADATA:AH1"] = JAR_NewBusinessFunctions.RemoveExtraSpaces(dr["ADATA:AH1"].ToString().Trim()); // check if fn/ln is not blank, if so then take the data, split by space, and assign that, otherwise take whatever is in the patient data if (dr["xxFN"].ToString() != string.Empty || dr["xxLN"].ToString() != string.Empty) { var nameSplit = JAR_NewBusinessFunctions.returnNameParser(dr["xxFN"].ToString()); dr["FN"] = JAR_NewBusinessFunctions.RemoveExtraSpaces((nameSplit.First + " " + nameSplit.Middle).Trim()); dr["LN"] = JAR_NewBusinessFunctions.RemoveExtraSpaces((nameSplit.Last + " " + nameSplit.Suffix).Trim()); } else { // they are blank, so take the patient fn and ln dr["FN"] = JAR_NewBusinessFunctions.RemoveExtraSpaces((dr["XXPTFN"].ToString() + " " + dr["XXPTMI"].ToString()).Trim()); dr["LN"] = JAR_NewBusinessFunctions.RemoveExtraSpaces((dr["XXPTLN"].ToString()).Trim()); } } }