示例#1
0
    protected void lnkbtnAddBankAccount_Click(object sender, EventArgs e)
    {
        int status = BankAccounts.GetBankAccountNumber(txtAccountNum.Text, LoginMemberId);

        if (status == 0)
        {
            BankAccounts ObjBA = new BankAccounts();

            ObjBA.Bankaccounttypeid = Convert.ToInt32(ddlIAcountType.SelectedValue);
            ObjBA.AccountTitle      = txtAccountTitle.Text;
            ObjBA.AccountNumber     = txtAccountNum.Text;
            ObjBA.RoutingNumber     = txtRoutingNum.Text;
            ObjBA.IBANNumber        = txtIBANNum.Text;
            ObjBA.SwiftCode         = txtSwiftCode.Text;
            ObjBA.BankName          = txtBankName.Text;
            ObjBA.BranchName        = txtBranch.Text;
            ObjBA.StreetName        = txtStreetName.Text;
            ObjBA.StreetNumber      = txtStreetNum.Text;
            ObjBA.ZipCode           = txtZipCode.Text;
            ObjBA.City         = txtCity.Text;
            ObjBA.StateId      = Conversion.ParseInt(ddlState.SelectedValue);
            ObjBA.PrimaryPhone = txtPhoneNum.Text;
            ObjBA.IsETF        = chkboxetf.Checked;

            DataTable dt = BankAccounts.GetSateAndCityOfZipcode(txtZipCode.Text.ToString().Trim()).Tables[0];
            for (int row = 1; row <= dt.Rows.Count; row++)
            {
                if (dt.Rows[0]["CityName"].ToString().Trim() == txtCity.Text.ToString().Trim() && dt.Rows[0]["StateName"].ToString().Trim() == ddlState.SelectedItem.Text.ToString().Trim())
                {
                    BankAccounts.insertAccountInfo(ObjBA, LoginMemberId);
                    Session["BankAdded"] = "Bank added successfully";
                    Response.Redirect("bankaccount");
                }
            }
            lblerrorbankacc.Visible = true;
            lblerrorbankacc.Text    = "Please do not change the information.";
            ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true);
        }
        else
        {
            lblerrorbankacc.Visible = true;
            lblerrorbankacc.Text    = "Account# already exists.";
            ScriptManager.RegisterStartupScript(this, GetType(), "fadeOut", "fadeOut();", true);
            return;
        }
    }
    protected void lnkbtnAddBankAccount_Click(object sender, EventArgs e)
    {
        int status = BankAccounts.GetBankAccountNumber(txtAccountNum.Text, LoginMemberId);

        if (status == 0)
        {
            BankAccounts ObjBA = new BankAccounts();

            ObjBA.Bankaccounttypeid = Convert.ToInt32(ddlIAcountType.SelectedValue);
            ObjBA.AccountTitle      = txtAccountTitle.Text;
            ObjBA.AccountNumber     = txtAccountNum.Text;
            ObjBA.RoutingNumber     = txtRoutingNum.Text;
            ObjBA.IBANNumber        = txtIBANNum.Text;
            ObjBA.SwiftCode         = txtSwiftCode.Text;
            ObjBA.BankName          = txtBankName.Text;
            ObjBA.BranchName        = txtBranch.Text;
            ObjBA.StreetName        = txtStreetName.Text;
            ObjBA.StreetNumber      = txtStreetNum.Text;
            ObjBA.ZipCode           = txtZipCode.Text;
            ObjBA.City         = txtCity.Text;
            ObjBA.StateId      = Conversion.ParseInt(ddlState.SelectedValue);
            ObjBA.PrimaryPhone = txtPhoneNum.Text;
            ObjBA.UserId       = LoginMemberId;
            ObjBA.IsETF        = chkboxetf.Checked;


            BankAccounts.insertAccountInfo(ObjBA, LoginMemberId);
            Response.Redirect("/BankAccount/ViewBankAccount.aspx");
        }
        else
        {
            lblerrorbank.Text      = "Account number already exist.";
            lblerrorbank.ForeColor = Color.Red;
            return;
        }
    }