Browse Source

#26975 Export all

#25998 low txn report
Ime-london-webcore
Leeza Baidar 7 months ago
parent
commit
9dd1498a8b
  1. 23
      Swift.DAL/Remittance/Transaction/TranAgentReportDao.cs
  2. 83
      Swift.web/Download.aspx.cs
  3. 3
      Swift.web/Remit/Administration/CustomerSetup/List.aspx.cs
  4. 2
      Swift.web/RemittanceSystem/RemittanceReports/DynamicReport/DynamicReportView.aspx
  5. 7
      Swift.web/RemittanceSystem/RemittanceReports/DynamicReport/DynamicReportView.aspx.cs
  6. 2
      Swift.web/RemittanceSystem/RemittanceReports/NewCustomerRegistrationReport/CustomreRegistrationReport.aspx
  7. 31
      Swift.web/RemittanceSystem/RemittanceReports/ReportDownload.cs
  8. 18
      Swift.web/RemittanceSystem/RemittanceReports/Reports.aspx.cs
  9. 9
      Swift.web/js/swift_grid.js

23
Swift.DAL/Remittance/Transaction/TranAgentReportDao.cs

@ -356,13 +356,28 @@ namespace Swift.DAL.BL.Remit.Transaction
sql += ",@isOnlineTxn=" + FilterString(isOnlineTxn);
return ParseReportResult(sql);
}
public ReportResult GetNewRegistrationReport(string user, string flag, string fromDate)
public ReportResult GetNewRegistrationReport(string user, string flag, string fromDate, string toDate, string agentId, string branchId, string withAgent)
{
var sql = "proc_low_txn_report ";
var sql = "PROC_REGISTRATION_REPORT ";
sql += "@flag =" + FilterString(flag); ;
sql += ",@user=" + FilterString(user);
sql += ",@fromDate=" + FilterString(fromDate);
sql += ",@FROM_DATE=" + FilterString(fromDate);
sql += ",@TO_DATE=" + FilterString(toDate);
sql += ",@agentId=" + FilterString(agentId);
sql += ",@branchId=" + FilterString(branchId);
sql += ",@withAgent=" + FilterString(withAgent);
return ParseReportResult(sql);
}
public ReportResult GetCustomerRegistrationReport(string user, string flag, string fromDate, string toDate)
{
var sql = "PROC_REGISTRATION_REPORT ";
sql += "@flag =" + FilterString(flag); ;
sql += ",@user=" + FilterString(user);
sql += ",@FROM_DATE=" + FilterString(fromDate);
sql += ",@TO_DATE=" + FilterString(toDate);
return ParseReportResult(sql);
}

83
Swift.web/Download.aspx.cs

@ -34,7 +34,10 @@ namespace Swift.web
{
data = GenerateCsvForReport();
}
else if (mode.ToLower() == "download")
{
data = GenerateCsv();
}
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
@ -160,5 +163,81 @@ namespace Swift.web
return html.ToString();
}
private string GenerateCsv()
{
var sql = GetStatic.ReadSession("exportSource", "");
sql = sql.Split(',')[0].Split('=')[0] + "='download'";
if (string.IsNullOrEmpty(sql))
return "";
var type = GetStatic.ReadQueryString("type", "").ToLower();
var ds = new DataSet();
if (type == "remit")
{
ds = remit.ExecuteDataset(sql);
}
else
{
ds = dao.ExecuteDataset(sql);
}
var columnList = (List<GridColumn>)Session["grid_column"];
if (ds == null || columnList == null)
return "";
var dt = ds.Tables[0];
//var html = new StringBuilder("<table width=\"700\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" >");
var html = new StringBuilder("<table width=\"100%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse;\">");
html.Append("<tr>");
foreach (var column in columnList)
{
if (column.Description != "")
//html.Append("<th Class=\"HeaderStyle\" align=\"left\" nowrap " + ">" + column.Description + "</th>");
html.Append("<th style=\"border: 1px solid black;\">" + column.Description + "</th>"); // Added border style
}
html.Append("</tr>");
foreach (DataRow dr in dt.Rows)
{
html.Append("<tr>");
foreach (var column in columnList)
{
switch (column.Type.ToUpper())
{
case "M":
html.Append("<td align=\"right\" style=\"border: 1px solid black;\">" + SwiftGrid.FormatData(dr[column.Key].ToString(), "M") + "</td>"); // Added border style
break;
case "D":
html.Append("<td align=\"center\" style=\"border: 1px solid black;\">" + SwiftGrid.FormatData(dr[column.Key].ToString(), "D") + "</td>"); // Added border style
break;
case "DT":
html.Append("<td align=\"center\" style=\"border: 1px solid black;\">" + SwiftGrid.FormatData(dr[column.Key].ToString(), "DT") + "</td>"); // Added border style
break;
case "NOSORT":
if (column.Description.Trim() != "")
html.Append("<td align=\"left\" nowrap style=\"border: 1px solid black;\">" + dr[column.Key] + "</td>"); // Added border style
break;
case "CHECKBOX":
break;
default:
html.Append("<td align=\"left\" style=\"border: 1px solid black;\">" + dr[column.Key] + "</td>"); // Added border style
break;
}
}
html.Append("</tr>");
}
html.Append("</table>");
return html.ToString();
}
}
}
}

3
Swift.web/Remit/Administration/CustomerSetup/List.aspx.cs

@ -74,7 +74,7 @@ namespace Swift.web.Remit.Administration.customerSetup
new GridColumn("idNumber", "ID No", "", "T"),
new GridColumn("KYC_Status","KYC Status","","T"),
new GridColumn("createdDate","Regd. Date","","D"),
new GridColumn("Introducer","Introducer","","T"),
//new GridColumn("Introducer","Introducer","","T"),
//new GridColumn("bankName","Bank Name","","T") ,
//new GridColumn("bankAccountNo","Account Number","","T")
};
@ -94,6 +94,7 @@ namespace Swift.web.Remit.Administration.customerSetup
_grid.GridMinWidth = 700;
_grid.GridWidth = 100;
_grid.IsGridWidthInPercent = true;
_grid.DownloadAll = true;
_grid.AddPage = "/Remit/Administration/CustomerRegistration/Manage.aspx?isCallFromList=true";
_grid.AllowCustomLink = true;

2
Swift.web/RemittanceSystem/RemittanceReports/DynamicReport/DynamicReportView.aspx

@ -79,7 +79,7 @@
<hr id="h3" runat="server" />
<div runat="server" id="exportDiv" class="noprint">
<img alt="Print" title="Print" style="cursor: pointer;" onclick=" javascript:ReportPrint(); " src="../../../Images/printer.png" border="0" />&nbsp;&nbsp;&nbsp;
<img alt="Export to Excel" title="Export to Excel" style="cursor: pointer" onclick="test();" src="../../../Images/excel.gif" border="0" />
<img alt="Export to Excel" title="Export to Excel" style="cursor: pointer" onclick=" javascript:downloadInNewWindow('<% =Request.Url.AbsoluteUri + "&mode=download"%>');" src="../../../Images/excel.gif" border="0" />
</div>
</div>
<div class="form-group" style="overflow: auto;">

7
Swift.web/RemittanceSystem/RemittanceReports/DynamicReport/DynamicReportView.aspx.cs

@ -152,8 +152,13 @@ namespace Swift.web.RemittanceSystem.RemittanceReports.DynamicReport
private ReportResult PrepareCustomerRegistrationReport()
{
string fromDate = GetStatic.ReadQueryString("from", "");
string toDate = GetStatic.ReadQueryString("to", "");
string sAgent = GetStatic.ReadQueryString("sAgent", "");
string sBranch = GetStatic.ReadQueryString("sBranch", "");
string withAgent = GetStatic.ReadQueryString("withAgent", "");
mergeColumnHead = true;
return (new TranAgentReportDao().GetNewRegistrationReport(GetStatic.GetUser(), "customer", fromDate, toDate, sAgent, sBranch, withAgent));
return (new TranAgentReportDao().GetNewRegistrationReport(GetStatic.GetUser(), "txn-report", fromDate));
}
private ReportResult PrepareLowTxnReport()
{

2
Swift.web/RemittanceSystem/RemittanceReports/NewCustomerRegistrationReport/CustomreRegistrationReport.aspx

@ -21,7 +21,7 @@
<link href="/ui/css/style.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.min.js" type="text/javascript"></script>
<script src="/js/functions.js" type="text/javascript"></script>
<script src="../../../../../js/swift_calendar.js"></script>
<script src="../../../AgentNew/js/swift_calender.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
//ShowCalFromToUpToToday("#from", "#to");

31
Swift.web/RemittanceSystem/RemittanceReports/ReportDownload.cs

@ -40,6 +40,9 @@ namespace Swift.web.RemittanceSystem.RemittanceReports
case "customerregistration":
path = PrepareCustomerRegistrationReport();
break;
//case "lowTxnReport":
// path = PrepareLowTxnReport();
// break;
}
return path;
@ -51,16 +54,34 @@ namespace Swift.web.RemittanceSystem.RemittanceReports
this.fieldFormatExcel = "T|T|T|T|T|T|T|D|D|T|T|T|D|T|T|D|T|T|T|T|T|T|T";
string fromDate = GetStatic.ReadQueryString("from", "");
//string toDate = GetStatic.ReadQueryString("to", "");
//string sAgent = GetStatic.ReadQueryString("sAgent", "");
//string sBranch = GetStatic.ReadQueryString("sBranch", "");
//string withAgent = GetStatic.ReadQueryString("withAgent", "");
DataSet dataset = (new TranAgentReportDao().GetNewRegistrationReport(GetStatic.GetUser(), "txn-report", fromDate)).Result;
string toDate = GetStatic.ReadQueryString("to", "");
string sAgent = GetStatic.ReadQueryString("sAgent", "");
string sBranch = GetStatic.ReadQueryString("sBranch", "");
string withAgent = GetStatic.ReadQueryString("withAgent", "");
DataSet dataset = (new TranAgentReportDao().GetNewRegistrationReport(GetStatic.GetUser(), "customer", fromDate, toDate, sAgent, sBranch, withAgent)).Result;
this.TotalColumns = dataset.Tables[0].Columns.Count;
this.TotalRows = dataset.Tables[0].Rows.Count;
return DataSetToExcelNew(dataset, "CustomerRegistration");
}
//public string PrepareLowTxnReport()
//{
// this.UserDefinedHeader = false;
// this.ShowTableFilter = false;
// this.fieldFormatExcel = "T|T|T|T|T|T|T|D|D|T|T|T|D|T|T|D|T|T|T|T|T|T|T";
// string fromDate = GetStatic.ReadQueryString("from", "");
// //string toDate = GetStatic.ReadQueryString("to", "");
// //string sAgent = GetStatic.ReadQueryString("sAgent", "");
// //string sBranch = GetStatic.ReadQueryString("sBranch", "");
// //string withAgent = GetStatic.ReadQueryString("withAgent", "");
// DataSet dataset = (new TranAgentReportDao().GetLowTxnReport(GetStatic.GetUser(), "txn-report", fromDate)).Result;
// this.TotalColumns = dataset.Tables[0].Columns.Count;
// this.TotalRows = dataset.Tables[0].Rows.Count;
// return DataSetToExcelNew(dataset, "CustomerRegistration");
//}
public string PrepareCustomerAndTxnList()
{
this.UserDefinedHeader = false;

18
Swift.web/RemittanceSystem/RemittanceReports/Reports.aspx.cs

@ -749,10 +749,10 @@ namespace Swift.web.RemittanceSystem.RemittanceReports
private ReportResult PrepareBeneficaryRegistrationReport()
{
string fromDate = GetStatic.ReadQueryString("from", "");
//string toDate = GetStatic.ReadQueryString("to", "");
//string sAgent = GetStatic.ReadQueryString("sAgent", "");
//string sBranch = GetStatic.ReadQueryString("sBranch", "");
return (new TranAgentReportDao().GetNewRegistrationReport(GetStatic.GetUser(), "txn-report", fromDate));
string toDate = GetStatic.ReadQueryString("to", "");
string sAgent = GetStatic.ReadQueryString("sAgent", "");
string sBranch = GetStatic.ReadQueryString("sBranch", "");
return (new TranAgentReportDao().GetNewRegistrationReport(GetStatic.GetUser(), "beneficiary", fromDate, toDate, sAgent, sBranch, ""));
}
private ReportResult PreparDisabledCustomersReport()
@ -765,12 +765,12 @@ namespace Swift.web.RemittanceSystem.RemittanceReports
private ReportResult PrepareCustomerRegistrationReport()
{
string fromDate = GetStatic.ReadQueryString("from", "");
//string toDate = GetStatic.ReadQueryString("to", "");
//string sAgent = GetStatic.ReadQueryString("sAgent", "");
//string sBranch = GetStatic.ReadQueryString("sBranch", "");
//string withAgent = GetStatic.ReadQueryString("withAgent", "");
string toDate = GetStatic.ReadQueryString("to", "");
string sAgent = GetStatic.ReadQueryString("sAgent", "");
string sBranch = GetStatic.ReadQueryString("sBranch", "");
string withAgent = GetStatic.ReadQueryString("withAgent", "");
mergeColumnHead = true;
return (new TranAgentReportDao().GetNewRegistrationReport(GetStatic.GetUser(), "txn-report", fromDate));
return (new TranAgentReportDao().GetNewRegistrationReport(GetStatic.GetUser(), "customer", fromDate, toDate, sAgent, sBranch, withAgent));
}
private ReportResult PrepareMobileRegistrationReport()
{

9
Swift.web/js/swift_grid.js

@ -361,4 +361,13 @@ function FindPos(obj) {
return [curleft, curtop];
}
function DownloadExcelRemit(path) {
url = path + "/Download.aspx?mode=download&type=remit";
window.open(url, "", "width=825,height=500,resizable=1,status=1,toolbar=0,scrollbars=1,center=1");
}
function DownloadExcel(path) {
url = path + "/Download.aspx?mode=download";
window.open(url, "", "width=825,height=500,resizable=1,status=1,toolbar=0,scrollbars=1,center=1");
}
//GRID FILTER ENDS
Loading…
Cancel
Save