public PersonPhysicalChar GetPersonPhysicalChar(string personId) { PersonPhysicalChar personPhysicalChar = null; DataAccess dataAccess = new DataAccess(); personPhysicalChar = dataAccess.retrievePersonPhysicalCharacteristics(personId); return(personPhysicalChar); }
}//end btnPhysicalCharEnter_Click private void btnPhysicalCharUpdate_Click(object sender, EventArgs e) { Status status = null; try { PersonPhysicalChar personPhysicalChar = new PersonPhysicalChar(); personPhysicalChar.PersonId = lblPhysicalCharPersonIdValue.Text; personPhysicalChar.Height = !string.IsNullOrEmpty(txtPhysicalCharHeight.Text) ? Convert.ToDouble(txtPhysicalCharHeight.Text) : 0.0; personPhysicalChar.Weight = !string.IsNullOrEmpty(txtBoxPhysicalCharWeight.Text) ? Convert.ToDouble(txtBoxPhysicalCharWeight.Text) : 0.0; personPhysicalChar.EyeColor = !string.IsNullOrEmpty((string)comboBoxPhysicalCharEyeColor.SelectedItem) ? (string)comboBoxPhysicalCharEyeColor.SelectedItem : ""; personPhysicalChar.HairColor = !string.IsNullOrEmpty((string)comboBoxPhysicalCharHairColor.SelectedItem) ? (string)comboBoxPhysicalCharHairColor.SelectedItem : ""; personPhysicalChar.Complexion = !string.IsNullOrEmpty((string)comboBoxPhysicalCharComplexion.SelectedItem) ? (string)comboBoxPhysicalCharComplexion.SelectedItem : ""; personPhysicalChar.BuildType = !string.IsNullOrEmpty((string)comboBoxPhysicalCharBuildType.SelectedItem) ? (string)comboBoxPhysicalCharBuildType.SelectedItem : ""; personPhysicalChar.BirthMark = !string.IsNullOrEmpty(txtBoxPhysicalCharBirthMark.Text) ? txtBoxPhysicalCharBirthMark.Text : ""; personPhysicalChar.IdMark = !string.IsNullOrEmpty(txtBoxPhycicalCharIdMark.Text) ? txtBoxPhycicalCharIdMark.Text : ""; personPhysicalChar.Gender = !string.IsNullOrEmpty((string)comboBoxPhycicalCharGender.SelectedItem) ? (string)comboBoxPhycicalCharGender.SelectedItem : ""; personPhysicalChar.DOD = Convert.ToDateTime(dtpPhysicalCharDeathDate.Value.ToString("MM/dd/yyyy")); personPhysicalChar.CreatedBy = null; personPhysicalChar.CreationDateTime = null; personPhysicalChar.UpdatedBy = AFISMain.user.getPersonId(); personPhysicalChar.UpdateDateTime = DateTime.Now; if (string.IsNullOrWhiteSpace(personPhysicalChar.PersonId)) { MessageBox.Show("Person ID field is required, cannot be empty.", "Warning Message", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Console.WriteLine("###-->> detail: Height = " + personPhysicalChar.Height + ", Weight = " + personPhysicalChar.Weight + ", Eye Color = " + personPhysicalChar.EyeColor); Console.WriteLine("###-->> detail: Hair Color = " + personPhysicalChar.HairColor + ", Complexion = " + personPhysicalChar.Complexion + ", Build Type = " + personPhysicalChar.BuildType); Console.WriteLine("###-->> detail: Birth Mark = " + personPhysicalChar.BirthMark + ", ID mark = " + personPhysicalChar.IdMark + ", Gender = " + personPhysicalChar.Gender + ", DOD = " + personPhysicalChar.DOD); Console.WriteLine("###-->> detail: Created By = " + personPhysicalChar.CreatedBy + ", Creation Date = " + personPhysicalChar.CreationDateTime + ", Updated By = " + personPhysicalChar.UpdatedBy + ", Updated Date = " + personPhysicalChar.UpdateDateTime); status = new DataAccess().updatePersonPhysicalCharacteristics(personPhysicalChar); Console.WriteLine("###-->> status = " + status.getStatusDesc()); if (status.getStatusCode().Equals(Status.STATUS_SUCCESSFUL)) { lblPhysicalCharStatusMsg.ForeColor = System.Drawing.Color.Green; activityLog.setActivity(status.getStatusDesc() + "\n"); } else { activityLog.setActivity(status.getStatusDesc() + "\n"); lblPhysicalCharStatusMsg.ForeColor = System.Drawing.Color.Red; } } catch (Exception exp) { activityLog.setActivity(status.getStatusDesc() + "\n"); lblPhysicalCharStatusMsg.ForeColor = System.Drawing.Color.Red; Console.WriteLine(exp.StackTrace); } lblPhysicalCharStatusMsg.Text = status.getStatusDesc(); }
public static void generatePersonDetailReport(User user, string personId) { List <PersonDetail> personDetailList = new DataAccess().retrievePersonDetail(personId); Console.WriteLine("# of Persons found = " + personDetailList.Count()); PersonDetail personDetail = personDetailList.FirstOrDefault(); //Paragraph Title Font iTextSharp.text.Font paragraphTitleFont = FontFactory.GetFont("Arial", 16); iTextSharp.text.Font paragraphSubTitleFont = FontFactory.GetFont("Arial", 14); Document doc = new Document(iTextSharp.text.PageSize.LETTER, 30, 30, 42, 35); string datetimePref = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"); string pdfPath = ConfigurationManager.AppSettings["PersonReportPath"] + "-" + datetimePref + ".pdf"; PdfWriter pdfWriter = PdfWriter.GetInstance(doc, new FileStream(pdfPath, FileMode.Create)); //Event for Watermark PdfWriterEvents writerEvent = new PdfWriterEvents(ConfigurationManager.AppSettings["WatermarkConfidential"]); pdfWriter.PageEvent = writerEvent; //Event for Page number PageEventHelper pageEventHelper = new PageEventHelper(); pdfWriter.PageEvent = pageEventHelper; doc.Open(); //add title doc.AddTitle("Person Detail Report"); doc.AddHeader("Person Detail Report", "Person Detail Report"); //Add Company Logo & Company Name PdfPTable logoAndTitle = new PdfPTable(2); float[] cellWidths = new float[] { 100f, 100f }; logoAndTitle.SetWidths(cellWidths); iTextSharp.text.Image iTextCompanyLogoImage = null; if (AFISMain.clientSetup != null) { if (AFISMain.clientSetup.CompanyLogo != null) { iTextCompanyLogoImage = iTextSharp.text.Image.GetInstance(AFISMain.clientSetup.CompanyLogo, System.Drawing.Imaging.ImageFormat.Bmp); iTextCompanyLogoImage.ScaleAbsolute(60f, 60f); } } else { //Default image in case, image is not available iTextCompanyLogoImage = iTextSharp.text.Image.GetInstance(ConfigurationManager.AppSettings["DefaultCompanyLogo"]); } logoAndTitle.AddCell(new PdfPCell(iTextCompanyLogoImage)); string titleStr = AFISMain.clientSetup.LegalName + "\n" + AFISMain.clientSetup.AddressLine + "\n" + AFISMain.clientSetup.City + ", " + AFISMain.clientSetup.State + " " + AFISMain.clientSetup.PostalCode + "\n" + AFISMain.clientSetup.Country + "\n"; logoAndTitle.AddCell(new PdfPCell(new Phrase(titleStr, paragraphTitleFont))); doc.Add(logoAndTitle); iTextSharp.text.Font contentFont = iTextSharp.text.FontFactory.GetFont("Webdings", 20, iTextSharp.text.Font.BOLD); Paragraph paragraphReportTitle = new Paragraph("Person Detail Report\n", contentFont); paragraphReportTitle.Alignment = Element.ALIGN_CENTER; Paragraph paragraphReportSubTitle = new Paragraph(); paragraphReportSubTitle.Add("By: " + user.getFirstName() + " " + user.getLastName() + ", ID: " + user.getPersonId() + "\n"); paragraphReportSubTitle.Add("At: " + DateTime.Now.ToString() + "\n"); paragraphReportSubTitle.Alignment = Element.ALIGN_CENTER; doc.Add(paragraphReportTitle); doc.Add(paragraphReportSubTitle); if (personDetail != null) { //Adding the Passport size photo System.Drawing.Image passportPhoto = personDetail.getPassportPhoto(); if (passportPhoto != null) { iTextSharp.text.Image passportPic = iTextSharp.text.Image.GetInstance(passportPhoto, System.Drawing.Imaging.ImageFormat.Bmp); passportPic.ScaleAbsolute(120f, 120f); doc.Add(passportPic); } //Adding the person detail Paragraph paragraphDemographyTitle = new Paragraph("Demographic Information:\n", paragraphTitleFont); doc.Add(paragraphDemographyTitle); Paragraph paragraphDemographyDetail = new Paragraph(); paragraphDemographyDetail.Add("ID: " + personDetail.getPersonId() + "\n"); paragraphDemographyDetail.Add("Name: " + " " + personDetail.getPrefix() + " " + personDetail.getFirstName() + " " + personDetail.getMiddleName() + " " + personDetail.getLastName() + " " + personDetail.getSuffix() + "\n"); paragraphDemographyDetail.Add("Date of Birth (DOB): " + ((DateTime)personDetail.getDOB()).ToString("yyyy-MM-dd") + "\n"); paragraphDemographyDetail.Add("Father's Name: " + personDetail.getFatherName() + "\n"); paragraphDemographyDetail.Add("Address: " + personDetail.getStreetAddress() + ", " + personDetail.getCity() + ", " + personDetail.getState() + " " + personDetail.getPostalCode() + ", " + personDetail.getCountry() + "\n"); paragraphDemographyDetail.Add("Profession: " + personDetail.getProfession() + "\n"); paragraphDemographyDetail.Add("Cell#: " + personDetail.getCellNbr() + ", Home Phone#: " + personDetail.getHomePhoneNbr() + ", Work Phone#: " + personDetail.getWorkPhoneNbr() + "\n"); paragraphDemographyDetail.Add("Email: " + personDetail.getEmail() + "\n\n"); doc.Add(paragraphDemographyDetail); } //Adding Person's Physical Characteristocs DataAccess dataAccess = new DataAccess(); PersonPhysicalChar personPhysicalChar = dataAccess.retrievePersonPhysicalCharacteristics(personId); if (personPhysicalChar != null) { Paragraph paragraphPhysicalCharTitle = new Paragraph("Physical Characteristics:\n", paragraphTitleFont); doc.Add(paragraphPhysicalCharTitle); Paragraph paragraphPhysicalChar = new Paragraph(); paragraphPhysicalChar.Add("Height: " + personPhysicalChar.Height + ", Weight: " + personPhysicalChar.Weight + ", Eye Color: " + personPhysicalChar.EyeColor); paragraphPhysicalChar.Add(", Hair Color: " + personPhysicalChar.HairColor + "\n"); paragraphPhysicalChar.Add("Complexion: " + personPhysicalChar.Complexion + ", Build Type: " + personPhysicalChar.BuildType); paragraphPhysicalChar.Add(", Birth Mark: " + personPhysicalChar.BirthMark + ", Other Identifiable Mark: " + personPhysicalChar.IdMark + "\n"); string dod = personPhysicalChar.DOD.ToString("yyyy") == "9998" ? "N/A" : personPhysicalChar.DOD.ToString("yyyy-MM-dd"); paragraphPhysicalChar.Add("Gender: " + personPhysicalChar.Gender + ", Date Of Death: " + dod + "\n\n"); doc.Add(paragraphPhysicalChar); } //Adding Person's Criminal records List <CriminalRecord> criminalRecs = dataAccess.getCriminalRecords(personId); Console.WriteLine("###-->> # of Criminal recotds = " + criminalRecs.Count); if (criminalRecs.Count > 0) { Paragraph paragraphCriminalRecs = new Paragraph("Criminal Records:\n", paragraphTitleFont); doc.Add(paragraphCriminalRecs); foreach (CriminalRecord criminalRec in criminalRecs) { Paragraph paragraphCriminalRecCaseId = new Paragraph("Case ID - " + criminalRec.CaseId + ":", paragraphSubTitleFont); doc.Add(paragraphCriminalRecCaseId); Paragraph paragraphCriminalRec = new Paragraph(); string crimeDate = criminalRec.CrimeDate.ToString("yyyy") == "9998" ? "N/A" : criminalRec.CrimeDate.ToString("yyyy-MM-dd"); string arrestDate = criminalRec.ArrestDate.ToString("yyyy") == "9998" ? "N/A" : criminalRec.ArrestDate.ToString("yyyy-MM-dd"); string sentenceDate = criminalRec.SentencedDate.ToString("yyyy") == "9998" ? "N/A" : criminalRec.SentencedDate.ToString("yyyy-MM-dd"); string releaseDate = criminalRec.ReleaseDate.ToString("yyyy") == "9998" ? "N/A" : criminalRec.ReleaseDate.ToString("yyyy-MM-dd"); string paroleDate = criminalRec.ParoleDate.ToString("yyyy") == "9998" ? "N/A" : criminalRec.ParoleDate.ToString("yyyy-MM-dd"); paragraphCriminalRec.Add("Crime Date: " + crimeDate + ", Crime Location: " + criminalRec.CrimeLocation + "\n"); paragraphCriminalRec.Add("Court: " + criminalRec.Court + ", Court Address: " + criminalRec.CourtAddress + ", Statute: " + criminalRec.Statute + "\n"); paragraphCriminalRec.Add("Arret Date: " + arrestDate + ", Arrest Agency: " + criminalRec.ArrestAgency + "\n"); paragraphCriminalRec.Add("Sentence Date: " + sentenceDate + ", Release Date: " + releaseDate + ", Parole date: " + paroleDate + "\n"); paragraphCriminalRec.Add("Criminal Alert Level: " + criminalRec.CriminalAlertLevel + ", Criminal Alert Message: " + criminalRec.CriminalAlertMsg + "\n"); paragraphCriminalRec.Add("Crime Detail: " + criminalRec.CrimeDetail + "\n"); doc.Add(paragraphCriminalRec); } Paragraph paragraphNewLine = new Paragraph(); paragraphNewLine.Add("\n"); doc.Add(paragraphNewLine); } //add table for fingerprints Paragraph paragraphFingerprints = new Paragraph("Fingerprint(s):\n\n", paragraphTitleFont); doc.Add(paragraphFingerprints); PdfPTable fingerprintsTable = new PdfPTable(5); float[] widths = new float[] { 40f, 40f, 40f, 40f, 40f }; fingerprintsTable.SetWidths(widths); //Add Headers to the table fingerprintsTable.AddCell(new PdfPCell(new Phrase("RT"))); fingerprintsTable.AddCell(new PdfPCell(new Phrase("RI"))); fingerprintsTable.AddCell(new PdfPCell(new Phrase("RM"))); fingerprintsTable.AddCell(new PdfPCell(new Phrase("RR"))); fingerprintsTable.AddCell(new PdfPCell(new Phrase("RL"))); PdfPCell imageRTCell = null; PdfPCell imageRICell = null; PdfPCell imageRMCell = null; PdfPCell imageRRCell = null; PdfPCell imageRLCell = null; PdfPCell imageLTCell = null; PdfPCell imageLICell = null; PdfPCell imageLMCell = null; PdfPCell imageLRCell = null; PdfPCell imageLLCell = null; //Default image in case, image is not available iTextSharp.text.Image iTextDefaultFpImage = iTextSharp.text.Image.GetInstance(ConfigurationManager.AppSettings["DefaultFpImagePath"]); List <MyPerson> persons = new DataAccess().retrievePersonFingerprintsById(personId); Console.WriteLine("####-->> # of persons retrived = " + persons.Count); if (persons.Count > 0) { MyPerson person = persons.FirstOrDefault(); //Get all the fingerprints of the matched person List <Fingerprint> fps = person.Fingerprints; Console.WriteLine("###-->> # of Fps retrived = " + fps.Count); for (int i = 0; i < fps.Count; i++) { MyFingerprint fp = (MyFingerprint)fps.ElementAt(i); if (fp.Fingername != null) { if (fp.Fingername.Equals(MyFingerprint.RightThumb)) { System.Drawing.Image imageRT = fp.AsBitmap; if (imageRT != null) { Console.WriteLine("###-->> RT"); iTextSharp.text.Image iTextImgRT = iTextSharp.text.Image.GetInstance(imageRT, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgRT.ScaleAbsolute(60f, 60f); imageRTCell = new PdfPCell(iTextImgRT); imageRTCell.HorizontalAlignment = Element.ALIGN_CENTER; imageRTCell.VerticalAlignment = Element.ALIGN_MIDDLE; } } else if (fp.Fingername.Equals(MyFingerprint.RightIndex)) { System.Drawing.Image imageRI = fp.AsBitmap; if (imageRI != null) { Console.WriteLine("###-->> RI"); iTextSharp.text.Image iTextImgRI = iTextSharp.text.Image.GetInstance(imageRI, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgRI.ScaleAbsolute(60f, 60f); imageRICell = new PdfPCell(iTextImgRI); imageRICell.HorizontalAlignment = Element.ALIGN_CENTER; imageRICell.VerticalAlignment = Element.ALIGN_MIDDLE; } } else if (fp.Fingername.Equals(MyFingerprint.RightMiddle)) { System.Drawing.Image imageRM = fp.AsBitmap; if (imageRM != null) { Console.WriteLine("###-->> RM"); iTextSharp.text.Image iTextImgRM = iTextSharp.text.Image.GetInstance(imageRM, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgRM.ScaleAbsolute(60f, 60f); imageRMCell = new PdfPCell(iTextImgRM); imageRMCell.HorizontalAlignment = Element.ALIGN_CENTER; imageRMCell.VerticalAlignment = Element.ALIGN_MIDDLE; } } else if (fp.Fingername.Equals(MyFingerprint.RightRing)) { System.Drawing.Image imageRR = fp.AsBitmap; if (imageRR != null) { Console.WriteLine("###-->> RR"); iTextSharp.text.Image iTextImgRR = iTextSharp.text.Image.GetInstance(imageRR, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgRR.ScaleAbsolute(60f, 60f); imageRRCell = new PdfPCell(iTextImgRR); imageRRCell.HorizontalAlignment = Element.ALIGN_CENTER; imageRRCell.VerticalAlignment = Element.ALIGN_MIDDLE; } } else if (fp.Fingername.Equals(MyFingerprint.RightLittle)) { System.Drawing.Image imageRL = fp.AsBitmap; if (imageRL != null) { Console.WriteLine("###-->> RL"); iTextSharp.text.Image iTextImgRL = iTextSharp.text.Image.GetInstance(imageRL, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgRL.ScaleAbsolute(60f, 60f); imageRLCell = new PdfPCell(iTextImgRL); imageRLCell.HorizontalAlignment = Element.ALIGN_CENTER; imageRLCell.VerticalAlignment = Element.ALIGN_MIDDLE; } } else if (fp.Fingername.Equals(MyFingerprint.LeftThumb)) { System.Drawing.Image imageLT = fp.AsBitmap; if (imageLT != null) { Console.WriteLine("###-->> LT"); iTextSharp.text.Image iTextImgLT = iTextSharp.text.Image.GetInstance(imageLT, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgLT.ScaleAbsolute(60f, 60f); imageLTCell = new PdfPCell(iTextImgLT); imageLTCell.HorizontalAlignment = Element.ALIGN_CENTER; imageLTCell.VerticalAlignment = Element.ALIGN_MIDDLE; } } else if (fp.Fingername.Equals(MyFingerprint.LeftIndex)) { System.Drawing.Image imageLI = fp.AsBitmap; if (imageLI != null) { Console.WriteLine("###-->> LI"); iTextSharp.text.Image iTextImgLI = iTextSharp.text.Image.GetInstance(imageLI, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgLI.ScaleAbsolute(60f, 60f); imageLICell = new PdfPCell(iTextImgLI); imageLICell.HorizontalAlignment = Element.ALIGN_CENTER; imageLICell.VerticalAlignment = Element.ALIGN_MIDDLE; } } else if (fp.Fingername.Equals(MyFingerprint.LeftMiddle)) { System.Drawing.Image imageLM = fp.AsBitmap; if (imageLM != null) { Console.WriteLine("###-->> LM"); iTextSharp.text.Image iTextImgLM = iTextSharp.text.Image.GetInstance(imageLM, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgLM.ScaleAbsolute(60f, 60f); imageLMCell = new PdfPCell(iTextImgLM); imageLMCell.HorizontalAlignment = Element.ALIGN_CENTER; imageLMCell.VerticalAlignment = Element.ALIGN_MIDDLE; } } else if (fp.Fingername.Equals(MyFingerprint.LeftRing)) { System.Drawing.Image imageLR = fp.AsBitmap; if (imageLR != null) { Console.WriteLine("###-->> LR"); iTextSharp.text.Image iTextImgLR = iTextSharp.text.Image.GetInstance(imageLR, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgLR.ScaleAbsolute(60f, 60f); imageLRCell = new PdfPCell(iTextImgLR); imageLRCell.HorizontalAlignment = Element.ALIGN_CENTER; imageLRCell.VerticalAlignment = Element.ALIGN_MIDDLE; } } else if (fp.Fingername.Equals(MyFingerprint.LeftLittle)) { System.Drawing.Image imageLL = fp.AsBitmap; if (imageLL != null) { Console.WriteLine("###-->> LL"); iTextSharp.text.Image iTextImgLL = iTextSharp.text.Image.GetInstance(imageLL, System.Drawing.Imaging.ImageFormat.Bmp); iTextImgLL.ScaleAbsolute(60f, 60f); imageLLCell = new PdfPCell(iTextImgLL); imageLLCell.HorizontalAlignment = Element.ALIGN_CENTER; imageLLCell.VerticalAlignment = Element.ALIGN_MIDDLE; } } } } //add the Right-Hand fingerprints if (imageRTCell != null) { fingerprintsTable.AddCell(imageRTCell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } if (imageRICell != null) { fingerprintsTable.AddCell(imageRICell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } if (imageRMCell != null) { fingerprintsTable.AddCell(imageRMCell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } if (imageRRCell != null) { fingerprintsTable.AddCell(imageRRCell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } if (imageRLCell != null) { fingerprintsTable.AddCell(imageRLCell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } //add 2nd row on the table fingerprintsTable.AddCell(new PdfPCell(new Phrase("LT"))); fingerprintsTable.AddCell(new PdfPCell(new Phrase("LI"))); fingerprintsTable.AddCell(new PdfPCell(new Phrase("LM"))); fingerprintsTable.AddCell(new PdfPCell(new Phrase("LR"))); fingerprintsTable.AddCell(new PdfPCell(new Phrase("LL"))); //add the Left-Hand fingerprints if (imageLTCell != null) { fingerprintsTable.AddCell(imageLTCell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } if (imageLICell != null) { fingerprintsTable.AddCell(imageLICell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } if (imageLMCell != null) { fingerprintsTable.AddCell(imageLMCell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } if (imageLRCell != null) { fingerprintsTable.AddCell(imageLRCell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } if (imageLLCell != null) { fingerprintsTable.AddCell(imageLLCell); } else { fingerprintsTable.AddCell(new PdfPCell(iTextDefaultFpImage, true)); } }//end-if - persons //add Table for fingerprints doc.Add(fingerprintsTable); doc.Close(); Console.WriteLine("PDF Generated successfully..."); System.Diagnostics.Process.Start(pdfPath); }//end generatePersonDetailReport
protected void SubmitButton_Click(object sender, EventArgs e) { GetPersonSoapClient getPerson = new GetPersonSoapClient(); PersonDetail personDetail = getPerson.getPerson(txtBoxPersonId.Text); if (personDetail != null) { passportPhoto.ImageUrl = "data:image/png;base64," + personDetail.PassportPhoto; lblName.Text = personDetail.Prefix + " " + personDetail.FirstName + " " + personDetail.MiddleName + " " + personDetail.LastName + " " + personDetail.Suffix; lblStreet.Text = personDetail.StreetAddress; lblCity.Text = personDetail.City; lblState.Text = personDetail.State; lblCountry.Text = personDetail.Country; lblDOB.Text = personDetail.DateOfBirth != null?personDetail.DateOfBirth.Value.ToString("MM/dd/yyyy") : ""; lblCellNbr.Text = personDetail.CellNbr; lblWorkNbr.Text = personDetail.WorkPhoneNbr; lblHomeNbr.Text = personDetail.HomePhoneNbr; lblEmail.Text = personDetail.Email; //Get person's physical characteristics PersonPhysicalCharServiceSoapClient personPhysicalCharService = new PersonPhysicalCharServiceSoapClient(); PersonPhysicalChar personPhysicalChar = personPhysicalCharService.GetPersonPhysicalChar(txtBoxPersonId.Text); if (personPhysicalChar != null) { lblHeight.Text = lblHeight.Text != null?personPhysicalChar.Height.ToString() : ""; lblWeight.Text = lblWeight.Text != null?personPhysicalChar.Weight.ToString() : ""; lblEyeColor.Text = personPhysicalChar.EyeColor; lblHairColor.Text = personPhysicalChar.HairColor; lblComplexion.Text = personPhysicalChar.Complexion; lblBuildType.Text = personPhysicalChar.BuildType; lblBrithMark.Text = personPhysicalChar.BirthMark; lblIDMark.Text = personPhysicalChar.IdMark; lblGender.Text = personPhysicalChar.Gender; lblDeathDate.Text = personPhysicalChar.DOD != null?personPhysicalChar.DOD.ToString("MM/dd/yyyy") : ""; //make the table visible TablePersonDetailPhysical.Visible = true; } //Get person's criminal record PersonCriminalRecordServiceSoapClient criminalRecordServiceSoapClient = new PersonCriminalRecordServiceSoapClient(); CriminalRecord[] criminalRecords = criminalRecordServiceSoapClient.GetCriminalRecords(txtBoxPersonId.Text); //Add Criminal Records to the Session Session["CriminalRecords"] = criminalRecords; if (criminalRecords.Length > 0) { //Make the table visible TableCriminalRecord.Visible = true; if (criminalRecords[0] != null) { lblCaseNo_1.Text = criminalRecords[0].CaseId; CaseNo_1.NavigateUrl = "~/CriminalCaseDetail.aspx?CaseNo=" + lblCaseNo_1.Text; lblCrimeLoc_1.Text = criminalRecords[0].CrimeLocation; lblCrimeDate_1.Text = criminalRecords[0].CrimeDate != null ? criminalRecords[0].CrimeDate.ToString("MM/dd/yyyy") : ""; lblStatus_1.Text = criminalRecords[0].Status; RowCriminalRec_1.Visible = true; } else { RowCriminalRec_1.Visible = false; } if (criminalRecords.Length > 1) { if (criminalRecords[1] != null) { lblCaseNo_2.Text = criminalRecords[1].CaseId; CaseNo_2.NavigateUrl = "~/CriminalCaseDetail.aspx?CaseNo=" + lblCaseNo_2.Text; lblCrimeLoc_2.Text = criminalRecords[1].CrimeLocation; lblCrimeDate_2.Text = criminalRecords[1].CrimeDate != null ? criminalRecords[1].CrimeDate.ToString("MM/dd/yyyy") : ""; lblStatus_2.Text = criminalRecords[1].Status; RowCriminalRec_2.Visible = true; } else { RowCriminalRec_2.Visible = false; } } else { RowCriminalRec_2.Visible = false; } if (criminalRecords.Length > 2) { if (criminalRecords[2] != null) { lblCaseNo_3.Text = criminalRecords[2].CaseId; CaseNo_3.NavigateUrl = "~/CriminalCaseDetail.aspx?CaseNo=" + lblCaseNo_3.Text; lblCrimeLoc_3.Text = criminalRecords[2].CrimeLocation; lblCrimeDate_3.Text = criminalRecords[2].CrimeDate != null ? criminalRecords[2].CrimeDate.ToString("MM/dd/yyyy") : ""; lblStatus_3.Text = criminalRecords[2].Status; RowCriminalRec_3.Visible = true; } else { RowCriminalRec_3.Visible = false; } } else { RowCriminalRec_3.Visible = false; } } else { TableCriminalRecord.Visible = false; } //make the table visible TablePersonDetail.Visible = true; } else { TablePersonDetail.Visible = false; TablePersonDetailPhysical.Visible = false; TableCriminalRecord.Visible = false; lblStatusMsg.Text = "No match found."; } }//end SubmitButton_Click