protected void btnSaveDocumentEdit_Click(object sender, EventArgs e) { int claimDocumentID = Convert.ToInt32(ViewState["ClaimDocumentID"]); ClaimDocument claimDocument = null; Page.Validate("document"); if (!Page.IsValid) { return; } claimDocument = ClaimDocumentManager.Get(claimDocumentID); if (claimDocument != null) { claimDocument.Description = txtDcoumentDescription.Text.Trim(); if (ddlDocumentCategoryEdit.SelectedIndex > 0) { claimDocument.DocumentCategoryID = Convert.ToInt32(ddlDocumentCategoryEdit.SelectedValue); } ClaimDocumentManager.Save(claimDocument); } pnlEditClaimDocument.Visible = false; pnlGridPanel.Visible = true; gvDocuments.DataSource = ClaimDocumentManager.GetAll(this.claimID); gvDocuments.DataBind(); }
public void bindData(int claimID) { hf_claimID.Value = claimID.ToString(); gvDocuments.DataSource = ClaimDocumentManager.GetAll(claimID); gvDocuments.DataBind(); bindHistoricalDocuments(); bindDocumentCategory(ddlDocumentCategory); }
static protected string mergeDocuments(string sourcepath, string destinationPath, int leadID, int claimID) { List <LeadsDocument> documents = null; List <ClaimDocument> claimDocuments = null; List <string> pdfs = new List <string>(); string mergedReportPath = null; documents = LeadsUploadManager.getLeadsDocumentForExportByLeadID(leadID); claimDocuments = ClaimDocumentManager.GetAll(claimID); // add original document to list pdfs.Insert(0, sourcepath); // lead documents if (documents != null && documents.Count > 0) { List <string> leadPDFs = (from x in documents where x.DocumentName.Contains(".pdf") select string.Format("{0}/LeadsDocument/{1}/{2}/{3}", appPath, x.LeadId, x.LeadDocumentId, x.DocumentName) ).ToList(); foreach (string pdf in leadPDFs) { pdfs.Add(pdf); } } // claim documents if (claimDocuments != null && claimDocuments.Count > 0) { List <string> claimPDFs = (from x in claimDocuments where x.DocumentName.Contains(".pdf") select string.Format("{0}/ClaimDocuments/{1}/{2}/{3}", appPath, x.ClaimID, x.ClaimDocumentID, x.DocumentName) ).ToList(); foreach (string pdf in claimPDFs) { pdfs.Add(pdf); } } // mergedReportPath = Path.GetDirectoryName(sourcepath) + "\\" + Guid.NewGuid().ToString() + ".pdf"; // mergePDFFiles(mergedReportPath, pdfs.ToArray()); mergePDFFiles(destinationPath, pdfs.ToArray()); return(destinationPath); }
private void bindData() { int leadID = 0; int claimID = 0; Leads lead = null; Claim claim = null; List <LeadsDocument> leadDocuments = null; List <ClaimDocument> claimDocuments = null; List <DocumentList> allDocuments = new List <DocumentList>(); int.TryParse(Core.SecurityManager.DecryptQueryString(Request.Params["q"].ToString()), out claimID); if (claimID > 0) { claim = ClaimsManager.Get(claimID); if (claim != null) { lead = claim.LeadPolicy.Leads; lblName.Text = lead.insuredName; // lead documents leadDocuments = LeadsUploadManager.getLeadsDocumentForExportByLeadID(leadID); if (leadDocuments != null && leadDocuments.Count > 0) { foreach (LeadsDocument leadDocument in leadDocuments) { DocumentList doc = new DocumentList(); doc.DocumentName = leadDocument.DocumentName; doc.Description = leadDocument.Description; doc.DocumentPath = string.Format("~/LeadsDocument/{0}/{1}/{2}", leadDocument.LeadId, leadDocument.LeadDocumentId, // document id leadDocument.DocumentName); // document file name allDocuments.Add(doc); } } // claim documents claimDocuments = ClaimDocumentManager.GetAll(claimID); if (claimDocuments != null && claimDocuments.Count > 0) { foreach (ClaimDocument claimDocument in claimDocuments) { DocumentList doc = new DocumentList(); doc.DocumentName = claimDocument.DocumentName; doc.Description = claimDocument.Description; doc.DocumentPath = string.Format("~/ClaimDocuments/{0}/{1}/{2}", claimDocument.ClaimID, claimDocument.ClaimDocumentID, // document id claimDocument.DocumentName); // document file name allDocuments.Add(doc); } } gvDocument.DataSource = allDocuments; gvDocument.DataBind(); } } }
protected void bindData() { //AppraiserMaster appraiser = null; Claim claim = null; //List<LeadContact> contacts = null; List <DocumentList> attachments = null; //ContractorMaster contractor = null; //List<SecUser> users = null; Leads lead = null; //Data.UmpireMaster umpire = null; // get email for user sending email CRM.Data.Entities.SecUser user = SecUserManager.GetByUserId(userID); if (user != null) { txtEmailFrom.Text = user.Email; txtEmailCC.Text = user.Email; txtSignature.Text = user.emailSignature ?? ""; } claim = ClaimsManager.Get(this.claimID); if (claim != null) { attachments = new List <DocumentList>(); lead = claim.LeadPolicy.Leads; // build subject line txtEmailSubject.Text = string.Format("{0} Claim #: {1}", lead.policyHolderName, claim.AdjusterClaimNumber); // load legacy documents List <LeadsDocument> documents = LeadsUploadManager.getLeadsDocumentByLeadID((int)claim.LeadPolicy.LeadId); if (documents != null && documents.Count > 0) { foreach (LeadsDocument x in documents) { DocumentList attachment = new DocumentList(); attachment.DocumentName = x.Description; attachment.DocumentPath = string.Format("LeadsDocument/{0}/{1}/{2}", x.LeadId, x.LeadDocumentId, // document id x.DocumentName); // document file name attachments.Add(attachment); } } // load claim documents List <ClaimDocument> claimDocuments = ClaimDocumentManager.GetAll(this.claimID); if (claimDocuments != null && claimDocuments.Count > 0) { foreach (ClaimDocument x in claimDocuments) { DocumentList attachment = new DocumentList(); attachment.DocumentName = x.Description; attachment.DocumentPath = string.Format("ClaimDocuments/{0}/{1}/{2}", x.ClaimID, x.ClaimDocumentID, // document id x.DocumentName); // document file name attachments.Add(attachment); } } lbxDocuments.DataSource = attachments; lbxDocuments.DataBind(); //// load legacy contacts //contacts = LeadContactManager.GetContactByLeadID(leadID); //// add adjusters to contact list //if (claim.AdjusterMaster != null) // addToContactList(claim.AdjusterMaster.AdjusterName, claim.AdjusterMaster.email, contacts); //// add appraiser to contact list //if (lead.AppraiserID != null) { // appraiser = AppraiserManager.Get((int)lead.AppraiserID); // contacts.Add(new LeadContact { // Email = appraiser.Email, // ContactName = appraiser.AppraiserName // }); //} //// add contractor to contact list //if (lead.ContractorID != null) { // contractor = ContractorManager.Get((int)lead.ContractorID); // contacts.Add(new LeadContact { // Email = lead.ContractorMaster.Email, // ContactName = lead.ContractorMaster.ContractorName // }); //} //// add umpire to contact list //if (lead.UmpireID != null) { // umpire = UmpireManager.Get((int)lead.UmpireID); // contacts.Add(new LeadContact { // Email = lead.UmpireMaster.Email, // ContactName = lead.UmpireMaster.UmpireName // }); //} // add users 2013-12-12 //users = SecUserManager.GetUsers(clientID); //if (users != null && users.Count > 0) { // users.ForEach(x => // contacts.Add(new LeadContact { // Email = x.Email, // ContactName = x.FirstName ?? "" + " " + x.LastName ?? "" // })); //} } //lbxContacts.DataSource = contacts; //lbxContacts.DataBind(); }