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.
 
 
 
 
 

63 lines
2.2 KiB

using Swift.DAL.Remittance.LawsonDeposits;
using Swift.web.Library;
using System;
namespace Swift.web.MobileRemit.Admin.Operation.LawsonCard
{
public partial class LawsonCard : System.Web.UI.Page
{
private readonly RemittanceLibrary _sl = new RemittanceLibrary();
private readonly StaticDataDdl _sdd = new StaticDataDdl();
private readonly LawsonDepositDao _cd = new LawsonDepositDao();
private const string ViewFunctionId = "42000000";
private const string ApproveFunctionId = "42000010";
protected void Page_Load(object sender, EventArgs e)
{
Authenticate();
if (!IsPostBack)
{
PopulateDDL();
}
}
private void Authenticate()
{
_sl.CheckAuthentication(ViewFunctionId);
}
private void PopulateDDL()
{
var user = GetStatic.GetUser();
_sdd.SetDDL(ref ddlSearchBy, "exec proc_sendPageLoadData @flag='search-cust-by'", "VALUE", "TEXT", "", "");
}
protected void btnAssignLawsonCard_Click(object sender, EventArgs e)
{
var customerId = txtSearchData.Value;
var confimCardNumber = Request.Form["confirmCardNumber"];
var cardNo = Request.Form["cardNumber"];
if(string.IsNullOrEmpty(customerId))
{
GetStatic.AlertMessage(this, "Please select a customer");
}
if(string.IsNullOrEmpty(confimCardNumber))
{
GetStatic.AlertMessage(this, "Please select a customer");
}
var dbResult = _cd.AssignLawsonCard(GetStatic.GetUser(), customerId, cardNo);
if (dbResult.ErrorCode == "0")
{
GetStatic.AlertMessage(this, dbResult.Msg);
txtSearchData.Value = "";
txtSearchData.Text = "";
confirmCardNumber.Text = "";
cardNumber.Text = "";
// Response.Redirect("List.aspx");
GetStatic.CallBackJs1(Page, "Print Message", "Redirect();");
}
else
{
GetStatic.AlertMessage(this, dbResult.Msg);
}
}
}
}