Exemplo n.º 1
0
        protected void btnSaveDataBank_Click(object sender, EventArgs e)
        {
            int    bank = 0;
            string nameTc = "", typeAcc = "C", numberAcc = "", numberCon = "", razonSocial = "", direccFisc = "", data = "", userName = "";

            string[] arrayLogin = HttpContext.Current.User.Identity.Name.Split('¬');

            userName = arrayLogin[1];

            if (string.IsNullOrEmpty(ddlBanck.SelectedValue))
            {
                lblMessaggeBank.Text = "Campo nombre del banco es obligatorio.";
                return;
            }
            bank   = int.Parse(ddlBanck.SelectedValue);
            nameTc = txtNameTitularCuentaBan.Text.Trim();
            if (rbCuentaAH.Checked)
            {
                typeAcc = "A";
            }
            numberAcc   = txtNumCuenta.Text.Trim();
            numberCon   = txtNumContr.Text.Trim();
            razonSocial = txtBusinessName.Text.Trim();
            direccFisc  = txtFiscalAddress.Text.Trim();

            if (string.IsNullOrEmpty(nameTc))
            {
                lblMessaggeBank.Text = "Campo nombre del titular de cuenta bancaria es obligatorio.";
                return;
            }
            if (string.IsNullOrEmpty(numberAcc))
            {
                lblMessaggeBank.Text = "Campo numero de cuenta es obligatorio.";
                return;
            }
            if (string.IsNullOrEmpty(numberCon))
            {
                lblMessaggeBank.Text = "Campo numero del contribuyente es obligatorio.";
                return;
            }
            if (string.IsNullOrEmpty(razonSocial))
            {
                lblMessaggeBank.Text = "Campo razon social es obligatorio.";
                return;
            }
            if (string.IsNullOrEmpty(direccFisc))
            {
                lblMessaggeBank.Text = "Campo direccion fiscal es obligatorio.";
                return;
            }

            data = userName + "|" +
                   nameTc + "|" +
                   typeAcc + "|" +
                   numberCon + "|" +
                   numberAcc + "|" +
                   razonSocial + "|" +
                   direccFisc + "|" +
                   bank;

            BrUser brUser = new BrUser();
            bool   answer = brUser.PutBankInformation(data);

            if (answer)
            {
                Response.Redirect("Edit.aspx", true);
            }
            lblMessaggeBank.Text = "Ha Ocurrido Un Error";
        }