Exemplo n.º 1
0
        protected void AddTipo_Click(object sender, EventArgs e)
        {
            bool si = false;

            foreach (GridViewRow row in GridView1.Rows)
            {
                CheckBox chk_Seleccionar = (CheckBox)row.FindControl("check");
                if (chk_Seleccionar.Checked)
                {
                    si = true;
                }
            }

            if (si == true)
            {
                foreach (GridViewRow row in GridView1.Rows)
                {
                    CheckBox    chk_Seleccionar  = (CheckBox)row.FindControl("check");
                    HiddenField hd_Seleccionafol = (HiddenField)row.FindControl("checkFol");
                    if (chk_Seleccionar.Checked)
                    {
                        string pr = "";
                        idres = hd_Seleccionafol.Value;
                        BD.Conectar();
                        BD.CrearComando("select * from TiposProveedor where idProv=@idp");
                        BD.AsignarParametroCadena("@idp", idres);
                        DbDataReader DR = BD.EjecutarConsulta();
                        if (DR.Read())
                        {
                            //prueba.Text = DR[2].ToString();
                        }
                        BD.Desconectar();
                        SqlDatapr.DataBind();

                        Peditar.Visible = false;
                        lista.Width     = 400;
                        lista.Height    = 300;
                        lista.Visible   = true;
                    }
                }
            }
            else
            {
                Session["estNot"]  = false;
                Session["msjNoti"] = "DEBES SELECIONAR UN PROVEEDOR";
                Session["estPan"]  = true;
            }
        }
Exemplo n.º 2
0
        protected void Button20_Click(object sender, EventArgs e)
        {
            //---------------abrie panel editar----------------------
            bool si = false;

            foreach (GridViewRow row in GridView1.Rows)
            {
                CheckBox chk_Seleccionar = (CheckBox)row.FindControl("check");
                if (chk_Seleccionar.Checked)
                {
                    si = true;
                }
            }

            if (si == true)
            {
                foreach (GridViewRow row in GridView1.Rows)
                {
                    CheckBox    chk_Seleccionar  = (CheckBox)row.FindControl("check");
                    HiddenField hd_Seleccionafol = (HiddenField)row.FindControl("checkFol");
                    if (chk_Seleccionar.Checked)
                    {
                        string pr = "";
                        idres = hd_Seleccionafol.Value;
                        BD.Conectar();
                        BD.CrearComando("select rfc,razonSocial,correo,vendorID,vendorSite,tipoProveedor,pass,usuario, formaPago from Proveedores where idProveedor=@idp");
                        BD.AsignarParametroCadena("@idp", idres);
                        DbDataReader DR = BD.EjecutarConsulta();
                        if (DR.Read())
                        {
                            Trfc.Text      = DR[0].ToString();
                            Trs.Text       = DR[1].ToString();
                            Tcorr.Text     = DR[2].ToString();
                            Tnoti.Text     = DR[2].ToString();
                            Tven.Text      = DR[3].ToString();
                            Tsite.Text     = DR[4].ToString();
                            pr             = DR[5].ToString();
                            TexPass.Text   = DR[6].ToString();
                            Tusa.Text      = DR[7].ToString();
                            this.TbFP.Text = DR[8].ToString();
                        }
                        BD.Desconectar();
                        SqlDatapr.DataBind();
                        Droptip.DataBind();
                        if (pr != "")
                        {
                            Droptip.SelectedValue = pr;
                        }

                        Peditar.Width   = 423;
                        Peditar.Height  = 380;
                        Peditar.Visible = true;
                    }
                }
            }
            else
            {
                Session["estNot"]  = false;
                Session["msjNoti"] = "DEBES SELECIONAR UN PROVEEDOR";
                Session["estPan"]  = true;
            }
        }