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.
 
 
 
 
 

101 lines
3.5 KiB

using System;
using System.Collections.Generic;
using System.Data;
using Swift.DAL.BL.Remit.Transaction;
using Swift.DAL.SwiftDAL;
using Swift.web.Component.Grid;
using Swift.web.Component.Grid.gridHelper;
using Swift.web.Library;
namespace Swift.web.Remit.Transaction.Reports
{
public partial class SearchTransaction : System.Web.UI.Page
{
private readonly RemittanceLibrary obj = new RemittanceLibrary();
private readonly TranViewDao tran = new TranViewDao();
private const string ViewFunctionId = "20121800";
private readonly SwiftGrid _grid = new SwiftGrid();
protected void Page_Load(object sender, EventArgs e)
{
var methodName = Request.Form["MethodName"];
Authenticate();
if (!IsPostBack)
{
controlNoName.Text = GetStatic.GetTranNoName();
string txnId = GetStatic.ReadQueryString("tranId", "");
string cntNo = GetStatic.ReadQueryString("controlNo", "");
if (!string.IsNullOrEmpty(txnId) || !string.IsNullOrEmpty(cntNo))
{
ShowTxnDetail(txnId, cntNo);
}
if (methodName == "update-questionaire")
{
UpdateQuestionaire();
}
}
GetStatic.ResizeFrame(Page);
GetStatic.Process(ref btnSearch);
Misc.MakeNumericTextbox(ref txnNo, true);
}
private void Authenticate()
{
obj.CheckAuthentication(ViewFunctionId);
}
protected void btnSearch_Click(object sender, EventArgs e)
{
searchTxnDiv.Visible = false;
ShowTxnDetail(txnNo.Text, controlNo.Text);
}
protected bool ShowCommentFlag()
{
return GetStatic.ReadQueryString("commentFlag", "Y") != "N";
}
protected bool ShowBankDetail()
{
return (GetStatic.ReadQueryString("showBankDetail", "N") == "Y");
}
protected bool ShowApproveButton()
{
return (GetStatic.ReadQueryString("showApproveButton", "N") == "Y");
}
private void ShowTxnDetail(string txnId, string cntNo)
{
if (string.IsNullOrEmpty(txnId) && string.IsNullOrEmpty(cntNo))
{
GetStatic.AlertMessage(Page, "Sorry, Invalid Input.");
return;
}
ucTran.SearchData(txnId, cntNo, "", "", "SEARCH", "ADM: VIEW TXN (SEARCH TRANSACTION)");
ucTran.ShowCommentBlock = ShowCommentFlag();
ucTran.ShowBankDetail = ShowBankDetail();
ucTran.ShowOfac = true;
ucTran.ShowCompliance = true;
ucTran.ShowApproveButton = ShowApproveButton();
ucTran.ShowCompliance = true;
ucTran.ShowCommentBlock = ShowCommentFlag();
ucTran.ShowBankDetail = ShowBankDetail();
ucTran.ShowComplianceList();
ucTran.ShowOFACList();
if (!ucTran.TranFound)
{
GetStatic.AlertMessage(Page, "Sorry, Transaction Not Found.");
return;
}
divTranDetails.Visible = ucTran.TranFound;
divControlno.Visible = !ucTran.TranFound;
}
private DbResult UpdateQuestionaire ()
{
var rowId = Request.Form["rowId"];
var newAnswer = Request.Form["newValue"];
DbResult _dbRes = tran.UpdateQuestionaire(GetStatic.GetUser(), rowId, newAnswer);
return _dbRes;
}
}
}