using System; using System.Data; using System.Text; using Swift.DAL.BL.Remit.Transaction; using Swift.DAL.SwiftDAL; using Swift.web.Library; namespace Swift.web.Remit.Transaction.ApproveModification { public partial class ModifyTran : System.Web.UI.Page { readonly StaticDataDdl sd = new StaticDataDdl(); private ModifyTransactionDao dao=new ModifyTransactionDao(); private const string ViewFunctionId = "20122000"; private const string ProcessFunctionId = "20122010"; protected void Page_Load(object sender, EventArgs e) { Authenticate(); LoadByControlNo(GetControlNo()); } protected string GetControlNo() { return GetStatic.ReadQueryString("filterControlNo", ""); } private void Authenticate() { sd.CheckAuthentication(ViewFunctionId ); } private void LoadByControlNo(string cNo) { if (sd.HasRight(ProcessFunctionId)) ucTran.SearchData("", cNo, "u", "N", "MODIFY", "ADM: MODIFY TXN"); else ucTran.SearchData("", cNo, "", "N", "MODIFY", "ADM: MODIFY TXN"); if (!ucTran.TranFound) { PrintMessage("Transaction not found!"); return; } divTranDetails.Visible = ucTran.TranFound; TXNRequestDeatil(); } private void PrintMessage(string msg) { var dbResult=new DbResult {ErrorCode = "1", Msg = msg,Id=""}; ManageMessage(dbResult); } private void ManageMessage(DbResult dbResult) { if (dbResult.ErrorCode != "0") { GetStatic.AlertMessage(Page, dbResult.Msg); return; } Response.Redirect("Summary.aspx?controlNo=" + GetControlNo() + "&email=" + dbResult.Id + "&payStatus="+ucTran.PayStatus); } protected void btnReloadDetail_Click(object sender, EventArgs e) { LoadByControlNo(ucTran.CtrlNo); } private void TXNRequestDeatil() { pnlCompliance.Visible = false; DataTable dt = dao.TXNSelectComment(GetStatic.GetUser(), GetControlNo()); if (dt != null && dt.Rows.Count != 0) { pnlCompliance.Visible = true; dispRequest.Visible = true; StringBuilder sb = new StringBuilder(""); sb.AppendLine("
SN | "); sb.AppendLine("User | "); sb.AppendLine("Date | "); sb.AppendLine("Message - New Modification | "); for (int i = 0; i < dt.Rows.Count; i++) { if (hdTranId.Value == "") hdTranId.Value = dt.Rows[i]["tranId"].ToString(); sb.AppendLine("
---|---|---|---|
" + (i + 1) + " | "); sb.AppendLine("" + dt.Rows[i]["createdBy"] + " | "); sb.AppendLine("" + dt.Rows[i]["createdDate"] + " | "); sb.AppendLine("" + dt.Rows[i]["message"] + " | "); } sb.AppendLine("