/// <summary> /// This function use to Getting the Transaction Grid /// </summary> private void BindTransactionGrid(int bankId) { DataTable dtBankAccId = new DataTable(); //if (bankId == 0) //{ //int i; //dtBankAccId = (DataTable)Session["BankAccId"]; //if (dtBankAccId.Rows.Count > 0) //{ // for (i = 0; i < dtBankAccId.Rows.Count; i++) // { // custBankAccId = Convert.ToInt32(dtBankAccId.Rows[i]["CB_CustBankAccId"].ToString()); // } //} //(Session["BankAccId"]); // custBankAccId = Convert.ToInt32(ViewState["BankId"]); // TransactionList = customerAccountBo.GetCustomerBankTransaction(custBankAccId); //} //else // { TransactionList = customerAccountBo.GetCustomerBankTransaction(bankId, customerVo.CustomerId); // } DataTable dtTransaction = new DataTable(); dtTransaction.Columns.Add("WERPBM_BankCode"); dtTransaction.Columns.Add("WERPBDTM_BankName"); dtTransaction.Columns.Add("CB_AccountNum"); dtTransaction.Columns.Add("CCST_TransactionId"); dtTransaction.Columns.Add("CCST_ExternalTransactionId"); dtTransaction.Columns.Add("CCST_Transactiondate", typeof(DateTime)); dtTransaction.Columns.Add("CCST_Desc"); dtTransaction.Columns.Add("CCST_ChequeNo"); dtTransaction.Columns.Add("CCST_IsWithdrwal"); dtTransaction.Columns.Add("WERP_CFCCode"); dtTransaction.Columns.Add("WERP_CFCName"); dtTransaction.Columns.Add("CCST_Amount"); dtTransaction.Columns.Add("CB_HoldingAmount"); DataRow drTransaction; for (int i = 0; i < TransactionList.Count; i++) { drTransaction = dtTransaction.NewRow(); customeraccountVo = new CustomerAccountsVo(); customeraccountVo = TransactionList[i]; drTransaction["CCST_TransactionId"] = customeraccountVo.TransactionId.ToString(); if (!string.IsNullOrEmpty(customeraccountVo.BankName)) { drTransaction["WERPBM_BankCode"] = customeraccountVo.BankName.ToString(); } if (!string.IsNullOrEmpty(customeraccountVo.WERPBMBankName)) { drTransaction["WERPBDTM_BankName"] = customeraccountVo.WERPBMBankName.ToString(); } if (!string.IsNullOrEmpty(customeraccountVo.BankName)) { drTransaction["CB_AccountNum"] = customeraccountVo.BankAccountNum.ToString(); } if (customeraccountVo.ExternalTransactionId == null) { drTransaction["CCST_ExternalTransactionId"] = "N/A"; } else { drTransaction["CCST_ExternalTransactionId"] = customeraccountVo.ExternalTransactionId.ToString(); } drTransaction["CCST_Transactiondate"] = customeraccountVo.Transactiondate.ToString(); if (customeraccountVo.CCST_Desc == null) { drTransaction["CCST_Desc"] = "N/A"; } else { drTransaction["CCST_Desc"] = customeraccountVo.CCST_Desc.ToString().Trim(); } if (customeraccountVo.ChequeNo == null) { drTransaction["CCST_ChequeNo"] = "N/A"; } else { drTransaction["CCST_ChequeNo"] = customeraccountVo.ChequeNo.ToString().Trim(); } if (customeraccountVo.IsWithdrwal == 0) { drTransaction["CCST_IsWithdrwal"] = "CR"; } else { drTransaction["CCST_IsWithdrwal"] = "DR"; } if (customeraccountVo.CFCCategoryCode == null) { drTransaction["WERP_CFCCode"] = "N/A"; } else { drTransaction["WERP_CFCCode"] = customeraccountVo.CFCCategoryCode.ToString(); } drTransaction["WERP_CFCName"] = customeraccountVo.CFCCategoryName.ToString(); drTransaction["CCST_Amount"] = double.Parse(customeraccountVo.Amount.ToString()); dtTransaction.Rows.Add(drTransaction); } if (TransactionList.Count > 0) { if (Cache["gvCashSavingTransaction" + customerVo.CustomerId] == null) { Cache.Insert("gvCashSavingTransaction" + customerVo.CustomerId, dtTransaction); } else { Cache.Remove("gvCashSavingTransaction" + customerVo.CustomerId); Cache.Insert("gvCashSavingTransaction" + customerVo.CustomerId, dtTransaction); } gvCashSavingTransaction.DataSource = dtTransaction; gvCashSavingTransaction.DataBind(); gvCashSavingTransaction.Visible = true; imgBtnrgHoldings.Visible = true; // BindDDLBankDetails(); } else { gvCashSavingTransaction.DataSource = dtTransaction; gvCashSavingTransaction.DataBind(); gvCashSavingTransaction.Visible = true; imgBtnrgHoldings.Visible = false; } }