Beispiel #1
0
        void Enviar()
        {
            if (Input_Produto.Text == "")
            {
                return;
            }

            if (!Alter)
            {
                Produtos.Add(Input_Produto.Text);
            }
            else
            {
                if (L_Content.SelectedIndex < 0)
                {
                    Alter = false;
                    return;
                }
                ActualAlter = new Alter(L_Content.SelectedIndex, Input_Produto.Text);
                Produtos[ActualAlter.GetIndex] = ActualAlter.GetProduct;
                Alter = false;
            }
            L_Content.Items.Clear();
            SelectProdutos(Produtos);
            Input_Produto.Text = "";
            Input_Produto.Focus();
        }
Beispiel #2
0
 private void But_Alterar_Click(object sender, EventArgs e)
 {
     if (L_Content.SelectedIndex < 0)
     {
         return;
     }
     Input_Produto.Text = Produtos[L_Content.SelectedIndex];
     Alter = true;
     Input_Produto.Focus();
 }
Beispiel #3
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Input_Produto.Focus();
 }