Browse Source

Task #16223 UK Sanc

Prod
shakun 1 year ago
parent
commit
bb1763d2aa
  1. 10
      Swift.DAL/Remittance/OFACManagement/OFACDao.cs
  2. 125
      Swift.web/Remit/OFACManagement/Import.aspx
  3. 50
      Swift.web/Remit/OFACManagement/Import.aspx.cs
  4. 81
      Swift.web/Remit/OFACManagement/Import.aspx.designer.cs

10
Swift.DAL/Remittance/OFACManagement/OFACDao.cs

@ -63,9 +63,17 @@ namespace Swift.DAL.BL.Remit.OFACManagement
return ParseDbResultV2(sql); return ParseDbResultV2(sql);
} }
public DataRow UploadXMLData(string xml, string user)
{
var sql = "EXEC proc_ofacOtherDataManagement @flag = 'other'";
sql += " ,@user=" + FilterString(user);
sql += " ,@xml='" + xml + "'";
return ExecuteDataRow(sql);
}
public DbResult UpdateAQList(string user, string xmlFile,string xmlFileName, string source) public DbResult UpdateAQList(string user, string xmlFile,string xmlFileName, string source)
{ {
var sql = "EXEC Proc_unscrManagement @flag = 'unscr'";
var sql = "EXEC Proc_UKListManagement @flag = 'ofac-list'";
sql += ", @user = " + FilterString(user); sql += ", @user = " + FilterString(user);
sql += ", @xmlFile = " + FilterString(xmlFile); sql += ", @xmlFile = " + FilterString(xmlFile);
sql += ", @xmlFileName = " + FilterString(xmlFileName); sql += ", @xmlFileName = " + FilterString(xmlFileName);

125
Swift.web/Remit/OFACManagement/Import.aspx

@ -18,76 +18,91 @@
<form id="form1" runat="server"> <form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManger1" runat="server"> <asp:ScriptManager ID="ScriptManger1" runat="server">
</asp:ScriptManager> </asp:ScriptManager>
<asp:UpdateProgress ID="updProgress" AssociatedUpdatePanelID="upd1" runat="server">
<asp:UpdateProgress ID="updProgress" runat="server">
<ProgressTemplate> <ProgressTemplate>
<div style="position: fixed; left: 450px; top: 0px; background-color: white; border: 1px solid black;"> <div style="position: fixed; left: 450px; top: 0px; background-color: white; border: 1px solid black;">
<img alt="progress" src="/Images/Loading_small.gif" /> <img alt="progress" src="/Images/Loading_small.gif" />
Processing... Processing...
</div> </div>
</ProgressTemplate> </ProgressTemplate>
</asp:UpdateProgress> </asp:UpdateProgress>
<asp:UpdatePanel ID="upd1" runat="server">
<ContentTemplate>
<div class="page-wrapper">
<div class="row">
<div class="col-sm-12">
<div class="page-title">
<ol class="breadcrumb">
<li><a href="../../Front.aspx" target="mainFrame"><i class="fa fa-home"></i></a></li>
<li><a href="#" onclick="return LoadModule('remittance')">Remittance</a></li>
<li class="active"><a href="#">Watchlist Management</a></li>
<li class="active"><a href="#">Import OFAC List</a></li>
</ol>
<%-- <asp:UpdatePanel ID="upd1" runat="server">
<ContentTemplate>--%>
<div class="page-wrapper">
<div class="row">
<div class="col-sm-12">
<div class="page-title">
<ol class="breadcrumb">
<li><a href="../../Front.aspx" target="mainFrame"><i class="fa fa-home"></i></a></li>
<li><a href="#" onclick="return LoadModule('remittance')">Remittance</a></li>
<li class="active"><a href="#">Watchlist Management</a></li>
<li class="active"><a href="#">Import OFAC List</a></li>
</ol>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default ">
<div class="panel-heading">
<h4 class="panel-title">Import OFAC List</h4>
<div class="panel-actions">
<a href="#" class="panel-action panel-action-toggle"></a>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default ">
<div class="panel-heading">
<h4 class="panel-title">Import OFAC List</h4>
<div class="panel-actions">
<a href="#" class="panel-action panel-action-toggle"></a>
</div>
<div class="panel-body">
<div class="form-group">
<label>OFAC</label><br />
<asp:Button ID="btnImport" runat="server" Text="Download OFAC Data" CssClass="btn btn-primary" OnClick="btnImport_Click" />
<asp:Button ID="btnLoadOfac" runat="server" Text="Upload OFAC Data" CssClass="btn btn-primary" OnClick="btnLoadOfac_Click" />
</div>
<div class="form-group">
<label>UNSCR</label><br />
<asp:Button ID="BtnImpAQList" runat="server" CssClass="btn btn-primary" OnClick="BtnImpAQList_Click" Text="Download UNSCR Data" />
<asp:Button ID="btnUpload" runat="server" CssClass="btn btn-primary" OnClick="btnUpload_Click" Text="Upload UNSCR Data" />
</div>
<div class="form-group">
<label>OTHERS DATA SOURCE [ FBI, EU, BXA_UN, HMS, BXA_DPL, OSFI ]</label><br />
<asp:Button ID="Button1" runat="server" CssClass="btn btn-primary" Text="Upload Others Data" OnClick="Button1_Click" />
</div>
<div id="uploadDiv" runat="server" class="form-group">
<label>Upload UK List</label><br />
<%--<asp:FileUpload ID="fileUpload" runat="server" /><br />--%>
<asp:FileUpload runat="server" ID="fileUpload" ValidationGroup="fileUploadReq" /><br />
<asp:RequiredFieldValidator ID="FileUploadValidator" runat="server" ControlToValidate="fileUpload" ValidationGroup="fileUploadReq"
Display="Dynamic" ErrorMessage="Required!" ForeColor="Red"
SetFocusOnError="True"></asp:RequiredFieldValidator>
<%--<asp:Button ID="btnFileUpload" runat="server" CssClass="btn btn-primary" OnClick="btnFileUpload_Click" Text="Upload File" />--%>
<asp:Button ID="btnFileUpload" runat="server" Text="Upload" CssClass="btn btn-primary" ValidationGroup="fileUploadReq"
OnClick="btnFileUpload_Click" />
<%--<asp:Label ID="lblMsg" Visible="false" Font-Bold="true" ForeColor="Red" runat="server" Text="Xml Document"></asp:Label>--%>
</div>
<div class="form-group">
<div runat="server" id="SourceWiseData" style="width: 400px; float: right; font-size: 10px;">
</div>
</div>
<div class="form-group">
<div runat="server" id="DivMessage" style="text-align: center; color: Red; display: block">
</div>
<p>
</p>
<p>
</p>
<div id="rpt_grid" runat="server" class="gridDiv">
</div> </div>
<div class="panel-body">
<div class="form-group">
<label>OFAC</label><br />
<asp:Button ID="btnImport" runat="server" Text="Download OFAC Data" CssClass="btn btn-primary" OnClick="btnImport_Click" />
<asp:Button ID="btnLoadOfac" runat="server" Text="Upload OFAC Data" CssClass="btn btn-primary" OnClick="btnLoadOfac_Click" />
</div>
<div class="form-group">
<label>UNSCR</label><br />
<asp:Button ID="BtnImpAQList" runat="server" CssClass="btn btn-primary" OnClick="BtnImpAQList_Click" Text="Download UNSCR Data" />
<asp:Button ID="btnUpload" runat="server" CssClass="btn btn-primary" OnClick="btnUpload_Click" Text="Upload UNSCR Data" />
</div>
<div class="form-group">
<label>OTHERS DATA SOURCE [ FBI, EU, BXA_UN, HMS, BXA_DPL, OSFI ]</label><br />
<asp:Button ID="Button1" runat="server" CssClass="btn btn-primary" Text="Upload Others Data" OnClick="Button1_Click" />
</div>
<div class="form-group">
<div runat="server" id="SourceWiseData" style="width: 400px; float: right; font-size: 10px;">
</div>
</div>
<div class="form-group">
<div runat="server" id="DivMessage" style="text-align: center; color: Red; display: block">
</div>
<p>
</p>
<p>
</p>
<div id="rpt_grid" runat="server" class="gridDiv">
</div>
<div id="rpt_AQgrid" runat="server" class="gridDiv">
</div>
</div>
<div id="rpt_AQgrid" runat="server" class="gridDiv">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<%-- </ContentTemplate>
</asp:UpdatePanel>--%>
</form> </form>
</body> </body>
</html> </html>

50
Swift.web/Remit/OFACManagement/Import.aspx.cs

@ -1,10 +1,13 @@
using System; using System;
using System.Data; using System.Data;
using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Web;
using System.Xml; using System.Xml;
using Swift.DAL.BL.Remit.OFACManagement; using Swift.DAL.BL.Remit.OFACManagement;
using Swift.DAL.BL.System.Utility;
using Swift.DAL.SwiftDAL; using Swift.DAL.SwiftDAL;
using Swift.web.Library; using Swift.web.Library;
using static Swift.web.Library.CustomConfigHelper; using static Swift.web.Library.CustomConfigHelper;
@ -30,6 +33,11 @@ namespace Swift.web.Remit.OFACManagement
Authenticate(); Authenticate();
LoadLogGrid(); LoadLogGrid();
LoadSourceWiseData(); LoadSourceWiseData();
if (!IsPostBack)
{
LoadLogGrid();
}
} }
private void Authenticate() private void Authenticate()
{ {
@ -224,8 +232,9 @@ namespace Swift.web.Remit.OFACManagement
private string GetUNSCRData(string fileName) private string GetUNSCRData(string fileName)
{ {
var aqFilePath = GetStatic.GetAppRoot() + "doc\\OFAC\\"+ fileName + ".xml";
//var aqFilePath = GetStatic.GetAppRoot() + "doc\\OFAC\\"+ fileName + ".xml";
var aqFilePath = GetStatic.GetAppRoot() + fileName;
FileWebRequest myRequest = (FileWebRequest)WebRequest.Create(aqFilePath); FileWebRequest myRequest = (FileWebRequest)WebRequest.Create(aqFilePath);
myRequest.Method = "GET"; myRequest.Method = "GET";
WebResponse myResponse = myRequest.GetResponse(); WebResponse myResponse = myRequest.GetResponse();
@ -304,5 +313,42 @@ namespace Swift.web.Remit.OFACManagement
ManageMessage(dbResult); ManageMessage(dbResult);
DivMessage.InnerHtml = dbResult.Msg; DivMessage.InnerHtml = dbResult.Msg;
} }
protected void btnFileUpload_Click(object sender, EventArgs e)
{
//string xmlContent = GetUNSCRData("sample");
//var dbResult = obj.UpdateAQList(GetStatic.GetUser(), xmlContent, "sample.xml", "UNSCR");
//ManageMessage(dbResult);
//DivMessage.InnerHtml = dbResult.Msg;
//LoadAQLogGrid();
try
{
if (fileUpload.FileContent.Length > 0)
{
if (fileUpload.FileName.ToLower().Contains(".xml"))
{
string fileName = fileUpload.FileName;
string xmlContent = GetUNSCRData(fileName);
var dbResult = obj.UpdateAQList(GetStatic.GetUser(), xmlContent, fileName, "UNSCR");
ManageMessage(dbResult);
DivMessage.InnerHtml = dbResult.Msg;
LoadAQLogGrid();
}
else
{
GetStatic.AlertMessage(this, "Invalid file format uploaded");
}
}
}
catch (Exception ex)
{
GetStatic.AlertMessage(this, $"Technical Error: { GetStatic.LogError(ex).Id}");
}
}
} }
} }

81
Swift.web/Remit/OFACManagement/Import.aspx.designer.cs

@ -7,11 +7,13 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace Swift.web.Remit.OFACManagement {
public partial class Import {
namespace Swift.web.Remit.OFACManagement
{
public partial class Import
{
/// <summary> /// <summary>
/// Head1 control. /// Head1 control.
/// </summary> /// </summary>
@ -20,7 +22,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlHead Head1; protected global::System.Web.UI.HtmlControls.HtmlHead Head1;
/// <summary> /// <summary>
/// form1 control. /// form1 control.
/// </summary> /// </summary>
@ -29,7 +31,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1; protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary> /// <summary>
/// ScriptManger1 control. /// ScriptManger1 control.
/// </summary> /// </summary>
@ -38,7 +40,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.ScriptManager ScriptManger1; protected global::System.Web.UI.ScriptManager ScriptManger1;
/// <summary> /// <summary>
/// updProgress control. /// updProgress control.
/// </summary> /// </summary>
@ -47,16 +49,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.UpdateProgress updProgress; protected global::System.Web.UI.UpdateProgress updProgress;
/// <summary>
/// upd1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel upd1;
/// <summary> /// <summary>
/// btnImport control. /// btnImport control.
/// </summary> /// </summary>
@ -65,7 +58,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnImport; protected global::System.Web.UI.WebControls.Button btnImport;
/// <summary> /// <summary>
/// btnLoadOfac control. /// btnLoadOfac control.
/// </summary> /// </summary>
@ -74,7 +67,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnLoadOfac; protected global::System.Web.UI.WebControls.Button btnLoadOfac;
/// <summary> /// <summary>
/// BtnImpAQList control. /// BtnImpAQList control.
/// </summary> /// </summary>
@ -83,7 +76,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button BtnImpAQList; protected global::System.Web.UI.WebControls.Button BtnImpAQList;
/// <summary> /// <summary>
/// btnUpload control. /// btnUpload control.
/// </summary> /// </summary>
@ -92,7 +85,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnUpload; protected global::System.Web.UI.WebControls.Button btnUpload;
/// <summary> /// <summary>
/// Button1 control. /// Button1 control.
/// </summary> /// </summary>
@ -101,7 +94,43 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button Button1; protected global::System.Web.UI.WebControls.Button Button1;
/// <summary>
/// uploadDiv control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl uploadDiv;
/// <summary>
/// fileUpload control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.FileUpload fileUpload;
/// <summary>
/// FileUploadValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator FileUploadValidator;
/// <summary>
/// btnFileUpload control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnFileUpload;
/// <summary> /// <summary>
/// SourceWiseData control. /// SourceWiseData control.
/// </summary> /// </summary>
@ -110,7 +139,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl SourceWiseData; protected global::System.Web.UI.HtmlControls.HtmlGenericControl SourceWiseData;
/// <summary> /// <summary>
/// DivMessage control. /// DivMessage control.
/// </summary> /// </summary>
@ -119,7 +148,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl DivMessage; protected global::System.Web.UI.HtmlControls.HtmlGenericControl DivMessage;
/// <summary> /// <summary>
/// rpt_grid control. /// rpt_grid control.
/// </summary> /// </summary>
@ -128,7 +157,7 @@ namespace Swift.web.Remit.OFACManagement {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl rpt_grid; protected global::System.Web.UI.HtmlControls.HtmlGenericControl rpt_grid;
/// <summary> /// <summary>
/// rpt_AQgrid control. /// rpt_AQgrid control.
/// </summary> /// </summary>

Loading…
Cancel
Save