protected void Page_Load(object sender, EventArgs e) { if (this.Session["c_app"] != null) { this.c_app = (XObjs.Applicant) this.Session["c_app"]; } if ((this.Session["pwalletID"] != null) && (this.Session["pwalletID"].ToString() != "")) { this.adminID = this.Session["pwalletID"].ToString(); } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } if (this.Session["amt"] != null) { this.amt = this.Session["amt"].ToString(); } if (this.Session["isw_conv_fee"] != null) { this.isw_conv_fee = this.Session["isw_conv_fee"].ToString(); } if (this.Session["total_amt"] != null) { this.total_amt = this.Session["total_amt"].ToString(); } if (this.Session["name"] != null) { this.name = this.Session["name"].ToString(); } if (this.Session["coy_name"] != null) { this.coy_name = this.Session["coy_name"].ToString(); } if (this.Session["Refno"] != null) { this.refno = this.Session["Refno"].ToString(); } if (this.Session["Address"] != null) { this.addy = this.Session["Address"].ToString(); } if (this.Session["item_code"] != null) { this.item_code = this.Session["item_code"].ToString(); } if (this.Session["item_desc"] != null) { this.item_desc = this.Session["item_desc"].ToString(); } this.amt = string.Format("{0:n}", this.amt); this.isw_conv_fee = string.Format("{0:n}", this.isw_conv_fee); if (this.addy.Contains<char>(',')) { this.addy = this.addy.Replace(",", ", "); } }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["c_app"] != null) { this.c_app = (XObjs.Applicant) this.Session["c_app"]; } if ((this.Session["pwalletID"] != null) && (this.Session["pwalletID"].ToString() != "")) { this.adminID = this.Session["pwalletID"].ToString(); } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } this.product_id = ConfigurationManager.AppSettings["pd_product_id"]; this.currency = ConfigurationManager.AppSettings["pd_currency"]; this.site_redirect_url = ConfigurationManager.AppSettings["pd_site_redirect_url"]; this.pay_item_id = ConfigurationManager.AppSettings["pd_pay_item_id"]; this.pd_payment_page = ConfigurationManager.AppSettings["pd_payment_page"]; if (this.Session["Refno"] != null) { this.txn_ref = this.Session["Refno"].ToString(); } if (this.Session["total_amt"] != null) { this.amount = this.Session["total_amt"].ToString(); } if (this.Session["hashString"] != null) { this.hash = this.Session["hashString"].ToString(); } if (this.Session["einao_split_amt"] != null) { // Double amount = Convert.ToDouble(this.Session["einao_split_amt"]) + Convert.ToDouble(this.Session["cld_split_amt"]); this.einao_split_amt = this.Session["einao_split_amt"].ToString(); // this.einao_split_amt = Convert.ToString(amount); } if (this.Session["cld_split_amt"] != null) { this.cld_split_amt = this.Session["cld_split_amt"].ToString(); // this.cld_split_amt = "0"; } if (this.Session["name"] != null) { this.name = this.Session["name"].ToString(); } if (this.Session["coy_name"] != null) { this.coy_name = this.Session["coy_name"].ToString(); } }
protected void btnSearchTransaction_Click(object sender, EventArgs e) { if ((Session["merchant_type"] != null) && (Session["merchant_type"].ToString() != "")) { merchant_type = Session["merchant_type"].ToString(); } string MerchantReference = ""; MerchantReference = txt_trans.Text.Trim(); lt_ri = ret.getChargeBackReportItemByMerchantRefD(MerchantReference); Session["grand_tot_cnt"] = lt_ri.Count; if (lt_ri.Count > 0) { lt_ri[0].isw_amt = Math.Round(Convert.ToDouble(lt_ri[0].isw_amt), 2).ToString(); tm_cnt = lt_ri.Count; Session["tm_cnt"] = tm_cnt; foreach (XObjs.ReportItem item in lt_ri) { if (item.item_code.Contains("T")) { lt_pw = t.getStageByClientIDAcc(item.newtransID); if (lt_pw.Count > 0) { SortedList<string, string> x = c_as.showTmStatus(lt_pw[0].status, lt_pw[0].data_status); status = x["status"]; data_status = x["data_status"]; } } else if (item.item_code.Contains("P")) { lt_pw = t.getPtStageByClientIDAcc(item.newtransID); if (lt_pw.Count > 0) { SortedList<string, string> x = c_as.showPtStatus(lt_pw[0].status, lt_pw[0].data_status); status = x["status"]; data_status = x["data_status"]; } } //else if (item.item_code.Contains("D")) //{ // lt_pw = t.getDsStageByClientIDAcc(item.newtransID); // if (lt_pw.Count > 0) // { //if (lt_pw.Count > 0) //{ // SortedList<string, string> x = c_as.showPtStatus(lt_pw[0].status, lt_pw[0].data_status); // status = x["status"]; // data_status = x["data_status"]; //} // } //} item.total_amt = Convert.ToString((int)(Convert.ToDouble(item.init_amt) + Convert.ToDouble(item.isw_amt))); grand_tot_amt += Convert.ToInt32(item.total_amt); item.office_status = status +" Office"; item.data_status = ""; item.payment_status = ""; item.init_amt = string.Format("{0:n}", Convert.ToInt32(item.init_amt)); item.isw_amt = string.Format("{0:n}", Convert.ToDouble(item.isw_amt)); item.tech_amt = string.Format("{0:n}", Convert.ToInt32(item.tech_amt)); item.total_amt = string.Format("{0:n}", Convert.ToInt32(item.total_amt) + Convert.ToDouble(item.isw_amt)); isw_fields = ret.getISWtransactionByTransactionID(item.transID); twall = ret.getTwalletByTransID(item.transID); isw_fields.TransactionDate = isw_fields.TransactionDate.Substring(0, 11).Trim(); string xgt = twall.xgt; c_app = ret.getApplicantByID(twall.applicantID); } Session["lt_ri"] = lt_ri; gvTm.DataSource = lt_ri; gvTm.DataBind(); new_grand_tot_amt = string.Format("{0:n}", grand_tot_amt); Session["new_grand_tot_amt"] = new_grand_tot_amt; show_details_grid = 0; show_details_grid_wingman = 0; show_inv = 0; } else { show_inv = 1; } }
protected void gvTm_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "TmDetailsClick") { GridViewRow namingContainer = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer; int rowIndex = namingContainer.RowIndex; string transID = e.CommandArgument.ToString(); Session["transID"] = transID; twall = ret.getTwalletByTransID(transID); if (twall.xid != null) { isw_fields = ret.getISWtransactionByTransactionID(transID); isw_fields.TransactionDate = isw_fields.TransactionDate.Substring(0, 11).Trim(); string xgt = twall.xgt; lt_fdets = ret.getFee_detailsByTwalletID(twall.xid); c_app = ret.getApplicantByID(twall.applicantID); Session["c_app"] = c_app; Session["AgentType"] = twall.xmembertype; Session["transID"] = transID; Session["memberID"] = adminID; Session["transDate"] = twall.xreg_date; if (twall.xmembertype == "Agent") { c_reg = ret.getRegistrationByID(twall.xmemberID); fullname = c_reg.Firstname + " " + c_reg.Surname; coy_name = c_reg.CompanyName; cust_id = c_reg.Sys_ID; email = c_reg.Email; mobile = c_reg.PhoneNumber; Session["coy_name"] = coy_name; Session["fullname"] = fullname; Session["email"] = email; Session["mobile"] = mobile; Session["c_addy"] = c_reg.CompanyAddress; } else { c_sub = ret.getSubAgentByID(twall.xmemberID); fullname = c_sub.Firstname + " " + c_sub.Surname; email = c_sub.Email; mobile = c_sub.Telephone; if (c_sub.xid != null) { c_sub_reg = ret.getRegistrationByID(c_sub.RegistrationID); coy_name = c_sub_reg.CompanyName; cust_id = c_sub_reg.Sys_ID + "_" + c_sub.AssignID; } } c_ai.code = cust_id; c_ai.xname = fullname; c_ai.xemail = email; c_ai.xmobile = mobile; Session["c_ai"] = c_ai; if (xgt == "xpay_bk") { Session["payment_type"] = "Bank"; c_banker = ret.getBankerByID(ret.getPwalletByID(twall.xbankerID).xmemberID); Session["bank_xname"] = c_banker.xname; Session["bank_bankname"] = c_banker.bankname; Session["bank_xposition"] = c_banker.xposition; Session["bank_street"] = ret.getAddressByID(c_banker.addressID).street; Session["bank_telephone"] = ret.getAddressByID(c_banker.addressID).telephone1; Session["bank_email"] = ret.getAddressByID(c_banker.addressID).email1; } else if (xgt == "xpay_isw") { Session["payment_type"] = "Online (Inter Switch)"; } else { Session["payment_type"] = "Online"; } show_inv = 1; if (Session["tm_cnt"] != null) { tm_cnt = Convert.ToInt32(Session["tm_cnt"]); } show_details_grid = 1; } } }
public void CreateReportExcel(System.Web.UI.Page pg, List<Classes.XObjs.ReportItem> ri, string filename, string sheetname) { // Create a new workbook var workbook = new HSSFWorkbook(); var sheet = workbook.CreateSheet(sheetname); //Create Header Style var headerLabelCellStyle = workbook.CreateCellStyle(); headerLabelCellStyle.Alignment = HorizontalAlignment.Center; headerLabelCellStyle.BorderBottom = BorderStyle.Thick; headerLabelCellStyle.FillForegroundColor = HSSFColor.SeaGreen.Index; headerLabelCellStyle.FillPattern = FillPattern.SolidForeground; var headerLabelFont = workbook.CreateFont(); headerLabelFont.Boldweight = (short)FontBoldWeight.Normal; headerLabelFont.FontName = "Calibri"; headerLabelFont.Color = HSSFColor.White.Index; headerLabelFont.FontHeightInPoints = Convert.ToInt16(8); headerLabelCellStyle.SetFont(headerLabelFont); //Create Data Style var dataCellStyle = workbook.CreateCellStyle(); dataCellStyle.Alignment = HorizontalAlignment.Center; var dataFont = workbook.CreateFont(); dataFont.Boldweight = (short)FontBoldWeight.Normal; dataFont.FontName = "Calibri"; dataFont.FontHeightInPoints = Convert.ToInt16(8); dataCellStyle.SetFont(dataFont); // Add header labels var rowIndex = 0; var row = sheet.CreateRow(rowIndex); var cell = row.CreateCell(0); cell.SetCellValue("S/N"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(1); cell.SetCellValue("APPLICANT NAME"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(2); cell.SetCellValue("APPLICANT ADDRESS"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(3); cell.SetCellValue("APPLICANT E-MAIL"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(4); cell.SetCellValue("APPLICANT MOBILE"); cell.CellStyle = headerLabelCellStyle; //cell = row.CreateCell(5); cell.SetCellValue("AGENT NAME"); cell.CellStyle = headerLabelCellStyle; //cell = row.CreateCell(6); cell.SetCellValue("AGENT CODE"); cell.CellStyle = headerLabelCellStyle; //cell = row.CreateCell(7); cell.SetCellValue("AGENT E-MAIL"); cell.CellStyle = headerLabelCellStyle; //cell = row.CreateCell(8); cell.SetCellValue("AGENT MOBILE"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(5); cell.SetCellValue("TRANSACTION ID"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(6); cell.SetCellValue("CODE"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(7); cell.SetCellValue("DESCRIPTION"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(8); cell.SetCellValue("PAYMENT DATE"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(9); cell.SetCellValue("PAYMENT MODE"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(10); cell.SetCellValue("PAYMENT STATUS"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(11); cell.SetCellValue("INITIAL AMOUNT (NGN)"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(12); cell.SetCellValue("TECH FEES (NGN)"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(13); cell.SetCellValue("CONVENIENCE FEES(NGN)"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(14); cell.SetCellValue("TOTAL FEES(NGN)"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(15); cell.SetCellValue("CURRENT OFFICE"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(16); cell.SetCellValue("STATUS"); cell.CellStyle = headerLabelCellStyle; cell = row.CreateCell(17); cell.SetCellValue("DATE"); cell.CellStyle = headerLabelCellStyle; rowIndex++; int sn = 1; double g_tot = 0; foreach (XPay.Classes.XObjs.ReportItem r in ri) { double tot = 0; string n_init = r.init_amt.Trim().Replace(",", ""); string n_tech = r.tech_amt.Trim(); string n_isw = r.isw_amt.Trim(); tot = Convert.ToDouble(n_init) + Convert.ToDouble(n_tech) + Convert.ToDouble(n_isw); g_tot = g_tot + tot; c_app = ret.getApplicantByID(r.applicantID); row = sheet.CreateRow(rowIndex); //row.CreateCell(0). cell = row.CreateCell(0); cell.SetCellValue(sn.ToString()); cell.CellStyle = dataCellStyle; cell = row.CreateCell(1); cell.SetCellValue(c_app.xname); cell.CellStyle = dataCellStyle; cell = row.CreateCell(2); cell.SetCellValue(c_app.address); cell.CellStyle = dataCellStyle; cell = row.CreateCell(3); cell.SetCellValue(c_app.xemail); cell.CellStyle = dataCellStyle; cell = row.CreateCell(4); cell.SetCellValue(c_app.xmobile); cell.CellStyle = dataCellStyle; //cell = row.CreateCell(5); cell.SetCellValue(c_ai.xname); cell.CellStyle = dataCellStyle; //cell = row.CreateCell(6); cell.SetCellValue(c_ai.code); cell.CellStyle = dataCellStyle; //cell = row.CreateCell(7); cell.SetCellValue(c_ai.xemail); cell.CellStyle = dataCellStyle; //cell = row.CreateCell(8); cell.SetCellValue(c_ai.xmobile); cell.CellStyle = dataCellStyle; cell = row.CreateCell(5); cell.SetCellValue(r.newtransID); cell.CellStyle = dataCellStyle; cell = row.CreateCell(6); cell.SetCellValue(r.item_code); cell.CellStyle = dataCellStyle; cell = row.CreateCell(7); cell.SetCellValue(r.item_desc); cell.CellStyle = dataCellStyle; cell = row.CreateCell(8); cell.SetCellValue(r.payment_date); cell.CellStyle = dataCellStyle; cell = row.CreateCell(9); cell.SetCellValue(r.payment_mode); cell.CellStyle = dataCellStyle; cell = row.CreateCell(10); cell.SetCellValue(r.payment_status); cell.CellStyle = dataCellStyle; cell = row.CreateCell(11); cell.SetCellValue(r.init_amt); cell.CellStyle = dataCellStyle; cell = row.CreateCell(12); cell.SetCellValue(string.Format("{0:n}", Convert.ToDouble(r.tech_amt))); cell.CellStyle = dataCellStyle; cell = row.CreateCell(13); cell.SetCellValue(string.Format("{0:n}", Convert.ToDouble(r.isw_amt))); cell.CellStyle = dataCellStyle; cell = row.CreateCell(14); cell.SetCellValue(string.Format("{0:n}", Convert.ToDouble(tot))); cell.CellStyle = dataCellStyle; cell = row.CreateCell(15); cell.SetCellValue(r.office_status); cell.CellStyle = dataCellStyle; cell = row.CreateCell(16); cell.SetCellValue(r.data_status); cell.CellStyle = dataCellStyle; cell = row.CreateCell(17); cell.SetCellValue(DateTime.Now.ToString("yyyy-MM-dd")); cell.CellStyle = dataCellStyle; // item.init_amt = string.Format("{0:n}", Convert.ToInt32(item.init_amt)); sn++; rowIndex++; } // Auto-size each column for (var i = 0; i <= 11; i++) { sheet.AutoSizeColumn(i); // Bump up with auto-sized column width to account for bold headers sheet.SetColumnWidth(i, sheet.GetColumnWidth(i) + 1024); } // Add row indicating Grand total... sheet.CreateRow(rowIndex + 1).CreateCell(0).SetCellValue("Grand Total: " + string.Format("{0:n}", Convert.ToDouble(g_tot))); // Add row indicating date/time report was generated... sheet.CreateRow(rowIndex + 3).CreateCell(0).SetCellValue("Report generated on " + DateTime.Now.ToString()); // NPOI Save the Excel spreadsheet to a file on the web server's file system //using (var fileData = new FileStream(filename, FileMode.Create)) //{ // workbook.Write(fileData); //} // NPOI Save the Excel spreadsheet to a MemoryStream and return it to the client using (var exportData = new MemoryStream()) { workbook.Write(exportData); pg.Response.ContentType = "application/vnd.ms-excel"; pg.Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", filename)); pg.Response.Clear(); pg.Response.BinaryWrite(exportData.GetBuffer()); pg.Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["c_app"] != null) { this.c_app = (XObjs.Applicant) this.Session["c_app"]; } if ((this.Session["pwalletID"] != null) && (this.Session["pwalletID"].ToString() != "")) { this.adminID = this.Session["pwalletID"].ToString(); } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } if (base.Request.QueryString["tx"] == null) { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } if (base.Request.QueryString["tx"] != null) { this.transD = base.Request.QueryString["tx"].ToString(); this.Session["tx"] = this.transD; } this.lt_twall = this.ret.getTwalletByMemberID(this.adminID, this.transD, this.Session["AgentType"].ToString()); if (this.lt_twall.Count > 0) { this.Session["lt_twall"] = this.lt_twall; this.lt_fdets = this.ret.getFee_detailsByTwalletID(this.lt_twall[0].xid); if (this.lt_fdets.Count > 0) { this.Session["lt_fdets"] = this.lt_fdets; } if ((this.Session["AgentType"] != null) && (this.Session["AgentType"].ToString() != "")) { this.agentType = this.Session["AgentType"].ToString(); if (this.agentType == "Agent") { if (this.Session["c_reg"] != null) { this.c_reg = (XObjs.Registration) this.Session["c_reg"]; this.fullname = this.c_reg.Firstname + " " + this.c_reg.Surname; this.coy_name = this.c_reg.CompanyName; this.cust_id = this.c_reg.Sys_ID; this.email = this.c_reg.Email; this.mobile = this.c_reg.PhoneNumber; this.Session["fullname"] = this.fullname; this.Session["email"] = this.email; this.Session["mobile"] = this.mobile; this.Session["c_addy"] = this.c_reg.CompanyAddress; } } else { XObjs.Registration registration = new XObjs.Registration(); if (this.Session["c_sub"] != null) { this.c_sub = (XObjs.Subagent) this.Session["c_sub"]; this.fullname = this.c_sub.Firstname + " " + this.c_sub.Surname; this.Session["fullname"] = this.fullname; this.email = this.c_sub.Email; this.Session["email"] = this.email; this.mobile = this.c_sub.Telephone; this.Session["mobile"] = this.mobile; } if (this.Session["c_sub_reg"] != null) { registration = (XObjs.Registration) this.Session["c_sub_reg"]; this.coy_name = registration.CompanyName; this.cust_id = registration.Sys_ID + "_" + this.c_sub.AssignID; this.Session["fullname"] = this.fullname; this.Session["email"] = this.email; this.Session["mobile"] = this.mobile; this.Session["c_addy"] = registration.CompanyAddress; } } } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } }
protected void Page_Load(object sender, EventArgs e) { kkx = null; if ((Session["pwalletID"] != null) && (Session["pwalletID"].ToString() != "")) { adminID = Session["pwalletID"].ToString(); } else { Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } if (Session["fullname"] != null) { fullname = Session["fullname"].ToString(); } if (Session["email"] != null) { email = Session["email"].ToString(); } if (Session["mobile"] != null) { mobile = Session["mobile"].ToString(); } if (Session["cust_id"] != null) { cust_id = Session["cust_id"].ToString(); } xstring = new StringBuilder(); product_id = ConfigurationManager.AppSettings["pd_product_id"]; mackey = ConfigurationManager.AppSettings["pd_mackey"]; check_trans_page = ConfigurationManager.AppSettings["pd_get_trans_json_page"]; if ((Request.Form["txnRef"] != null) && (Request.Form["txnRef"] != "")) { txnref = Request.Form["txnRef"].ToString(); Session["transID"] = txnref; } if ((Request.Form["payRef"] != null) && (Request.Form["payRef"] != "")) { payRef = Request.Form["payRef"].ToString(); } if ((Request.Form["retRef"] != null) && (Request.Form["retRef"] != "")) { retRef = Request.Form["retRef"].ToString(); } if ((Request.Form["cardNum"] != null) && (Request.Form["cardNum"] != "")) { cardNum = Request.Form["cardNum"].ToString(); } if ((Request.Form["apprAmt"] != null) && (Request.Form["apprAmt"] != "")) { apprAmt = Request.Form["apprAmt"].ToString(); } if ((Request.Form["resp"] != null) && (Request.Form["resp"] != "")) { resp = Request.Form["resp"].ToString(); } if ((Request.Form["desc"] != null) && (Request.Form["desc"] != "")) { desc = Request.Form["desc"].ToString(); } if (!IsPostBack) { Session["vitem_code"] = null; c_twall = ret.getTwalletByTransIDAdminID(txnref, adminID); c_app = ret.getApplicantByID(c_twall.applicantID); isw_fields = ret.getISWtransactionByTransactionID(txnref.Trim()); if (c_twall.xid != null) { Session["c_twall"] = c_twall; lt_fdets = ret.getFee_detailsByTwalletID(c_twall.xid); if (lt_fdets.Count > 0) { Session["lt_fdets"] = lt_fdets; } lt_hwall = ret.getHwalletByTransID(txnref); int num = 1; int num2 = 0; XObjs.Registration c_reg2 = (XObjs.Registration)Session["c_reg"]; vid = c_reg2.xid; foreach (XObjs.Hwallet hwallet in lt_hwall) { XObjs.PaymentReciept item = new XObjs.PaymentReciept(); XObjs.Fee_list _list = new XObjs.Fee_list(); XObjs.Fee_details _details = new XObjs.Fee_details(); _details = ret.getFee_detailsByID(hwallet.fee_detailsID); _list = ret.getFee_listByID(_details.fee_listID); item.sn = num.ToString(); item.item_code = _list.item_code; if (item.item_code == "AA1") { Session["vitem_code"] = "AA1"; } item.item_desc = _list.xdesc; item.init_amt = string.Format("{0:n}", Convert.ToInt32(_details.init_amt)); item.tech_amt = string.Format("{0:n}", Convert.ToInt32(_details.tech_amt)); item.qty = string.Format("{0:n}", 1); int num3 = Convert.ToInt32(_details.init_amt) + Convert.ToInt32(_details.tech_amt); item.tot_amount = string.Format("{0:n}", num3); item.transID = hwallet.transID + "-" + hwallet.fee_detailsID + "-" + hwallet.xid; num2 += num3; Session["amt"] = num2; total_amt = string.Format("{0:n}", num2 + Math.Round(Convert.ToDouble(isw_fields.isw_conv_fee), 2)); Session["total_amt"] = total_amt; lt_pr.Add(item); num++; } } xstring.AppendLine("Transaction reference= " + txnref + " Payment reference= " + payRef + " Switching Bank Reference number= " + retRef + " card No= " + cardNum + " apprAmt= " + apprAmt); inputString = product_id.Trim() + txnref.Trim() + mackey.Trim(); string headerValue = hash_value.GetGetSHA512String(inputString); isr = tx.myRedirect(check_trans_page.Trim() + "?productid=" + product_id.Trim() + "&transactionreference=" + txnref.Trim() + "&amount=" + isw_fields.amount.Trim(), "Hash", headerValue.Trim()); if (((isr.ResponseCode != "") && (isr.ResponseCode != null)) && (isr.ResponseCode == "00")) { err_desc = eh.getErrorDesc(isr.ResponseCode); if (((err_desc != "") && (err_desc != null)) && (err_desc != "NA")) { isr.ResponseDescription = err_desc; } xstring.AppendLine("Sent Amount: " + isw_fields.amount + "\r\n Product ID: " + product_id + "\r\n Hash: " + headerValue + "\r\n Amount: " + isr.Amount + "\r\n CardNumber: " + isr.CardNumber + "\r\n MerchantReference: " + isr.MerchantReference + "\r\n PaymentReference: " + isr.PaymentReference + "\r\n RetrievalReferenceNumber: " + isr.RetrievalReferenceNumber + "\r\n LeadBankCbnCode: " + isr.LeadBankCbnCode + "\r\n TransactionDate: " + isr.TransactionDate + "\r\n ResponseCode: " + isr.ResponseCode + "\r\n ResponseDescription: " + isr.ResponseDescription + "\r\n Json Page: " + check_trans_page + "\r\n Form Response: " + resp + "\r\n Form Description: " + desc); if (txnref != "") { if (Directory.Exists(Server.MapPath("~/") + "InterLogs/")) { docpath = Server.MapPath("~/") + "InterLogs/" + txnref + ".txt"; succ = x.WriteToFile(xstring.ToString(), docpath); } } else { if (Directory.Exists(Server.MapPath("~/") + "InterLogs/")) { docpath = Server.MapPath("~/") + "InterLogs/xxx.txt"; succ = x.WriteToFile(xstring.ToString(), docpath); } } succ = reg.updateInterSwitchRecords(txnref, payRef, retRef, isr.ResponseCode, isr.TransactionDate, isr.MerchantReference, isr.ResponseDescription,isr.PaymentReference); if (isr.ResponseCode == "00" && (isr.PaymentReference!=null ||isr.PaymentReference!="") ) { xpay_status = "1"; } else { xpay_status = "3"; } reg.updateTwalletPaymentStatus(txnref.Trim(), xpay_status.Trim()); if (succ != 0) { if (Session["vitem_code"] != null) { vitem_code = Convert.ToString(Session["vitem_code"]); Retriever kp = new Retriever(); // int vmax = kp.getMaxSysId(); // vmax=vmax+1; // String vsys_id = "CLD/RA/0" + vmax; Registration dd = new Registration(); // dd.updateRegistrationSysID(vid, vsys_id); dd.updateRegistrationSysID2(vid, "Paid"); XObjs.Registration ds=kp.getRegistrationByID(vid); sendemail(ds); // Session["cust_id"] = vsys_id; if (Session["cust_id"] != null) { cust_id = Session["cust_id"].ToString(); } } if (Session["onlineid"] != null) { Registration dd = new Registration(); string dpp = Convert.ToString(Session["onlineid"]); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(dpp); dd.updateTransID2(dpp.Trim(), txnref.Trim()); dd.updateHwallet2(txnref.Trim(), "Used"); } if (Session["onlineid2"] != null) { Registration dd = new Registration(); string dpp = Convert.ToString(Session["onlineid2"]); dd.updateTransID3(dpp, txnref.Trim()); dd.updateHwallet2(txnref.Trim(), "Used"); } if (Session["onlineid3"] != null) { Registration dd = new Registration(); xname.Value = "Success"; xname2.Value = Convert.ToString(Session["onlineid3"]); vamount.Value = isr.Amount; vtransactionid.Value = isr.MerchantReference; vtype.Value = "Name"; //Registration dd = new Registration(); //string dpp = Convert.ToString(Session["onlineid2"]); //dd.updateTransID3(dpp, txnref.Trim()); dd.updateHwallet2(txnref.Trim(), "Used"); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(xname2.Value); } if (Session["onlineid4"] != null) { Registration dd = new Registration(); xname.Value = "Success"; xname2.Value = Convert.ToString(Session["onlineid4"]); vamount.Value = isr.Amount; vtransactionid.Value = isr.MerchantReference; vtype.Value = "Address"; dd.updateHwallet2(txnref.Trim(), "Used"); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(xname2.Value); //Registration dd = new Registration(); //string dpp = Convert.ToString(Session["onlineid2"]); //dd.updateTransID3(dpp, txnref.Trim()); } if (Session["onlineid5"] != null) { Registration dd = new Registration(); xname.Value = "Success"; xname2.Value = Convert.ToString(Session["onlineid5"]); vamount.Value = isr.Amount; vtransactionid.Value = isr.MerchantReference; vtype.Value = "Agent"; dd.updateHwallet2(txnref.Trim(), "Used"); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(xname2.Value); //Registration dd = new Registration(); //string dpp = Convert.ToString(Session["onlineid2"]); //dd.updateTransID3(dpp, txnref.Trim()); } if (Session["onlineid6"] != null) { Registration dd = new Registration(); xname.Value = "Success"; xname2.Value = Convert.ToString(Session["onlineid6"]); vamount.Value = isr.Amount; vtransactionid.Value = isr.MerchantReference; vtype.Value = "Rectification"; dd.updateHwallet2(txnref.Trim(), "Used"); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(xname2.Value); //Registration dd = new Registration(); //string dpp = Convert.ToString(Session["onlineid2"]); //dd.updateTransID3(dpp, txnref.Trim()); } if (Session["onlineid7"] != null) { Registration dd = new Registration(); xname.Value = "Success"; xname2.Value = Convert.ToString(Session["onlineid7"]); vamount.Value = isr.Amount; vtransactionid.Value = isr.MerchantReference; vtype.Value = "Assignment"; dd.updateHwallet2(txnref.Trim(), "Used"); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(xname2.Value); //Registration dd = new Registration(); //string dpp = Convert.ToString(Session["onlineid2"]); //dd.updateTransID3(dpp, txnref.Trim()); } if (Session["onlineid8"] != null) { Registration dd = new Registration(); xname.Value = "Success"; xname2.Value = Convert.ToString(Session["onlineid8"]); vamount.Value = isr.Amount; vtransactionid.Value = isr.MerchantReference; vtype.Value = "Assignment2"; dd.updateHwallet2(txnref.Trim(), "Used"); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(xname2.Value); //Registration dd = new Registration(); //string dpp = Convert.ToString(Session["onlineid2"]); //dd.updateTransID3(dpp, txnref.Trim()); } if (Session["onlineid9"] != null) { Registration dd = new Registration(); xname.Value = "Success"; xname2.Value = Convert.ToString(Session["onlineid9"]); vamount.Value = isr.Amount; vtransactionid.Value = isr.MerchantReference; vtype.Value = "Renewal"; dd.updateHwallet2(txnref.Trim(), "Used"); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(xname2.Value); //Registration dd = new Registration(); //string dpp = Convert.ToString(Session["onlineid2"]); //dd.updateTransID3(dpp, txnref.Trim()); } if (Session["onlineid10"] != null) { Registration dd = new Registration(); xname.Value = "Success"; xname2.Value = Convert.ToString(Session["onlineid10"]); vamount.Value = isr.Amount; vtransactionid.Value = isr.MerchantReference; vtype.Value = "TradeMarkAmendment"; dd.updateHwallet2(txnref.Trim(), "Used"); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(xname2.Value); //Registration dd = new Registration(); //string dpp = Convert.ToString(Session["onlineid2"]); //dd.updateTransID3(dpp, txnref.Trim()); } if (Session["onlineid12"] != null) { Registration dd = new Registration(); xname.Value = "Success"; xname2.Value = Convert.ToString(Session["onlineid12"]); vamount.Value = isr.Amount; vtransactionid.Value = isr.MerchantReference; vtype.Value = "RegisteredUser"; dd.updateHwallet2(txnref.Trim(), "Used"); Retriever dp = new Retriever(); kkx = dp.getMarkInfo(xname2.Value); //Registration dd = new Registration(); //string dpp = Convert.ToString(Session["onlineid2"]); //dd.updateTransID3(dpp, txnref.Trim()); } sendAlertHtml(); } } else if (((isr.ResponseCode != "") && (isr.ResponseCode != null)) && (isr.ResponseCode != "00")) { err_desc = eh.getErrorDesc(isr.ResponseCode); if (((err_desc != "") && (err_desc != null)) && (err_desc != "NA")) { isr.ResponseDescription = err_desc; } xstring.AppendLine("Sent Amount: " + isw_fields.amount + "\r\n Product ID: " + product_id + "\r\n Hash: " + headerValue + "\r\n Amount: " + isr.Amount + "\r\n CardNumber: " + isr.CardNumber + "\r\n MerchantReference: " + isr.MerchantReference + "\r\n PaymentReference: " + isr.PaymentReference + "\r\n RetrievalReferenceNumber: " + isr.RetrievalReferenceNumber + "\r\n LeadBankCbnCode: " + isr.LeadBankCbnCode + "\r\n TransactionDate: " + isr.TransactionDate + "\r\n ResponseCode: " + isr.ResponseCode + "\r\n ResponseDescription: " + isr.ResponseDescription + "\r\n Json Page: " + check_trans_page + "\r\n Form Response: " + resp + "\r\n Form Description: " + desc); if (txnref != "") { docpath = Server.MapPath("~/") + "InterLogs/" + txnref + ".txt"; succ = x.WriteToFile(xstring.ToString(), docpath); } else { docpath = Server.MapPath("~/") + "InterLogs/xxx.txt"; succ = x.WriteToFile(xstring.ToString(), docpath); } succ = reg.updateInterSwitchRecords(txnref, payRef, retRef, isr.ResponseCode, isr.TransactionDate, isr.MerchantReference, isr.ResponseDescription,isr.PaymentReference); if (isr.ResponseCode == "00" && (isr.PaymentReference != null || isr.PaymentReference != "")) { xpay_status = "1"; } else { xpay_status = "3"; } reg.updateTwalletPaymentStatus(txnref.Trim(), xpay_status.Trim()); if (succ != 0) { sendUnsuccAlertHtml(); } } else if ((isr.ResponseCode == "") || (isr.ResponseCode == null)) { string str2 = "None"; string str3 = "None"; xstring.AppendLine("Sent Amount: " + isw_fields.amount + "\r\n Product ID: " + product_id + "\r\n Hash: " + headerValue + "\r\n Amount: None\r\n CardNumber: None\r\n MerchantReference: None\r\n PaymentReference: None\r\n RetrievalReferenceNumber: None\r\n LeadBankCbnCode: None\r\n TransactionDate: None\r\n ResponseCode: " + str2 + "\r\n ResponseDescription: " + str3 + "\r\n Json Page: " + check_trans_page + "\r\n Form Response: " + resp + "\r\n Form Description: " + desc); if (txnref != "") { docpath = Server.MapPath("~/") + "InterLogs/" + txnref + ".txt"; succ = x.WriteToFile(xstring.ToString(), docpath); } else { docpath = Server.MapPath("~/") + "InterLogs/xxx.txt"; succ = x.WriteToFile(xstring.ToString(), docpath); } xpay_status = "3"; reg.updateTwalletPaymentStatus(txnref, xpay_status); if (desc == "") { isr.ResponseDescription = "Transaction Pending"; } else { isr.ResponseDescription = desc; } if (resp == "") { isr.ResponseCode = "XXXX"; } else { isr.ResponseCode = resp; } sendUnsuccAlertHtml(); } } }
protected void AddFeeList() { if (Session["c_app"] != null) { c_app = (XObjs.Applicant) Session["c_app"]; } int num = reg.addApplicant(c_app); if ((num > 0) && ((Session["AgentType"] != null) && (Session["AgentType"].ToString() != ""))) { agentType = Session["AgentType"].ToString(); if (agentType == "agent") { agentType = "Agent"; Session["AgentType"] = agentType; } if (agentType == "Agent") { if (Session["c_reg"] != null) { c_reg = (XObjs.Registration) Session["c_reg"]; } fullname = c_reg.Firstname + " " + c_reg.Surname; Session["fullname"] = fullname; email = c_reg.Email; Session["email"] = email; mobile = c_reg.PhoneNumber; Session["mobile"] = mobile; } else { if (Session["c_sub"] != null) { c_sub = (XObjs.Subagent) Session["c_sub"]; } fullname = c_sub.Firstname + " " + c_sub.Surname; Session["fullname"] = fullname; email = c_sub.Email; Session["email"] = email; mobile = c_sub.Telephone; Session["mobile"] = mobile; } scard = ret.getRandomScard(); string vtransid = Generate15UniqueDigits(); ; // lt_twall = ret.getTwalletByMemberID(adminID, scard.xnum, Session["AgentType"].ToString()); lt_twall = ret.getTwalletByMemberID(adminID, vtransid, Session["AgentType"].ToString()); if (lt_twall.Count == 0) { // transID = scard.xnum.ToUpper(); transID = vtransid; int num2 = 0; int num3 = 0; // twall.ref_no = "X" + adminID + "-" + DateTime.Now.ToString("yyyy") + "-" + scard.xnum; twall.ref_no = "X" + adminID + "-" + DateTime.Now.ToString("yyyy") + "-" + transID; ref_no = twall.ref_no; // twall.transID = scard.xnum; twall.transID = transID; twall.xbankerID = "0"; twall.xgt = "xpay"; twall.xmemberID = adminID; twall.xmembertype = Session["AgentType"].ToString(); twall.xpay_status = "2"; twall.applicantID = num.ToString(); twall.xreg_date = xreg_date; twall.xsync = "0"; twall.xvisible = "1"; num2 = reg.addTwallet(twall); if (num2 > 0) { if (Session["SCart"] != null) { lt_cart = (List<XObjs.Shopping_card>) Session["SCart"]; } if (Session["Sl_init"] != null) { sl_init_amt = (SortedList<string, string>) Session["Sl_init"]; } if (Session["Sl_tech"] != null) { sl_tech_amt = (SortedList<string, string>) Session["Sl_tech"]; } int num4 = 0; foreach (XObjs.Shopping_card _card in lt_cart) { f_dets.twalletID = num2.ToString(); f_dets.fee_listID = _card.xid; f_dets.xlogstaff = adminID; f_dets.xqty = _card.qty; f_dets.xused = "0"; f_dets.tot_amt = _card.total_amt.ToString(); xtotal_amt += Convert.ToInt32(_card.total_amt); f_dets.init_amt = sl_init_amt[_card.xid]; f_dets.tech_amt = sl_tech_amt[_card.xid]; f_dets.xreg_date = xreg_date; f_dets.xsync = "0"; f_dets.xvisible = "1"; num3 = reg.addFee_details(f_dets); num4++; for (int i = 0; i < Convert.ToInt32(_card.qty); i++) { int num6 = 0; c_hwall.transID = transID;// scard.xnum; c_hwall.used_status = "Not Used"; c_hwall.product_title = ""; c_hwall.xreg_date = xreg_date; c_hwall.used_date = ""; c_hwall.fee_detailsID = num3.ToString(); num6 = reg.addHwallet(c_hwall); } } if (num4 == lt_cart.Count<XObjs.Shopping_card>()) { // base.Response.Redirect("./m_invoicex.aspx?mx=" + adminID + "&tx=" + scard.xnum); base.Response.Redirect("./m_invoicex.aspx?mx=" + adminID + "&tx=" + transID); } } } else { AddFeeList(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["c_app"] != null) { c_app = (XObjs.Applicant) Session["c_app"]; } if ((Session["pwalletID"] != null) && (Session["pwalletID"].ToString() != "")) { adminID = Session["pwalletID"].ToString(); } else { base.Response.Redirect("../a_login.aspx"); } if (base.Request.QueryString["tx"] == null) { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } if (base.Request.QueryString["tx"] != null) { transD = base.Request.QueryString["tx"].ToString(); Session["tx"] = transD; } lt_twall = ret.getTwalletByMemberID(adminID, transD, Session["AgentType"].ToString()); if (lt_twall.Count > 0) { Session["lt_twall"] = lt_twall; lt_fdets = ret.getFee_detailsByTwalletID(lt_twall[0].xid); if (lt_fdets.Count > 0) { Session["lt_fdets"] = lt_fdets; } if ((Session["AgentType"] != null) && (Session["AgentType"].ToString() != "")) { agentType = Session["AgentType"].ToString(); if (agentType == "Agent") { if (Session["c_reg"] != null) { c_reg = (XObjs.Registration) Session["c_reg"]; fullname = c_reg.Firstname + " " + c_reg.Surname; coy_name = c_reg.CompanyName; cust_id = c_reg.Sys_ID; email = c_reg.Email; mobile = c_reg.PhoneNumber; Session["fullname"] = fullname; Session["email"] = email; Session["mobile"] = mobile; Session["c_addy"] = c_reg.CompanyAddress; } } else { XObjs.Registration registration = new XObjs.Registration(); if (Session["c_sub"] != null) { c_sub = (XObjs.Subagent) Session["c_sub"]; fullname = c_sub.Firstname + " " + c_sub.Surname; Session["fullname"] = fullname; email = c_sub.Email; Session["email"] = email; mobile = c_sub.Telephone; Session["mobile"] = mobile; } if (Session["c_sub_reg"] != null) { registration = (XObjs.Registration) Session["c_sub_reg"]; coy_name = registration.CompanyName; cust_id = registration.Sys_ID + "_" + c_sub.AssignID; Session["fullname"] = fullname; Session["email"] = email; Session["mobile"] = mobile; Session["c_addy"] = registration.CompanyAddress; } } } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["c_app"] != null) { this.c_app = (XObjs.Applicant) this.Session["c_app"]; } if ((this.Session["pwalletID"] != null) && (this.Session["pwalletID"].ToString() != "")) { this.adminID = this.Session["pwalletID"].ToString(); } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } if (this.Session["xispf"] != null) { this.xispf = (XObjs.InterSwitchPostFields) this.Session["xispf"]; } if ((this.Session["AgentType"] != null) && (this.Session["AgentType"].ToString() != "")) { this.agentType = this.Session["AgentType"].ToString(); if (this.agentType == "Agent") { if (this.Session["c_reg"] != null) { this.c_reg = (XObjs.Registration) this.Session["c_reg"]; this.Session["name"] = this.c_reg.Firstname + " " + this.c_reg.Surname; this.Session["coy_name"] = this.c_reg.CompanyName; this.Session["Address"] = this.c_reg.CompanyAddress; } } else { XObjs.Registration registration = new XObjs.Registration(); if (this.Session["c_sub"] != null) { this.c_sub = (XObjs.Subagent) this.Session["c_sub"]; this.Session["name"] = this.c_sub.Firstname + " " + this.c_sub.Surname; } if (this.Session["c_sub_reg"] != null) { registration = (XObjs.Registration) this.Session["c_sub_reg"]; this.Session["coy_name"] = registration.CompanyName; this.Session["Address"] = registration.CompanyAddress; } } } this.twall = this.ret.getTwalletByMemberID(this.adminID, this.xispf.txn_ref, this.agentType); this.lt_fdets = this.ret.getFee_detailsByTwalletID(this.twall[0].xid); int num = 0; int num2 = 0; if (this.lt_fdets.Count > 0) { foreach (XObjs.Fee_details _details in this.lt_fdets) { num += (Convert.ToInt32(_details.init_amt) * Convert.ToInt32(_details.xqty)) * 100; num2 += (Convert.ToInt32(_details.tech_amt) * Convert.ToInt32(_details.xqty)) * 100; } } this.refno = this.xispf.txn_ref; this.isw_conv_fee = Math.Round(Convert.ToDecimal(this.xispf.isw_conv_fee), 2).ToString(); this.total_amt = Convert.ToString(this.xispf.amount); this.amt = Convert.ToString((decimal) ((Convert.ToDecimal(this.total_amt) / 100M) - Convert.ToDecimal(this.isw_conv_fee))); this.name = this.Session["name"].ToString(); this.coy_name = this.Session["coy_name"].ToString(); this.addy = this.Session["Address"].ToString(); this.amt = string.Format("{0:n}", this.amt); this.isw_conv_fee = string.Format("{0:n}", this.isw_conv_fee); this.Session["amt"] = this.amt; this.Session["isw_conv_fee"] = this.isw_conv_fee; this.Session["total_amt"] = this.total_amt; this.Session["Refno"] = this.refno; this.Session["einao_split_amt"] = num2.ToString(); this.Session["cld_split_amt"] = num.ToString(); this.Session["hashString"] = this.xispf.hash; if (this.addy.Contains<char>(',')) { this.addy = this.addy.Replace(",", ", "); } }
protected void Page_Load(object sender, EventArgs e) { if ((this.Session["pwalletID"] != null) && (this.Session["pwalletID"].ToString() != "")) { this.adminID = this.Session["pwalletID"].ToString(); } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } if (this.Session["fullname"] != null) { this.fullname = this.Session["fullname"].ToString(); } if (this.Session["email"] != null) { this.email = this.Session["email"].ToString(); } if (this.Session["mobile"] != null) { this.mobile = this.Session["mobile"].ToString(); } this.xstring = new StringBuilder(); this.product_id = ConfigurationManager.AppSettings["pd_product_id_test"]; this.mackey = ConfigurationManager.AppSettings["pd_mackey_test"]; this.check_trans_page = ConfigurationManager.AppSettings["pd_get_trans_json_page_test"]; if ((base.Request.QueryString["txnRef"] != null) && (base.Request.QueryString["txnRef"] != "")) { this.txnref = base.Request.QueryString["txnRef"].ToString(); this.Session["transID"] = this.txnref; } if ((base.Request.QueryString["payRef"] != null) && (base.Request.QueryString["payRef"] != "")) { this.payRef = base.Request.QueryString["payRef"].ToString(); } if ((base.Request.QueryString["retRef"] != null) && (base.Request.QueryString["retRef"] != "")) { this.retRef = base.Request.QueryString["retRef"].ToString(); } if ((base.Request.QueryString["cardNum"] != null) && (base.Request.QueryString["cardNum"] != "")) { this.cardNum = base.Request.QueryString["cardNum"].ToString(); } if ((base.Request.QueryString["apprAmt"] != null) && (base.Request.QueryString["apprAmt"] != "")) { this.apprAmt = base.Request.QueryString["apprAmt"].ToString(); } if ((base.Request.QueryString["resp"] != null) && (base.Request.QueryString["resp"] != "")) { this.resp = base.Request.QueryString["resp"].ToString(); } if ((base.Request.QueryString["desc"] != null) && (base.Request.QueryString["desc"] != "")) { this.desc = base.Request.QueryString["desc"].ToString(); } if (!base.IsPostBack) { this.c_twall = this.ret.getTwalletByTransIDAdminID(this.txnref, this.adminID); this.c_app = this.ret.getApplicantByID(this.c_twall.applicantID); if (this.c_twall.xid != null) { this.Session["c_twall"] = this.c_twall; this.lt_fdets = this.ret.getFee_detailsByTwalletID(this.c_twall.xid); if (this.lt_fdets.Count > 0) { this.Session["lt_fdets"] = this.lt_fdets; } this.lt_hwall = this.ret.getHwalletByTransID(this.txnref); int num = 1; int num2 = 0; foreach (XObjs.Hwallet hwallet in this.lt_hwall) { XObjs.PaymentReciept item = new XObjs.PaymentReciept(); XObjs.Fee_list _list = new XObjs.Fee_list(); XObjs.Fee_details _details = new XObjs.Fee_details(); _details = this.ret.getFee_detailsByID(hwallet.fee_detailsID); _list = this.ret.getFee_listByID(_details.fee_listID); item.sn = num.ToString(); item.item_code = _list.item_code; item.item_desc = _list.xdesc; item.init_amt = string.Format("{0:n}", Convert.ToInt32(_details.init_amt)); item.tech_amt = string.Format("{0:n}", Convert.ToInt32(_details.tech_amt)); item.qty = string.Format("{0:n}", Convert.ToInt32(_details.xqty)); item.tot_amount = string.Format("{0:n}", Convert.ToInt32(_details.tot_amt)); item.transID = hwallet.transID + "-" + hwallet.fee_detailsID + "-" + hwallet.xid; num2 += Convert.ToInt32(_details.tot_amt); this.Session["amt"] = num2; this.total_amt = string.Format("{0:n}", num2); this.Session["total_amt"] = this.total_amt; this.lt_pr.Add(item); num++; } } this.isw_fields = this.ret.getISWtransactionByTransactionID(this.txnref); this.xstring.AppendLine("Transaction reference= " + this.txnref + " Payment reference= " + this.payRef + " Switching Bank Reference number= " + this.retRef + " card No= " + this.cardNum + " apprAmt= " + this.apprAmt); this.inputString = this.product_id + this.txnref + this.mackey; string headerValue = this.hash_value.GetGetSHA512String(this.inputString); this.isr = this.tx.myRedirect(this.check_trans_page + "?productid=" + this.product_id + "&transactionreference=" + this.txnref + "&amount=" + this.isw_fields.amount, "Hash", headerValue); if ((this.isr.ResponseCode != "") && (this.isr.ResponseCode != null)) { this.err_desc = this.eh.getErrorDesc(this.isr.ResponseCode); if (((this.err_desc != "") && (this.err_desc != null)) && (this.err_desc != "NA")) { this.isr.ResponseDescription = this.err_desc; } this.xstring.AppendLine("Sent Amount: " + this.isw_fields.amount + "\r\n Product ID: " + this.product_id + "\r\n Hash: " + headerValue + "\r\n Amount: " + this.isr.Amount + "\r\n CardNumber: " + this.isr.CardNumber + "\r\n MerchantReference: " + this.isr.MerchantReference + "\r\n PaymentReference: " + this.isr.PaymentReference + "\r\n RetrievalReferenceNumber: " + this.isr.RetrievalReferenceNumber + "\r\n LeadBankCbnCode: " + this.isr.LeadBankCbnCode + "\r\n TransactionDate: " + this.isr.TransactionDate + "\r\n ResponseCode: " + this.isr.ResponseCode + "\r\n ResponseDescription: " + this.isr.ResponseDescription + "\r\n Json Page: " + this.check_trans_page + "\r\n Form Response: " + this.resp + "\r\n Form Description: " + this.desc); if (this.txnref != "") { this.docpath = base.Server.MapPath("~/") + "InterLogs/" + this.txnref + ".txt"; this.succ = this.x.WriteToFile(this.xstring.ToString(), this.docpath); } else { this.docpath = base.Server.MapPath("~/") + "InterLogs/xxx.txt"; this.succ = this.x.WriteToFile(this.xstring.ToString(), this.docpath); } this.succ = this.reg.updateInterSwitchRecords(this.txnref, this.payRef, this.retRef, this.isr.ResponseCode, this.isr.TransactionDate, this.isr.MerchantReference, this.isr.ResponseDescription,isr.PaymentReference); if (this.isr.ResponseCode == "00") { this.xpay_status = "1"; } else { this.xpay_status = "3"; } if (this.succ != 0) { this.sendAlertHtml(); } } else { string str2 = "None"; string str3 = "None"; this.xstring.AppendLine("Sent Amount: " + this.isw_fields.amount + "\r\n Product ID: " + this.product_id + "\r\n Hash: " + headerValue + "\r\n Amount: None\r\n CardNumber: None\r\n MerchantReference: None\r\n PaymentReference: None\r\n RetrievalReferenceNumber: None\r\n LeadBankCbnCode: None\r\n TransactionDate: None\r\n ResponseCode: " + str2 + "\r\n ResponseDescription: " + str3 + "\r\n Json Page: " + this.check_trans_page + "\r\n Form Response: " + this.resp + "\r\n Form Description: " + this.desc); if (this.txnref != "") { this.docpath = base.Server.MapPath("~/") + "InterLogs/" + this.txnref + ".txt"; this.succ = this.x.WriteToFile(this.xstring.ToString(), this.docpath); } else { this.docpath = base.Server.MapPath("~/") + "InterLogs/xxx.txt"; this.succ = this.x.WriteToFile(this.xstring.ToString(), this.docpath); } this.xpay_status = "3"; if (this.desc == "") { this.isr.ResponseDescription = "Transaction Pending"; } else { this.isr.ResponseDescription = this.desc; } if (this.resp == "") { this.isr.ResponseCode = "XXXX"; } else { this.isr.ResponseCode = this.resp; } this.sendAlertHtml(); } } }
protected void AddFeeList() { if (this.Session["c_app"] != null) { this.c_app = (XObjs.Applicant) this.Session["c_app"]; } int num = this.reg.addApplicant(this.c_app); if ((num > 0) && ((this.Session["AgentType"] != null) && (this.Session["AgentType"].ToString() != ""))) { this.agentType = this.Session["AgentType"].ToString(); if (this.agentType == "Agent") { if (this.Session["c_reg"] != null) { this.c_reg = (XObjs.Registration) this.Session["c_reg"]; } this.fullname = this.c_reg.Firstname + " " + this.c_reg.Surname; this.Session["fullname"] = this.fullname; this.email = this.c_reg.Email; this.Session["email"] = this.email; this.mobile = this.c_reg.PhoneNumber; this.Session["mobile"] = this.mobile; } else { if (this.Session["c_sub"] != null) { this.c_sub = (XObjs.Subagent) this.Session["c_sub"]; } this.fullname = this.c_sub.Firstname + " " + this.c_sub.Surname; this.Session["fullname"] = this.fullname; this.email = this.c_sub.Email; this.Session["email"] = this.email; this.mobile = this.c_sub.Telephone; this.Session["mobile"] = this.mobile; } this.scard = this.ret.getRandomScard(); this.lt_twall = this.ret.getTwalletByMemberID(this.adminID, this.scard.xnum, this.Session["AgentType"].ToString()); if (this.lt_twall.Count == 0) { this.transID = this.scard.xnum.ToUpper(); int num2 = 0; int num3 = 0; this.twall.ref_no = "X" + this.adminID + "-" + DateTime.Now.ToString("yyyy") + "-" + this.scard.xnum; this.ref_no = this.twall.ref_no; this.twall.transID = this.scard.xnum; this.twall.xbankerID = "0"; this.twall.xgt = "xpay"; this.twall.xmemberID = this.adminID; this.twall.xmembertype = this.Session["AgentType"].ToString(); this.twall.xpay_status = "2"; this.twall.applicantID = num.ToString(); this.twall.xreg_date = this.xreg_date; this.twall.xsync = "0"; this.twall.xvisible = "1"; num2 = this.reg.addTwallet(this.twall); if (num2 > 0) { if (this.Session["SCart"] != null) { this.lt_cart = (List<XObjs.Shopping_card>) this.Session["SCart"]; } if (this.Session["Sl_init"] != null) { this.sl_init_amt = (SortedList<string, string>) this.Session["Sl_init"]; } if (this.Session["Sl_tech"] != null) { this.sl_tech_amt = (SortedList<string, string>) this.Session["Sl_tech"]; } int num4 = 0; foreach (XObjs.Shopping_card _card in this.lt_cart) { this.f_dets.twalletID = num2.ToString(); this.f_dets.fee_listID = _card.xid; this.f_dets.xlogstaff = this.adminID; this.f_dets.xqty = _card.qty; this.f_dets.xused = "0"; this.f_dets.tot_amt = _card.total_amt.ToString(); this.xtotal_amt += Convert.ToInt32(_card.total_amt); this.f_dets.init_amt = this.sl_init_amt[_card.xid]; this.f_dets.tech_amt = this.sl_tech_amt[_card.xid]; this.f_dets.xreg_date = this.xreg_date; this.f_dets.xsync = "0"; this.f_dets.xvisible = "1"; num3 = this.reg.addFee_details(this.f_dets); num4++; for (int i = 0; i < Convert.ToInt32(_card.qty); i++) { int num6 = 0; this.c_hwall.transID = this.scard.xnum; this.c_hwall.used_status = "Not Used"; this.c_hwall.product_title = ""; this.c_hwall.xreg_date = this.xreg_date; this.c_hwall.used_date = ""; this.c_hwall.fee_detailsID = num3.ToString(); num6 = this.reg.addHwallet(this.c_hwall); } } if (num4 == this.lt_cart.Count<XObjs.Shopping_card>()) { base.Response.Redirect("./m_invoicet.aspx?mx=" + this.adminID + "&tx=" + this.scard.xnum); } } } else { this.AddFeeList(); } } }
public XObjs.Applicant getApplicantByID(string xid) { XObjs.Applicant applicant = new XObjs.Applicant(); SqlConnection connection = new SqlConnection(hf.ConnectXpay()); SqlCommand command = new SqlCommand("SELECT * FROM applicant WHERE xid='" + xid + "' ", connection); connection.Open(); command.CommandTimeout = 0; SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader.Read()) { applicant.xid = reader["xid"].ToString(); applicant.xname = hf.ConvertTab2Apos(reader["xname"].ToString()); applicant.address = hf.ConvertTab2Apos(reader["address"].ToString()); applicant.xemail = hf.ConvertTab2Apos(reader["xemail"].ToString()); applicant.xmobile = reader["xmobile"].ToString(); } reader.Close(); return applicant; }