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.
 
 
 
 
 

86 lines
3.0 KiB

using Swift.API.Common.SyncModel;
using Swift.API.Common.SyncModel.Bank;
using Swift.API.ThirdPartyApiServices;
using Swift.DAL.BL.Helper.ThirdParty;
using Swift.DAL.Remittance.SyncDao;
using Swift.DAL.SwiftDAL;
using Swift.web.Library;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Swift.web.Remit.TPSetup.PopUps
{
public partial class PopUpForBank : System.Web.UI.Page
{
private readonly RemittanceLibrary sl = new RemittanceLibrary();
protected void Page_Load(object sender, EventArgs e)
{
Authenticate();
if (!IsPostBack)
{
PopulateDDL();
}
}
private void PopulateDDL()
{
sl.SetDDL(ref ddlApiPartner, "EXEC [PROC_API_BANK_BRANCH_SETUP] @flag = 'API-PARTNER',@user='" + GetStatic.GetUser() + "'", "value", "text", "", "Select..");
sl.SetDDL(ref ddlcountryName, "EXEC [PROC_API_BANK_BRANCH_SETUP] @flag = 'countryList',@user='" + GetStatic.GetUser() + "'", "value", "text", "", "Select..");
}
private void Authenticate()
{
sl.CheckSession();
}
protected void btnDownload_Click(object sender, EventArgs e)
{
BankRequest requestObj = new BankRequest()
{
CountryCode = ddlcountryName.SelectedValue,
ProviderId = ddlApiPartner.SelectedValue,
SessionId = GetStatic.GetSessionId(),
QueryType = ddlApiPartner.SelectedValue.Equals("394414") ? 4 : 0
};
if(ddlApiPartner.SelectedValue.Equals("394414") && chkBox.Checked)
{
requestObj.QueryType = 4;
requestObj.PaymentMethod = "NBSP";
}
SyncBankAndBranchService serviceObj = new SyncBankAndBranchService();
var response = serviceObj.GetBankList(requestObj);
if (response.ResponseCode == "0")
{
BankBranchDao _dao = new BankBranchDao();
var responseData = response.Data;
var xml = ApiUtility.ObjectToXML(responseData);
DbResult res = _dao.SyncBank(GetStatic.GetUser(), xml, ddlcountryName.SelectedItem.ToString(), ddlApiPartner.SelectedValue);
if (res.ErrorCode == "0")
{
GetStatic.AlertMessage(this, res.Msg);
GetStatic.CallBackJs1(Page, "Call Back", "CallBack('" + res + "');");
}
else
{
GetStatic.AlertMessage(this, "Bank Sycn Failed!!!!");
}
}
}
protected void ddlcountryName_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlApiPartner.SelectedValue.Equals("394414"))
chkBox.Visible = true;
else
chkBox.Visible = false;
}
}
}