From cdb014aebf1b2de44bf4d7522d248ccb9d5372cc Mon Sep 17 00:00:00 2001 From: shakun Date: Tue, 5 Sep 2023 13:51:11 +0545 Subject: [PATCH] # First Txn All Compliance Hold --- .../ApproveOFACandComplaince/List.aspx.cs | 1 + .../ApproveTxn/holdTxnList.aspx.cs | 2 +- .../Remit/UserControl/UcTransaction.ascx | 403 +++++++++++++++++- .../Remit/UserControl/UcTransaction.ascx.cs | 307 +++++++++++++ .../UcTransaction.ascx.designer.cs | 154 ++++++- 5 files changed, 850 insertions(+), 17 deletions(-) diff --git a/Swift.web/Remit/Compliance/ApproveOFACandComplaince/List.aspx.cs b/Swift.web/Remit/Compliance/ApproveOFACandComplaince/List.aspx.cs index eccbe19..ebe447e 100644 --- a/Swift.web/Remit/Compliance/ApproveOFACandComplaince/List.aspx.cs +++ b/Swift.web/Remit/Compliance/ApproveOFACandComplaince/List.aspx.cs @@ -47,6 +47,7 @@ namespace Swift.web.Remit.Compliance.ApproveOFACandComplaince new GridColumn("senderName", "Sender Name", "", "T"), new GridColumn("receiverName", "Receiver Name", "", "T"), new GridColumn("createdBy", " Email", "", "T"), + new GridColumn("complianceRemarks", " Remarks", "", "T"), }; bool allowAddEdit = swiftLibrary.HasRight(AddEditFunctionId); diff --git a/Swift.web/Remit/Transaction/ApproveTxn/holdTxnList.aspx.cs b/Swift.web/Remit/Transaction/ApproveTxn/holdTxnList.aspx.cs index 1de964b..cfc35fe 100644 --- a/Swift.web/Remit/Transaction/ApproveTxn/holdTxnList.aspx.cs +++ b/Swift.web/Remit/Transaction/ApproveTxn/holdTxnList.aspx.cs @@ -75,7 +75,7 @@ namespace Swift.web.Remit.Transaction.ApproveTxn if (country.SelectedItem.Text == "" || country.SelectedItem.Text == "Select") { - country.SelectedItem.Text = "JAPAN"; + country.SelectedItem.Text = "UNITED KINGDOM"; } var ds = at.GetHoldedTXNListAdmin(GetStatic.GetUser(), branch.Text, tranNo.Text, rCountry.Text, sender.Text, receiver.Text , amt.Text, GetStatic.GetBranch(), GetStatic.GetUserType() diff --git a/Swift.web/Remit/UserControl/UcTransaction.ascx b/Swift.web/Remit/UserControl/UcTransaction.ascx index fe3be5f..d47aeb8 100644 --- a/Swift.web/Remit/UserControl/UcTransaction.ascx +++ b/Swift.web/Remit/UserControl/UcTransaction.ascx @@ -41,19 +41,40 @@ @@ -276,7 +423,7 @@ - + @@ -425,13 +572,13 @@ - - @@ -864,7 +1011,7 @@
- + <%----%> @@ -883,6 +1030,177 @@
+ +
+
Document Information
+
+
+
+ + <%----%> + + + +
+ +
+ +
+
+ +
+
+
+ + + + + +
+
+
+ +
+
+ + + + +
+ +
+ +
+
+ +
+
+
+ + <%----%> + + +
+
+
+
+
+ + + + +
+ +
+ +
+
+ +
+
+
+ + <%----%> + + +
+ + +
+
+
+
+ + + + +
+ +
+ ./../../Images/na.gif +
+
+ +
+
+
+ + <%----%> + + +
+ + +
+
+ + + + + +
+
+
@@ -1010,6 +1328,13 @@
+ + + + + + + + diff --git a/Swift.web/Remit/UserControl/UcTransaction.ascx.cs b/Swift.web/Remit/UserControl/UcTransaction.ascx.cs index 22a2d18..b2357b9 100644 --- a/Swift.web/Remit/UserControl/UcTransaction.ascx.cs +++ b/Swift.web/Remit/UserControl/UcTransaction.ascx.cs @@ -16,10 +16,12 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.IO; +using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Web; +using System.Web.Script.Serialization; using System.Web.UI.HtmlControls; namespace Swift.web.Remit.UserControl @@ -36,6 +38,7 @@ namespace Swift.web.Remit.UserControl private const string ModifyPayoutLocationId = "20121520"; private const string ModifyPayoutLocationIdAg = "40101730"; private readonly SwiftGrid _grid = new SwiftGrid(); + OnlineCustomerDao _cd = new OnlineCustomerDao(); public bool ShowDetailBlock { get; set; } public bool ShowLogBlock { get; set; } public bool ShowCommentBlock { get; set; } @@ -180,6 +183,10 @@ namespace Swift.web.Remit.UserControl var tRow = ds.Tables[0].Rows[0]; customerSignatureImg.ImageUrl = "/Remit/Transaction/TxnDocView/TxnDocView.ashx?txnDate=" + tRow["createdDate"].ToString() + "&controlNo=" + tRow["controlNo"].ToString(); + hdnCustomerId.Value = tRow["sCustomerId"].ToString(); + hdnRegisterDate.Value = tRow["registerDate"].ToString(); + hdnMembershipId.Value = tRow["uniqueId"].ToString(); + TranFound = true; HoldTranId = tRow["holdTranId"].ToString(); ShowQuestionaireLink(HoldTranId, displayType, viewType); @@ -498,6 +505,266 @@ namespace Swift.web.Remit.UserControl } } } + public class CustomerDocumentView + { + public string CdId { get; set; } + public string FileName { get; set; } + public string FileType { get; set; } + public string DocumentName { get; set; } + public string ImageUrl { get; set; } + public bool isEkyc { get; set; } + } + private List GetDocTypeListNew() + { + List docType = new List(); + docType.Add("ID Front"); + docType.Add("ID Back"); + docType.Add("Additional ID Front"); + docType.Add("Additional ID Back"); + + + return docType; + } + public void GetImageUrl() + { + string customerId = hdnCustomerId.Value; + string registerDate = hdnRegisterDate.Value; + string membershipId = hdnMembershipId.Value; + var documentDetails = _cd.GetDocumentByCustomerId(customerId); + List customerDocument = new List(); + List docList = new List(); + List docTypeList = GetDocTypeListNew(); + + if (documentDetails != null) + { + docList = documentDetails.Rows.Cast().ToList(); + foreach (var item in docTypeList) + { + var docDetails = docList.Where(x => x.Field("documentName").ToLower().ToString().Equals(item.ToLower())).FirstOrDefault(); + + if (docDetails != null) + { + CustomerDocumentView doc = new CustomerDocumentView + { + CdId = docDetails.Field("cdid").ToString(),// cast error aauxa eta + FileName = docDetails.Field("fileName").ToString(), + FileType = docDetails.Field("fileType") == null ? "" : docDetails.Field("fileType").ToString(), + DocumentName = docDetails.Field("documentName").ToString(), + ImageUrl = "/Handler/CustomerSignature.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + docDetails.Field("fileName").ToString(), + isEkyc = false + }; + customerDocument.Add(doc); + } + } + } + Response.ContentType = "text/plain"; + var serializer = new JavaScriptSerializer(); + var json = serializer.Serialize(customerDocument); + Response.Write(json); + Response.End(); + + } + + public void GetImageUrl1() + { + string customerId = hdnCustomerId.Value; + string registerDate = hdnRegisterDate.Value; + string membershipId = hdnMembershipId.Value; + var documentDetails = _cd.GetDocumentByCustomerId(customerId); + string[] imageUrlArray = new string[4]; + StringBuilder imageHtml = new StringBuilder(); + List docList = new List(); + + if (documentDetails != null) + { + docList = documentDetails.Rows.Cast().ToList(); + docList = docList.Where(x => !string.IsNullOrEmpty(x.Field("documentName"))).ToList(); + + var IdFront = docList.Where(x => x.Field("documentName").ToString().Equals("ID Front")).FirstOrDefault(); + if (IdFront != null) + { + imageUrlArray[0] = "/Handler/CustomerSignature.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + IdFront.Field("fileName").ToString(); + } + var IdBack = docList.Where(x => x.Field("documentName").ToString().Equals("ID Back")).FirstOrDefault(); + if (IdBack != null) + { + imageUrlArray[1] = "/Handler/CustomerSignature.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + IdBack.Field("fileName").ToString(); + } + var AdditionalIdFront = docList.Where(x => x.Field("documentName") != null && x.Field("documentName").ToString().Equals("Additional ID Front")).SingleOrDefault(); + if (AdditionalIdFront != null) + { + imageUrlArray[2] = "/Handler/CustomerSignature.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + AdditionalIdFront.Field("fileName").ToString(); + } + else + imageUrlArray[2] = ""; + var AdditionalIdBack = docList.Where(x => x.Field("documentName") != null && x.Field("documentName").ToString().Equals("Additional ID Back")).FirstOrDefault(); + if (AdditionalIdBack != null) + { + imageUrlArray[3] = "/Handler/CustomerSignature.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + AdditionalIdBack.Field("fileName").ToString(); + } + else + imageUrlArray[3] = ""; + } + Response.ContentType = "text/plain"; + var serializer = new JavaScriptSerializer(); + var json = serializer.Serialize(imageUrlArray); + Response.Write(json); + Response.End(); + + } + private void saveCustomerDocument() + { + string customerId = hdnCustomerId.Value; + string registerDate = hdnRegisterDate.Value; + string membershipId = hdnMembershipId.Value; + + HttpFileCollection fileCollection = Request.Files; + + for (int i = 0; i < fileCollection.AllKeys.Length; i++) + { + HttpPostedFile file = fileCollection[i]; + if (file != null) + { + string documentTypeName = ""; + string documentType = ""; + string fileType = ""; + string cdid = ""; + string filename = ""; + var keyName = fileCollection.AllKeys[i]; + keyName = keyName.Replace("ucTran$", ""); + + + if (keyName.ToLower().Equals("reg_front_id1")) + { + documentTypeName = "ID Card(Front)"; + documentType = "11394"; + if (hdnreg_front_idCdId != null & !string.IsNullOrEmpty(hdnreg_front_idCdId.Value)) + { + var r = hdnreg_front_idCdId.Value.Split('|'); + filename = r[0]; + cdid = r[1]; + } + } + if (keyName.ToLower().Equals("reg_back_id")) + { + documentTypeName = "ID Card(Back)"; + documentType = "11395"; + if (hdnreg_front_idCdId != null & !string.IsNullOrEmpty(hdnreg_back_id_idCdId.Value)) + { + var r = hdnreg_back_id_idCdId.Value.Split('|'); + filename = r[0]; + cdid = r[1]; + } + } + if (keyName.ToLower().Equals("reg_additional_id")) + { + documentTypeName = "Additional ID (Front)"; + documentType = "11396"; + if (hdnreg_front_idCdId != null & !string.IsNullOrEmpty(hdnreg_additional_idCdId.Value)) + { + var r = hdnreg_additional_idCdId.Value.Split('|'); + if (r.Count() > 1) + { + filename = r[0]; + cdid = r[1]; + } + else + cdid = r[0]; + } + } + if (keyName.ToLower().Equals("reg_additional_id2")) + { + documentTypeName = "Additional ID (Back)"; + documentType = "11397"; + if (hdnreg_front_idCdId != null & !string.IsNullOrEmpty(hdnreg_additional_id2CdId.Value)) + { + var r = hdnreg_additional_id2CdId.Value.Split('|'); + if (r.Count() > 1) + { + filename = r[0]; + cdid = r[1]; + } + else + cdid = r[0]; + } + } + + if (file.ContentLength > 0 && !string.IsNullOrEmpty(file.FileName)) + { + string fileNameNew = (!string.IsNullOrWhiteSpace(file.FileName) ? UploadDocument(file, customerId, documentTypeName, membershipId, registerDate, filename, out fileType) + : UploadDocument(file, customerId, documentType, membershipId, registerDate, filename, out fileType)); + //CustomerDocument cm = new CustomerDocument(); + //cm.customerId = result[0]; + //cm.fileDescription = ""; + //cm.documentType = documentType; + //cm.fileUrl = fileName; + //cm.fileType = fileType; + + if (fileNameNew.Contains("notValid extensions.")) + { + GetStatic.CallBackJs1(Page, "Print Message", "ManageMessage('" + fileNameNew + "');"); + continue; + } + else + _cd.UpdateCustomerDocument(cdid, customerId, fileNameNew, documentTypeName, fileType, documentType, GetStatic.GetUser()); + } + } + } + + + } + + private string UploadDocument(HttpPostedFile doc, string customerId, string documentType, string membershipId, string registeredDate, string filenameOld, out string fileType) + { + fileType = ""; + string fName = ""; + try + { + fileType = doc.ContentType; + string fileExtension = new FileInfo(doc.FileName).Extension; + string documentExtension = GetStatic.ReadWebConfig("customerDocFileExtension", ""); + if (documentExtension.ToLower().Contains(fileExtension.ToLower())) + { + string fileName = customerId + "_" + documentType.Replace(" ", string.Empty) + "_" + DateTime.Now.Hour.ToString() + DateTime.Now.Millisecond.ToString() + "_" + registeredDate.Replace("-", "_") + fileExtension; + string path = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + registeredDate.Replace("-", "\\") + "\\" + membershipId; + if (!Directory.Exists(path)) + Directory.CreateDirectory(path); + + bool folderExists = Directory.Exists(path + "\\deleted"); + if (!folderExists) + Directory.CreateDirectory(path + "\\deleted"); + + String filename_initial = path + "\\deleted\\" + $"org_{filenameOld}"; + String filename_current = filename_initial; + var count = 0; + while (File.Exists(filename_current)) + { + count++; + filename_current = Path.GetDirectoryName(filename_initial) + + Path.DirectorySeparatorChar + + Path.GetFileNameWithoutExtension(filename_initial) + + count.ToString() + + Path.GetExtension(filename_initial); + } + + File.Move(path + "\\" + filenameOld, filename_current); + doc.SaveAs(path + "\\" + filenameOld); + + fName = filenameOld; + } + else + { + fName = "notValid extensions."; + } + + } + catch (Exception ex) + { + GetStatic.LogError(ex, "UploadDocument"); + fName = ""; + } + return fName; + } private void PopulateBankDetails(DataTable dataTable) { @@ -607,8 +874,46 @@ namespace Swift.web.Remit.UserControl DeleteTroubleTicket(); // ShowLog(); } + if(methodName == "GetCustomerDetails") + { + GetCustomerDetails(); + } + if (methodName == "GetImageUrl") + { + GetImageUrl(); + } } + private void GetCustomerDetails() + { + string eId = Request.Form["Id"]; + var dt = _cd.GetDetailsForEditCustomer(eId, GetStatic.GetUser()); + + Response.ContentType = "text/plain"; + var json = DataTableToJson(dt); + Response.Write(json); + Response.End(); + } + public static string DataTableToJson(DataTable table) + { + if (table == null) + return ""; + var list = new List>(); + + foreach (DataRow row in table.Rows) + { + var dict = new Dictionary(); + + foreach (DataColumn col in table.Columns) + { + dict[col.ColumnName] = string.IsNullOrEmpty(row[col].ToString()) ? "" : row[col]; + } + list.Add(dict); + } + var serializer = new JavaScriptSerializer(); + string json = serializer.Serialize(list); + return json; + } private void DeleteTroubleTicket() { var obj = new TranViewDao(); @@ -944,6 +1249,7 @@ namespace Swift.web.Remit.UserControl { SaveComplianceApproveRemarks(); + //DbResult result = obj.CheckTranInBothRule(GetStatic.GetUser(), hddTranId.Value); //if(result.ErrorCode == "1") //{ @@ -1000,6 +1306,7 @@ namespace Swift.web.Remit.UserControl } public void SaveComplianceApproveRemarks(string cashHoldLimitFlag = "") { + saveCustomerDocument(); DbResult dbResult = obj.SaveApproveRemarksComplaince(GetStatic.GetUser(), lblControlNo.Text, hddTranId.Value, remarksCompliance.Text, remarksOFAC.Text, remarksCashLimitHold.Text, cashHoldLimitFlag); diff --git a/Swift.web/Remit/UserControl/UcTransaction.ascx.designer.cs b/Swift.web/Remit/UserControl/UcTransaction.ascx.designer.cs index 5f8f0af..f14ab89 100644 --- a/Swift.web/Remit/UserControl/UcTransaction.ascx.designer.cs +++ b/Swift.web/Remit/UserControl/UcTransaction.ascx.designer.cs @@ -339,7 +339,7 @@ namespace Swift.web.Remit.UserControl protected global::System.Web.UI.WebControls.Label sIdType; /// - /// sEmail control. + /// nativeCountry control. /// /// /// Auto-generated field. @@ -357,7 +357,7 @@ namespace Swift.web.Remit.UserControl protected global::System.Web.UI.WebControls.Label occupation; /// - /// nativeCountry control. + /// sEmail control. /// /// /// Auto-generated field. @@ -609,7 +609,15 @@ namespace Swift.web.Remit.UserControl protected global::System.Web.UI.WebControls.Label pAgentLocation; /// + /// payer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label payer; + + /// /// pAgentDistrict control. /// /// @@ -1069,7 +1077,15 @@ namespace Swift.web.Remit.UserControl protected global::System.Web.UI.WebControls.CheckBox chkEmail; /// + /// chkPush control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkPush; + + /// /// btnAdd control. /// /// @@ -1231,6 +1247,51 @@ namespace Swift.web.Remit.UserControl /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl populateDocument; + /// + /// PanelKycDocumentUpload control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PanelKycDocumentUpload; + + /// + /// reg_front_id1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.FileUpload reg_front_id1; + + /// + /// reg_back_id control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.FileUpload reg_back_id; + + /// + /// reg_additional_id control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.FileUpload reg_additional_id; + + /// + /// reg_additional_id2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.FileUpload reg_additional_id2; + /// /// pnlPartnerRemarks control. /// @@ -1259,9 +1320,33 @@ namespace Swift.web.Remit.UserControl protected global::System.Web.UI.WebControls.DropDownList ddlRemarks; /// + /// panelCustomerDocDetails control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel panelCustomerDocDetails; + + /// + /// customerDoc control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl customerDoc; + + /// + /// customerDocDetails control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl customerDocDetails; + + /// /// pnlQuestionaire control. /// /// @@ -1280,7 +1365,7 @@ namespace Swift.web.Remit.UserControl protected global::System.Web.UI.HtmlControls.HtmlGenericControl questionaireDiv; /// - /// rpt_grid control. + /// qaGrid control. /// /// /// Auto-generated field. @@ -1413,5 +1498,68 @@ namespace Swift.web.Remit.UserControl /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.HiddenField hdnCustomerId; + + /// + /// hdnreg_front_idCdId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hdnreg_front_idCdId; + + /// + /// hdnreg_back_id_idCdId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hdnreg_back_id_idCdId; + + /// + /// hdnreg_additional_idCdId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hdnreg_additional_idCdId; + + /// + /// hdnreg_additional_id2CdId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hdnreg_additional_id2CdId; + + /// + /// hdn_AdditionalIDFront2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hdn_AdditionalIDFront2; + + /// + /// hdnRegisterDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hdnRegisterDate; + + /// + /// hdnMembershipId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hdnMembershipId; } }
Purpose: +
Source of Fund: +