Exemplo n.º 1
0
        protected void btnGrabarEmail_Click(object sender, EventArgs e)
        {
            try
            {
                UbicEmail email = new UbicEmail();
                email.Email = txtCorreo.Text;
                email.IdusuarioIngreso = Convert.ToInt32(Session["variableIdUsuario"]);
                email.IdProveedorUbic = Convert.ToInt32(ddlOrigenEmail.SelectedValue);
                email.Rut = lblRutDeudor.Text;
                email.TipoEmail = ddlTipoEmail.SelectedValue;
                email.NombreContacto = txtNombreContactoEmail.Text;
                email.CargoContacto = txtCargoContactoEmail.Text;
                email.NombreContacto = txtNombreContactoEmail.Text;

                string existe = dal.setInUbicEmail(email);
                if (existe == "1")
                {
                    divAlerta.Visible = true;
                    lblInfo.Text = "El email ingresado ya existe en la BD";
                    return;
                }
                verUltimoEmail();
            }
            catch (Exception ex)
            {
                divAlerta.Visible = true;
                lblInfo.Text = ex.Message;
            }
        }
Exemplo n.º 2
0
        protected void lbtnGrabarEmailEstados_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (GridViewRow item in grvEmail.Rows)
                {
                    Label _lblIdEmail = (Label)grvEmail.Rows[item.RowIndex].FindControl("lblIdEmail");
                    RadioButtonList _rbtnEstado = (RadioButtonList)grvEmail.Rows[item.RowIndex].FindControl("rbtnEstado");
                    TextBox _txtNombreContactoEmail = (TextBox)grvEmail.Rows[item.RowIndex].FindControl("txtNombreContactoEmail");
                    DropDownList _ddlTipoEmail = (DropDownList)grvEmail.Rows[item.RowIndex].FindControl("ddlTipoEmail");

                    string idEmail = _lblIdEmail.Text;
                    string idEstado = _rbtnEstado.SelectedValue;

                    UbicEmail email = new UbicEmail();
                    email.IdEmail = Convert.ToInt32(idEmail);
                    email.IdEstadoUbic = Convert.ToInt32(idEstado);
                    email.NombreContacto = _txtNombreContactoEmail.Text;
                    email.TipoEmail = _ddlTipoEmail.SelectedValue;

                    dal.setUpEmail(email);
                }

                verUltimoEmail();
            }
            catch (Exception ex)
            {
                divAlerta.Visible = true;
                lblInfo.Text = ex.Message;
            }
        }