Beispiel #1
0
        private void txtNombre_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == Convert.ToChar(Keys.Enter))
            {
                e.Handled = false;


                Negocios.NProducto getProducto = new Negocios.NProducto();



                List <Datos.TProducto_Caracteristica_Foreign> tlist = getProducto.Listar(txtNombre.Text, "Nombre");


                // MessageBox.Show(tlist.Count+" }}");

                if (tlist.Count == 1)
                {
                    codigoProd = ((int)tlist[0].Codigo);
                }
                else
                {
                    codigoProd = 0;
                    MessageBox.Show("No existe ese Producto", "Producto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                //MessageBox.Show(codigoProd + "--");
            }
        }
Beispiel #2
0
        public static AutoCompleteStringCollection LoadAutoCompleteNombre()
        {
            Negocios.NProducto getLista = new Negocios.NProducto();



            AutoCompleteStringCollection stringCol = new AutoCompleteStringCollection();

            foreach (String row in getLista.Listar("", "Nombre").Select(p => p.Nombre))
            {
                stringCol.Add(row);
            }
            return(stringCol);
        }