protected void btnSearch_Click(object sender, EventArgs e)
        {
            xsearch = txt_status.Text.Trim();
            c_twall = ret.getTwalletByTransIDAdminID(xsearch, adminID,agentType);
            c_app = ret.getApplicantByID(c_twall.applicantID);

            if (c_twall.xid != null)
            {
                if (c_twall.xgt == "xpay_bk") { xgt_type = "Bank"; }
                else if (c_twall.xgt == "xpay_isw") { xgt_type = "Inter switch"; }
                else  { xgt_type = "None"; }

                if (c_twall.xpay_status == "1") { payment_status = "Paid"; }
                else if (c_twall.xpay_status == "2") { payment_status = "Pending"; }
                else { payment_status = "Failed"; }

                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(xsearch);

                int i = 1; int amt = 0;
                foreach (Classes.XObjs.Hwallet h in lt_hwall)
                {
                    Classes.XObjs.PaymentReciept pr = new Classes.XObjs.PaymentReciept();
                    Classes.XObjs.Fee_list fl = new Classes.XObjs.Fee_list();
                    fl = ret.getFee_listByID(ret.getFee_detailsByID(h.fee_detailsID).fee_listID);

                    pr.sn = i.ToString();
                    pr.item_code = fl.item_code;
                    pr.item_desc = fl.xdesc;
                    int amount = Convert.ToInt32(fl.init_amt) + Convert.ToInt32(fl.tech_amt);
                    pr.amount = string.Format("{0:n}", amount);
                    pr.transID = h.transID + "-" + h.fee_detailsID + "-" + h.xid;
                    amt += Convert.ToInt32(amount);
                    total_amt = string.Format("{0:n}", amt);

                    lt_pr.Add(pr);
                    i++;
                }
                show_receipt = 1; show_search = 0;
            }

            else
            {
              show_receipt = 0; show_search = 1;
            }
        }
Example #2
0
        protected void gvTm_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "TmStatusClick")
            {
                GridViewRow rowSelect = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
                int rowindex = rowSelect.RowIndex;
                string xid = e.CommandArgument.ToString();
                string item_code = gvTm.Rows[rowindex].Cells[1].Text;
                string new_transID = gvTm.Rows[rowindex].Cells[3].Text;
                int amt = Convert.ToInt32(gvTm.Rows[rowindex].Cells[4].Text);
                TextBox txt_ptitle = (TextBox)gvTm.Rows[rowindex].Cells[2].FindControl("txt_product_title_tm");
                ImageButton lb = (ImageButton)gvTm.Rows[rowindex].Cells[5].FindControl("btnMakePaymentTm");

                string[] transID = new_transID.Split('-');

                if (txt_ptitle.Text != "")
                {
                    c_app = ret.getApplicantByID(ret.getTwalletByTransID(transID[0].Trim()).applicantID);
                    ti.item_code = item_code; Session["item_code"] = ti.item_code;
                    ti.hwalletID = transID[2].Trim();
                    ti.amt = amt.ToString();
                    ti.transID = new_transID.Trim();
                    ti.fee_detailsID = transID[1].Trim();
                    ti.product_title = txt_ptitle.Text;
                    ti.xgt = "xpay";
                    ti.xmemberID = adminID;
                    ti.applicant_name = c_app.xname;
                    ti.applicant_addy = c_app.address;
                    ti.applicant_email = c_app.xemail;
                    ti.applicant_no = c_app.xmobile;

                    if ((ti.item_code.ToUpper().Contains("D")) && ((ti.item_code.ToUpper() == "D002") || (ti.item_code.ToUpper() == "D102")))
                    {
                        data.Add("item_code", ti.item_code);
                        data.Add("applicantname", ti.applicant_name);
                        data.Add("applicant_addy", ti.applicant_addy);
                        data.Add("applicant_email", ti.applicant_email);
                        data.Add("applicant_no", ti.applicant_no);
                        data.Add("product_title", ti.product_title);
                        if (Session["Sys_ID"] != null) { data.Add("agent", Session["Sys_ID"].ToString()); }
                        data.Add("transID", ti.transID);
                        data.Add("fee_detailsID", ti.fee_detailsID);
                        data.Add("hwalletID", ti.hwalletID);
                        data.Add("xgt", "xpay");
                        data.Add("amt", amt.ToString());
                        if (Session["cname"] != null) { data.Add("cname", Session["cname"].ToString()); }
                        if (Session["agentemail"] != null) { data.Add("agentemail", Session["agentemail"].ToString()); }
                        if (Session["agentpnumber"] != null) { data.Add("agentpnumber", Session["agentpnumber"].ToString()); }

                        HttpHelper.RedirectAndPOST(this.Page, ConfigurationManager.AppSettings["new_tm_page"], data);

                    }
                    else if ((ti.item_code.ToUpper().Contains("D")) && ((ti.item_code.ToUpper() != "D002") && (ti.item_code.ToUpper() != "D102")))
                    {
                        data.Add("item_code", ti.item_code);
                        data.Add("applicantname", ti.applicant_name);
                        data.Add("applicant_addy", ti.applicant_addy);
                        data.Add("applicant_email", ti.applicant_email);
                        data.Add("applicant_no", ti.applicant_no);
                        data.Add("product_title", ti.product_title);
                        if (Session["Sys_ID"] != null) { data.Add("agent", Session["Sys_ID"].ToString()); }
                        data.Add("transID", ti.transID);
                        data.Add("fee_detailsID", ti.fee_detailsID);
                        data.Add("hwalletID", ti.hwalletID);
                        data.Add("xgt", "xpay");
                        data.Add("amt", amt.ToString());
                        if (Session["cname"] != null) { data.Add("cname", Session["cname"].ToString()); }
                        if (Session["agentemail"] != null) { data.Add("agentemail", Session["agentemail"].ToString()); }
                        if (Session["agentpnumber"] != null) { data.Add("agentpnumber", Session["agentpnumber"].ToString()); }

                        HttpHelper.RedirectAndPOST(this.Page, ConfigurationManager.AppSettings["new_tm_gen_page"], data);
                    }
                }

            }
        }