Пример #1
0
        protected void B_carga_contactos_Click1(object sender, EventArgs e)
        {
            rutCliente = CB_CLIENTE.SelectedValue.Trim();

            if (CB_CLIENTE.SelectedValue.Trim() != "-1")
            {
                btn_nuevo.Visible      = true;
                div_contactos.Visible  = true;
                G_CONTACTOS.Visible    = true;
                G_CONTACTOS.DataSource = ReporteRNegocio.trae_contactos_cobranza(CB_CLIENTE.SelectedValue.Trim());
                G_CONTACTOS.DataBind();
                CleanControl(this.Controls);
            }
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeee", "<script language='javascript'>chosen_upd();</script>", false);
        }
Пример #2
0
        protected void btn_guarda_cont_Click(object sender, EventArgs e)
        {
            if (h3_titulo.InnerText == "Nuevo Contacto")
            {
                contacto cont = new contacto();
                cont.rut_cont    = t_rut_cont.Text;
                cont.nom_cont    = t_nom_cont.Text;
                cont.correo_cont = t_corr_cont.Text;
                cont.num_cont    = t_num_cont.Text;
                cont.descrip     = t_descrip.Value;

                if (ReporteRNegocio.insert_contacto_cobranza(CB_CLIENTE.SelectedValue, cont) == "OK")
                {
                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeewe", "<script language='javascript'>alert('Cliente creado');</script>", false);

                    btn_nuevo.Visible          = true;
                    div_crear_contacto.Visible = false;
                    div_contactos.Visible      = true;
                    G_CONTACTOS.Visible        = true;
                    G_CONTACTOS.DataSource     = ReporteRNegocio.trae_contactos_cobranza(CB_CLIENTE.SelectedValue);
                    G_CONTACTOS.DataBind();
                    CleanControl(this.Controls);
                }
            }
            else if (h3_titulo.InnerText == "Editar Contacto")
            {
                contacto cont = new contacto();
                cont.rut_cont    = t_rut_cont.Text;
                cont.nom_cont    = t_nom_cont.Text;
                cont.correo_cont = t_corr_cont.Text;
                cont.num_cont    = t_num_cont.Text;
                cont.descrip     = t_descrip.Value;
                if (ReporteRNegocio.update_contacto_cobranza(rutCliente, cont) == "OK")
                {
                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeewe", "<script language='javascript'>alert('Cliente editado');</script>", false);

                    btn_nuevo.Visible          = true;
                    div_crear_contacto.Visible = false;
                    div_contactos.Visible      = true;
                    G_CONTACTOS.Visible        = true;
                    G_CONTACTOS.DataSource     = ReporteRNegocio.trae_contactos_cobranza(CB_CLIENTE.SelectedValue);
                    G_CONTACTOS.DataBind();
                    CleanControl(this.Controls);
                }
            }

            ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeewe", "<script language='javascript'>alert('Error al crear cliente');</script>", false);
        }