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.
|
|
using Newtonsoft.Json; using Swift.DAL.APIDataMappingDao; using Swift.web.Library; using System; using System.Data; using System.Text; using System.Web.UI.WebControls;
namespace Swift.web.Remit.APIDataMapping.BankDataMapping { public partial class Continue : System.Web.UI.Page { private readonly RemittanceLibrary _sl = new RemittanceLibrary(); protected APIMapping _dao = new APIMapping(); private const string ViewFunctionId = "20201800"; protected void Page_Load(object sender, EventArgs e) { Authenticate(); if (!IsPostBack) { PopulateDDL(); }
string methodName = Request.Form["MethodName"]; switch (methodName) { case "GetMasterBankList": GetMasterBankList(); break; } } private void Authenticate() { _sl.CheckAuthentication(ViewFunctionId); } private void PopulateDDL() { _sl.SetDDL(ref partnerDDL, "PROC_MAP_BANK_DATA @FLAG = 'PARTNER'", "AGENTID", "AGENTNAME", "", "Select Partner"); _sl.SetDDL(ref countryDDL, "PROC_MAP_BANK_DATA @FLAG = 'COUNTRY'", "COUNTRYCODE", "COUNTRYNAME", "", "Select Country"); }
protected void countryDDL_SelectedIndexChanged(object sender, EventArgs e) { PopulatePayoutMode(countryDDL.SelectedValue, ref payoutMethodDDL); }
private void PopulatePayoutMode(string selectedValue, ref DropDownList ddl) { if (string.IsNullOrEmpty(selectedValue)) { ddl.Items.Clear(); return; } string sql = "PROC_MAP_BANK_DATA @flag='PAYOUT-MODE', @COUNTRY_CODE = " + _sl.FilterString(selectedValue); _sl.SetDDL(ref ddl, sql, "serviceTypeId", "typeTitle", selectedValue, "Select Paymet Mode"); }
protected void GetMasterBankList() { DataSet ds = _dao.GetMasterBankList(GetStatic.GetUser()); var result = GenerateTable(ds); Response.ContentType = "text/plain"; Response.Write(JsonConvert.SerializeObject(result).ToString()); Response.End(); }
private string GenerateTable(DataSet result) { var sb = new StringBuilder("");
foreach (DataRow item in result.Tables[0].Rows) { DataRow[] rows = result.Tables[0].Select("BANK_NAME = ('" + item["BANK_NAME"].ToString() + "')"); GetRows(rows, ref sb); }
return sb.ToString(); }
private void GetRows(DataRow[] rows, ref StringBuilder sb) { if (rows.Length == 0 || rows == null) { sb.AppendLine("<tr><td colspan='4' align='center'>No data to Display!</td></tr>"); } foreach (DataRow item in rows) { sb.AppendLine("<tr>"); sb.AppendLine("<td>" + item["SN"].ToString() + "</td>"); sb.AppendLine("<td>" + item["BANK_NAME"].ToString() + "</td>"); sb.AppendLine("</tr>"); } } } }
|