protected void btnListo_Click(object sender, EventArgs e)
        {
            int IdUsuario = Convert.ToInt16(Session["IdUsuario"]);

            ObjELU.IdUsuario   = IdUsuario;
            ObjELU.NombreLista = tbNombreLista.Text;
            string msn = ObjNLU.InsertarListaUsuario(ObjELU);
            //grvListas.DataBind();
            int IdProducto = Convert.ToInt16(Session["IdProducto"]);
            //int IdLista;
            //faltaba descomentar funcion buscar lista por nombre de lista
            List <E_ListaUsuario> lstU = new N_ListaUsuario().LstUsuarios();

            foreach (E_ListaUsuario lista in lstU)
            {
                if (lista.IdUsuario == IdUsuario && lista.NombreLista == tbNombreLista.Text)
                {
                    ObjELP.IdLista = lista.IdLista;
                }
            }
            //int IdLista = (new N_ListaUsuario().BuscarListaUsuarioporNombre(tbNombreLista.Text)).IdLista;
            ObjELP.IdProducto = IdProducto;
            //ObjELP.IdLista = Idlista;
            pFormLista.Visible = false;
            string msn2 = ObjNLP.InsertarListaProductol(ObjELP);

            Iniciar();
        }
Exemple #2
0
        protected void grvListas_SelectedIndexChanged(object sender, EventArgs e)
        {
            int             IdProducto = Convert.ToInt16(Session["IdProducto"]);
            int             IdLista    = Convert.ToInt16(grvListas.SelectedDataKey["IdLista"]);
            E_ListaProducto ObjELP     = new E_ListaProducto();

            ObjELP.IdProducto = IdProducto;
            ObjELP.IdLista    = IdLista;

            string msn2 = ObjNLP.InsertarListaProductol(ObjELP);

            Iniciar();
        }