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.
111 lines
4.7 KiB
111 lines
4.7 KiB
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.UI;
|
|
|
|
namespace JMEAgentSystem.WebPages.SendTxn
|
|
{
|
|
public partial class PrintSendMoneyRequestDetails : 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(), GetRowId(), "txn").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);
|
|
|
|
string fileName = GetStatic.HTMLToPDF(s, GetStatic.GetUser(), path, "txn-req-form");
|
|
_customerServices.AddCustomerPDFUpload(customerId, GetStatic.GetUser(), fileName, "txn", GetRowId());
|
|
}
|
|
|
|
protected void approve_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
private void LoadCustomerDetails()
|
|
{
|
|
var membershipId = GetMembershipId();
|
|
var rowId = GetRowId();
|
|
if (rowId == "" || membershipId == "")
|
|
{
|
|
return;
|
|
}
|
|
var dataSet = _customerServices.GetCustomerInfoFromMembershiId(GetStatic.GetUser(), membershipId, "", rowId);
|
|
SetCustomerDetails(dataSet.Tables[1].Rows[0]);
|
|
//set receiver dettails
|
|
SetTransactionDetails(dataSet.Tables[3].Rows[0]);
|
|
PrintDetails pd = new PrintDetails();
|
|
docDiv.InnerHtml = pd.GetSignatrueHtml(dataSet, "Staff Visit - Send Txn(Customer Signature)", rowId);
|
|
|
|
}
|
|
private string GetMembershipId()
|
|
{
|
|
return GetStatic.ReadQueryString("customerId", "");
|
|
}
|
|
private string GetRowId()
|
|
{
|
|
return GetStatic.ReadQueryString("rowId", "");
|
|
}
|
|
private void SetTransactionDetails(DataRow dr)
|
|
{
|
|
idNumber.InnerText = dr["idNumber"].ToString();
|
|
custFullName.InnerText = dr["custFullName"].ToString();
|
|
recFullName.InnerText = dr["receiverFullName"].ToString();
|
|
recAddress.InnerText = dr["receiverAddress"].ToString();
|
|
recMobile.InnerText = dr["ReceiverMobileNumber"].ToString();
|
|
pCountry.InnerText = dr["pcountry"].ToString();
|
|
pmode.InnerText = dr["pMode"].ToString();
|
|
pAgent.InnerText = dr["BANK_NAME"].ToString();
|
|
pBranch.InnerText = dr["BRANCH_NAME"].ToString();
|
|
accountNo.InnerText = dr["accountNumber"].ToString();
|
|
cAmt.InnerText = dr["cAmt"].ToString();
|
|
tAmt.InnerText = dr["tAmt"].ToString();
|
|
serviceCharge.InnerText = dr["serviceCharge"].ToString();
|
|
purpose.InnerText = dr["purposeOfRemit"].ToString();
|
|
relationship.InnerText = dr["relationship"].ToString();
|
|
otherRelation.InnerText = dr["otherRelation"].ToString();
|
|
otherPurpose.InnerText = dr["otherPurpose"].ToString();
|
|
collMode.InnerText = dr["collMode"].ToString();
|
|
}
|
|
private void SetCustomerDetails(DataRow dr)
|
|
{
|
|
customerName.InnerText = dr["fullName"].ToString();
|
|
membershiId.InnerText = dr["membershipId"].ToString();
|
|
custAddress.InnerText = dr["address"].ToString();
|
|
custDob.InnerText = dr["dob"].ToString();
|
|
custOccupation.InnerText = dr["occupation"].ToString();
|
|
}
|
|
}
|
|
}
|