Browse Source

#26613 delete function

Ime-london-webcore
Dinesh 6 months ago
parent
commit
f529514a87
  1. 42
      Swift.DAL/Remittance/Transaction/UpdateBranchDao.cs
  2. 23
      Swift.web/Remit/TPSetup/BankAndBranchSetup/BankList.aspx.cs
  3. 24
      Swift.web/Remit/TPSetup/BankAndBranchSetup/ListBranch.aspx.cs
  4. 23
      Swift.web/Remit/TPSetup/BankAndBranchSetup/NewBankList.aspx.cs

42
Swift.DAL/Remittance/Transaction/UpdateBranchDao.cs

@ -253,11 +253,45 @@ namespace Swift.DAL.Remittance.Transaction
return ParseDbResult(sql);
}
public DbResult Delete(string user, string rowId)
//public DbResult Delete(string user, string rowId)
//{
// var sql = "EXEC PROC_REFERALSETUP @flag = 'delete'";
// sql += ", @user = " + FilterString(user);
// sql += ", @rowId = " + FilterString(rowId);
// return ParseDbResult(sql);
//}
//public DbResult Delete(string acct_id, string user)
//{
// string sql = "EXEC PROC_API_BANK_BRANCH_SETUP";
// sql += " @flag ='delete'";
// sql += ", @bankId" + FilterString(acct_id);
// sql += ", @user=" + FilterString(user);
// return ParseDbResult(ExecuteDataset(sql).Tables[0]);
//}
public DbResult DeleteBankMapping(string bankId, string user)
{
var sql = "EXEC PROC_REFERALSETUP @flag = 'delete'";
sql += ", @user = " + FilterString(user);
sql += ", @rowId = " + FilterString(rowId);
string sql = "EXEC Proc_UpdateBranchCode";
sql += " @flag ='deleteBankMapping'";
sql += ",@bankId =" + FilterString(bankId);
sql += ",@user =" + FilterString(user);
return ParseDbResult(sql);
}
public DbResult DeleteBank(string bankId, string user)
{
string sql = "EXEC Proc_UpdateBranchCode";
sql += " @flag ='deleteBank'";
sql += ",@bankId =" + FilterString(bankId);
sql += ",@user =" + FilterString(user);
return ParseDbResult(sql);
}
public DbResult DeleteBranch(string branchId, string user)
{
string sql = "EXEC Proc_UpdateBranchCode";
sql += " @flag ='deleteBranch'";
sql += ",@bankId =" + FilterString(branchId);
sql += ",@user =" + FilterString(user);
return ParseDbResult(sql);
}

23
Swift.web/Remit/TPSetup/BankAndBranchSetup/BankList.aspx.cs

@ -1,9 +1,11 @@
using Swift.DAL.Remittance.SyncDao;
using Swift.DAL.Remittance.Transaction;
using Swift.web.Component.Grid;
using Swift.web.Component.Grid.gridHelper;
using Swift.web.Library;
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
namespace Swift.web.Remit.TPSetup.BankAndBranchSetup
@ -15,6 +17,7 @@ namespace Swift.web.Remit.TPSetup.BankAndBranchSetup
private const string AddEditFunctionId = "20300010";
private readonly SwiftGrid _grid = new SwiftGrid();
private readonly RemittanceLibrary swiftLibrary = new RemittanceLibrary();
private readonly UpdateBranchDao _branchDoa = new UpdateBranchDao();
protected void Page_Load(object sender, EventArgs e)
{
@ -24,6 +27,7 @@ namespace Swift.web.Remit.TPSetup.BankAndBranchSetup
GetStatic.PrintMessage(Page);
}
LoadGrid();
DeleteRow();
}
private void Authenticate()
@ -87,6 +91,25 @@ namespace Swift.web.Remit.TPSetup.BankAndBranchSetup
rpt_grid.InnerHtml = _grid.CreateGrid(sql);
}
private void DeleteRow()
{
string id = _grid.GetCurrentRowId(GridName);
if (id == "")
return;
var user = GetStatic.GetUser();
var dbResult = _branchDoa.DeleteBankMapping(id, user);
if (dbResult.ErrorCode == "0")
{
LoadGrid();
GetStatic.AlertMessage(this, dbResult.Msg);
}
else
{
HttpContext.Current.Session["message"] = dbResult;
GetStatic.AlertMessage(this, dbResult.Msg);
}
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
BankBranchDao _dao = new BankBranchDao();

24
Swift.web/Remit/TPSetup/BankAndBranchSetup/ListBranch.aspx.cs

@ -31,6 +31,7 @@ namespace Swift.web.Remit.TPSetup.BankAndBranchSetup
}
LoadGrid();
DeleteRow();
}
private void Authenticate()
{
@ -89,12 +90,33 @@ namespace Swift.web.Remit.TPSetup.BankAndBranchSetup
rpt_grid.InnerHtml = _grid.CreateGrid(sql);
}
private void DeleteRow()
{
string id = _grid.GetCurrentRowId(GridName);
if (id == "")
return;
var user = GetStatic.GetUser();
var dbResult = _branchDoa.DeleteBranch(id, user);
if (dbResult.ErrorCode == "0")
{
LoadGrid();
GetStatic.AlertMessage(this, dbResult.Msg);
}
else
{
HttpContext.Current.Session["message"] = dbResult;
GetStatic.AlertMessage(this, dbResult.Msg);
}
}
private string GetBankId()
{
return GetStatic.ReadQueryString("bankId", "");
}
protected void btnUpdate_Click(object sender, EventArgs e)
{

23
Swift.web/Remit/TPSetup/BankAndBranchSetup/NewBankList.aspx.cs

@ -18,6 +18,7 @@ namespace Swift.web.Remit.TPSetup.BankAndBranchSetup
private const string AddEditFunctionId = "20300010";
private readonly SwiftGrid _grid = new SwiftGrid();
private readonly RemittanceLibrary swiftLibrary = new RemittanceLibrary();
private readonly UpdateBranchDao _branchDoa = new UpdateBranchDao();
protected void Page_Load(object sender, EventArgs e)
{
Authenticate();
@ -26,6 +27,7 @@ namespace Swift.web.Remit.TPSetup.BankAndBranchSetup
GetStatic.PrintMessage(Page);
}
LoadGrid();
DeleteRow();
}
private void Authenticate()
@ -84,6 +86,27 @@ namespace Swift.web.Remit.TPSetup.BankAndBranchSetup
rpt_grid.InnerHtml = _grid.CreateGrid(sql);
}
private void DeleteRow()
{
string id = _grid.GetCurrentRowId(GridName);
if (id == "")
return;
var user = GetStatic.GetUser();
var dbResult = _branchDoa.DeleteBank(id, user);
if (dbResult.ErrorCode == "0")
{
LoadGrid();
GetStatic.AlertMessage(this, dbResult.Msg);
}
else
{
HttpContext.Current.Session["message"] = dbResult;
GetStatic.AlertMessage(this, dbResult.Msg);
}
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
UpdateBranchDao _dao = new UpdateBranchDao();

Loading…
Cancel
Save