private string OwlWorksAssociateList() { StringBuilder sb = new StringBuilder(); ExportManager oEM = new ExportManager(); DataTable dt = ExportDataDAL.OwlWorksAssociateList(); if (dt != null && dt.Rows != null && dt.Rows.Count > 0) { string strOutput = ""; string strData = ""; DateTime datDate = new DateTime(); foreach (DataColumn dc in dt.Columns) { if (dc.Ordinal > 0) { strOutput += "\t"; } strOutput += dc.Caption; } sb.AppendLine(strOutput); foreach (DataRow dr in dt.Rows) { strOutput = ""; foreach (DataColumn dc1 in dt.Columns) { strData = Convert.ToString(dr[dc1.Ordinal]); switch (dc1.Caption) { case "ProbationaryDate": case "HonoraryDate": case "WhiteAppApprovedDate": case "WhiteAppReceivedDate": { if (DateTime.TryParse(strData, out datDate) == true) { strData = datDate.ToString("MM/dd/yyyy"); } else { strData = ""; } break; } default: break; } if (dc1.Ordinal > 0) { strOutput += "\t"; } strOutput += strData; } sb.AppendLine(strOutput); } } return(sb.ToString()); }
private string OwlWorksWaitingListList() { StringBuilder sb = new StringBuilder(); ExportManager oEM = new ExportManager(); DataTable dt = ExportDataDAL.OwlWorksWaitingListList(); if (dt != null && dt.Rows != null && dt.Rows.Count > 0) { string strOutput = ""; string strData = ""; DateTime datDate = new DateTime(); string memberId = ""; foreach (DataColumn dc in dt.Columns) { if (dc.Ordinal > 0) { strOutput += "\t"; } strOutput += dc.Caption; } sb.AppendLine(strOutput); foreach (DataRow dr in dt.Rows) { strOutput = ""; foreach (DataColumn dc in dt.Columns) { strData = Convert.ToString(dr[dc.Ordinal]); switch (dc.Caption) { case "BirthDate": case "MemberDate": case "ProbationaryDate": case "ApplicationDate": case "EWLDate": case "WhiteAppApprovedDate": case "WhiteAppReceivedDate": { if (DateTime.TryParse(strData, out datDate) == true) { strData = datDate.ToString("MM/dd/yyyy"); } else { strData = ""; } break; } case "YearsInClub": memberId = Convert.ToString(dr["MemberID"]); strData = oEM.GetYearsInClub(memberId).ToString(); break; default: break; } if (dc.Ordinal > 0) { strOutput += "\t"; } strOutput += strData; } sb.AppendLine(strOutput); } } return(sb.ToString()); }
private string GroveMapCamps() { StringBuilder sb = new StringBuilder(); ExportManager oEM = new ExportManager(); DataTable dt = ExportDataDAL.GroveMapCamps(); if (dt != null && dt.Rows != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { string strOutput = ""; int coCaptainIndex = 0; int coCaptainCount = 0; bool isFirstMember = true; string campId = Convert.ToString(dr["CampID"]); string campName = Convert.ToString(dr["CampName"]); sb.AppendLine(campName); DataTable dtCampMembers = this.GroveMapCampMemberList(campId); if (dtCampMembers != null && dtCampMembers.Rows != null && dtCampMembers.Rows.Count > 0) { foreach (DataRow drMem in dtCampMembers.Rows) { if (Convert.ToString(drMem["CampPositionID"]) == Helper.CAMP_POSITION_CO_CAPTAIN) { coCaptainCount++; } } foreach (DataRow drMem in dtCampMembers.Rows) { string campPositionId = Convert.ToString(drMem["CampPositionID"]); if (campPositionId == Helper.CAMP_POSITION_CAPTAIN) { strOutput = Convert.ToString(drMem["Prefix"]) == "" ? "" : Convert.ToString(drMem["Prefix"]); strOutput += Convert.ToString(drMem["FirstName"]) == "" ? "" : " " + Convert.ToString(drMem["FirstName"]); strOutput += Convert.ToString(drMem["MiddleName"]) == "" ? "" : " " + Convert.ToString(drMem["MiddleName"]); strOutput += Convert.ToString(drMem["LastName"]) == "" ? "" : " " + Convert.ToString(drMem["LastName"]); strOutput += Convert.ToString(drMem["Suffix"]) == "" ? "" : " " + Convert.ToString(drMem["Suffix"]); strOutput += ", Captain, and Messrs. "; } if (campPositionId == Helper.CAMP_POSITION_CO_CAPTAIN) { if (coCaptainIndex == 0) { strOutput = "Messrs. "; } else { strOutput += " and "; } strOutput += Convert.ToString(drMem["FirstName"]) == "" ? "" : " " + Convert.ToString(drMem["FirstName"]); strOutput += Convert.ToString(drMem["MiddleName"]) == "" ? "" : " " + Convert.ToString(drMem["MiddleName"]); strOutput += Convert.ToString(drMem["LastName"]) == "" ? "" : " " + Convert.ToString(drMem["LastName"]); strOutput += Convert.ToString(drMem["Suffix"]) == "" ? "" : " " + Convert.ToString(drMem["Suffix"]); coCaptainIndex++; if (coCaptainIndex == coCaptainCount) { strOutput += ", Co-Captains, and Messrs. "; } } if (campPositionId != Helper.CAMP_POSITION_CAPTAIN && campPositionId != Helper.CAMP_POSITION_CO_CAPTAIN) { if (isFirstMember == false) { strOutput += ", "; } strOutput += Convert.ToString(drMem["FirstName"]) == "" ? "" : " " + Convert.ToString(drMem["FirstName"]); strOutput += Convert.ToString(drMem["MiddleName"]) == "" ? "" : " " + Convert.ToString(drMem["MiddleName"]); strOutput += Convert.ToString(drMem["LastName"]) == "" ? "" : " " + Convert.ToString(drMem["LastName"]); strOutput += Convert.ToString(drMem["Suffix"]) == "" ? "" : " " + Convert.ToString(drMem["Suffix"]); isFirstMember = false; } } sb.AppendLine(strOutput); } sb.AppendLine(""); sb.AppendLine(""); } } return(sb.ToString()); }