You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
using Business.Configuration; using Business.Customer; using Common.Helper; using JMEAgentSystem.WebPages.CustomerRegistration; using System; using System.Data; using System.IO; using System.Text; using System.Web; using System.Web.UI;
namespace JMEAgentSystem.WebPages.BenificiaryRegistration { public partial class PrintBeneficiaryDetails : System.Web.UI.Page { private readonly ICustomerServices _customerServices = AutoFacContainer.Resolve<ICustomerServices>(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GetStatic.PrintMessage(this.Page); LoadCustomerDetails();
todaysDate.InnerText = DateTime.Now.ToString("dd-MM-yyyy"); SavePDF(); } }
private void SavePDF() { var result = _customerServices.GetCustomerDetailsForPDFSave(GetMembershipId(), GetReceiverId(), "receiver").Split('|'); if (result[0] != "0") { return; } var customerId = result[1]; var membershipId = result[2]; var registerDate = result[3]; var fileNameSignature = result[4]; string path = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + registerDate.Replace("-", "\\") + "\\" + membershipId + "\\";
var sb = new StringBuilder(); downloadDivPDF.RenderControl(new HtmlTextWriter(new StringWriter(sb))); string s = sb.ToString();
string replaceText = "/WebPages/GetFileView.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + fileNameSignature; s = s.Replace(replaceText, path + fileNameSignature);
//s = s + "<img src=\"E:\\JMEFiles\\CustomerDocument\\2020\\09\\07\\AGT031733\\48305_signature_15249_2020_09_07.png\" />";
String originalPath = new Uri(HttpContext.Current.Request.Url.AbsoluteUri).OriginalString;
string fileName = GetStatic.HTMLToPDF(s, GetStatic.GetUser(), path, "bene-reg-form"); _customerServices.AddCustomerPDFUpload(customerId, GetStatic.GetUser(), fileName, "receiver", GetReceiverId()); }
protected void approve_Click(object sender, EventArgs e) {
} private void LoadCustomerDetails() { var membershipId = GetMembershipId(); var receiverId = GetReceiverId(); if(receiverId == "") { return; } var dataSet = _customerServices.GetCustomerInfoFromMembershiId(GetStatic.GetUser(), membershipId, receiverId, ""); SetCustomerDetails(dataSet.Tables[1].Rows[0]); //set receiver dettails
SetReceiverDetails(dataSet.Tables[2].Rows[0]); PrintDetails pd = new PrintDetails(); docDiv.InnerHtml = pd.GetSignatrueHtml(dataSet, "Staff Visit - Bene. Reg(Customer Signature)", dataSet.Tables[2].Rows[0]["receiverId"].ToString());
}
private string GetMembershipId() { return GetStatic.ReadQueryString("membershipId", ""); }
private string GetReceiverId() { return GetStatic.ReadQueryString("receiverId", ""); }
private void SetReceiverDetails(DataRow dr) { recCountry.InnerText = dr["country"].ToString(); recBeneficiaryType.InnerText = dr["receiverType"].ToString(); recFullName.InnerText = dr["customerName"].ToString(); recNativeCountry.InnerText = dr["NativeCountry"].ToString(); recAddress.InnerText = dr["address"].ToString(); recCity.InnerText = dr["city"].ToString(); recMobile.InnerText = dr["mobile"].ToString(); recIdType.InnerText = dr["idType"].ToString(); recIdNumber.InnerText = dr["idNumber"].ToString(); recPlaceOfIssue.InnerText = dr["placeOfIssue"].ToString(); recRelationship.InnerText = dr["relationship"].ToString(); recOtherRelationDescription.InnerText = dr["otherRelationDesc"].ToString(); recPurposeOfRemittance.InnerText = dr["purposeOfRemit"].ToString(); otherPurpose.InnerText = dr["otherPurpose"].ToString(); recPaymentMode.InnerText = dr["paymentMode"].ToString(); pagent.InnerText = dr["payOutPartner"].ToString(); recAccountNumber.InnerText = dr["receiverAccountNo"].ToString(); pBranch.InnerText = dr["bankBranchName"].ToString(); recRemarks.InnerText = dr["remarks"].ToString(); }
private void SetCustomerDetails(DataRow dr) { customerName.InnerText = dr["fullName"].ToString(); membershiId.InnerText = dr["membershipId"].ToString(); } } }
|