protected void ResendOTPLink_Click(object sender, EventArgs e)
 {
     var amount = Convert.ToDecimal(Amount.Text);
     var xsw = new Business.XSwitch();
     var customer = new Entity.Cstm();
     customer = xsw.getExternalUserDataFromUserName(Global.ConnectionString, CustomerDropDown.SelectedValue.ToString());
     var customeremail = customer.cs_email;
     var customername = customer.cs_fname + " " + customer.cs_lname;
     _otpService = new OTPService(Session["UserId"].ToString() + Session["UserName"].ToString());
     generatedotp = _otpService.GenerateOTP(Session["UserName"].ToString(), email: Session["UserEmail"].ToString(), notifyByEmail: false);
     const string subject = "Your OTP from the most secure bank, SBS, ";
     string body = string.Format("Hello {0}, <br /> <br />Your <b>OTP</b> from the most secure bank: <br /> {1} <br /><br /> Regards, <br /> SBS Team.", "", generatedotp);
     OTPUtility.SendMail("Group 2", "*****@*****.**", customername, customeremail, subject, body);
 }
        protected void MakePayment_Click(object sender, EventArgs e)
        {
            try
            {
                if (Session["Access"].ToString() == "2")
                {
                    if (FromDropdown.SelectedValue == "0")
                    {
                        Master.ErrorMessage = "Error: Select the Account from which an amount has to be Debited";
                    }

                    if (ToDropdown.SelectedValue == "0")
                    {
                        Master.ErrorMessage = "Error: Select the Account to which the amount has to be Debited";
                    }
                    else if (Amount.Text == "" || !UI.Validate.isAmountValid(Amount.Text))
                    {
                        Master.ErrorMessage = "Error: Amount cannot be empty, and amount accepts only decimal values.";
                    }
                    else
                    {
                        var amount = Convert.ToDecimal(Amount.Text);
                        var xsw = new Business.XSwitch();
                        var customer = new Entity.Cstm();
                        customer = xsw.getExternalUserDataFromUserName(Global.ConnectionString, CustomerDropDown.SelectedValue.ToString());
                        var customeremail = customer.cs_email;
                        var customername = customer.cs_fname + " " + customer.cs_lname;
                        _otpService = new OTPService(Session["UserId"].ToString() + Session["UserName"].ToString());
                        generatedotp = _otpService.GenerateOTP(Session["UserName"].ToString(), email: Session["UserEmail"].ToString(), notifyByEmail: false);
                        const string subject = "Your OTP from the most secure bank, SBS, ";
                        string body = string.Format("Hello {0}, <br /> <br />Your <b>OTP</b> from the most secure bank: <br /> {1} <br /><br /> Regards, <br /> SBS Team.", "", generatedotp);
                        OTPUtility.SendMail("Group 2", "*****@*****.**", customername, customeremail, subject, body);
                        OTPDiv.Visible = true;
                        MakePaymentButton.Visible = false;

                   }
                }

                else
                {
                   
                }
            }
            catch { }

        }
Exemplo n.º 3
0
 public Cp_Cstm(string connectionString, String cusno, Data.Dber dberr)
 {
     // fetch all details for ac_no = acno.
     cstmP = Data.CstmD.Read(connectionString, cusno, dberr);
 }
Exemplo n.º 4
0
 public Cp_Cstm(String a, String b, String c, String d, String e, String f, String g, String h, String i, 
     String j, String k, String l, String m, String n, String o, String p, String q, String r, String s, String t, String u)
 {
     cstmP = new Entity.Cstm(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u);
 }
Exemplo n.º 5
0
        private int processTransaction(String connectionString, String loginAc, String acType, 
            String dummyAc, String dummyAccess, String refno, Data.Dber dberr)
        {
            tx = new Cp_Txnm(connectionString, TXID, dberr);
            // Check if TXNM fetch for transaction type "010" is successful. Return if error encountered
            if (dberr.ifError())
            {
                result = dberr.getErrorDesc(connectionString);
                return -1;
            }
            cstm = Data.CstmD.Read(connectionString, loginAc, dberr);
            if (dberr.ifError())
            {
                dberr = new Data.Dber();
                empm = Data.EmpmD.Read(connectionString, loginAc, dberr);
                if (dberr.ifError())
                {
                    result = dberr.getErrorDesc(connectionString);
                    return -1;
                }
                else
                {
                    employee = true;
                }
            }
            if (employee)
            {
                pvg = new Privilege(this.tx.txnmP.tran_pvga, this.tx.txnmP.tran_pvgb, Convert.ToInt32(this.empm.emp_pvg));
            }
            else
            {
                pvg = new Privilege(this.tx.txnmP.tran_pvga, this.tx.txnmP.tran_pvgb, Convert.ToInt32(this.cstm.cs_type));
            }
            if (!pvg.verifyInitPrivilege(dberr))
            {
                 result = dberr.getErrorDesc(connectionString);
                 return -1;
            }
            if (!pvg.verifyApprovePrivilege())
            {
                String inData = this.TXID + "|" + acType + "|" + loginAc;
                    if (pvg.writeToPendingTxns(
                        connectionString,               /* connection string */
                        "0",                            /* account 1 */
                        "0",                            /* account 2 */
                        this.cstm.cs_no,                /* customer number */
                        tx.txnmP.tran_pvgb.ToString(),  /* transaction approve privilege */
                        tx.txnmP.tran_desc,             /* transaction description */
                        "0",                            /* initiating employee number */
                        0,                              /* debit amount */
                        0,                              /* credit amount */
                        tx.txnmP.tran_id,               /* transaction id (not tran code) */
                        inData,                         /* incoming transaction string in XSwitch */
                        dberr                           /* error tracking object */
                        ) != 0)
                    {
                        resultP = dberr.getErrorDesc(connectionString);
                        return -1;
                    }
                    resultP = Mnemonics.DbErrorCodes.MSG_SENT_FOR_AUTH;
                    return 0;
            }

            actm = new Cp_Actm(connectionString, dummyAc, "0", acType, 0, 0, 1, "Y", "Y", DateTime.Now.ToString(), true);
            if (dberr.ifError())
            {
                result = dberr.getErrorDesc(connectionString);
                return -1;
            }
            int retCode = Data.ActmD.Create(connectionString, actm.actmP, dberr);
            if (dberr.ifError())
            {
                result = dberr.getErrorDesc(connectionString);
                return -1;
            }
            if (!Data.PendtxnD.Delete(connectionString, refno))
            {
                dberr.setError(Mnemonics.DbErrorCodes.DBERR_PENDTXN_DELETE);
                result = dberr.getErrorDesc(connectionString);
                return -1;
            }
            //retCode
            //Entity.Cstm cstm = Data.CstmD.Read(connectionString, acct.actmP.cs_no1, dberr);
            Entity.Cstm cstm1 = Data.CstmD.Read(connectionString, retCode.ToString(), dberr);
            if (dberr.ifError())
            {
                result = dberr.getErrorDesc(connectionString);
                return -1;
            }
            String mailResponse = "";
            if (!Security.OTPUtility.SendMail("SBS", "*****@*****.**",
                cstm1.cs_fname + cstm1.cs_mname + cstm1.cs_lname, cstm1.cs_email,
                "Update from SBS", "new account created for you is " + retCode.ToString()))
            {
                mailResponse = "Mail sent.";
            }
            //-------------------------------
            resultP = "Successful!" + mailResponse;
            return 0;
        }