Ejemplo n.º 1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (dgv.RowCount == 0)
            {
                MessageBox.Show("Não Nenhum Fármaco Selecionado", "Atenção");
            }
            else
            {
                DialogResult result = MessageBox.Show("Deseja Editar os Dados Fármaco #" + dgv.CurrentRow.Cells[0].Value.ToString() + "# ?", "Pergunta!!!",
                                                      MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    FFProduto f = new FFProduto(AcaoNaTela.Editar);
                    f.txtCodigo.Text  = dgv.CurrentRow.Cells[0].Value.ToString();
                    f.txtProduto.Text = dgv.CurrentRow.Cells[1].Value.ToString();
                    //f.cbCateg.Text = dgv.CurrentRow.Cells[6].Value.ToString();
                    if (dgv.CurrentRow.Cells[3].Value.ToString() == "")
                    {
                        f.picBox.Image    = new Bitmap(Application.StartupPath + "\\Imagens\\photo-camera.png");
                        f.picBox.SizeMode = PictureBoxSizeMode.CenterImage;
                    }
                    else
                    {
                        f.picBox.Image    = new Bitmap(Application.StartupPath + "\\Imagens\\" + dgv.CurrentRow.Cells[3].Value.ToString());
                        f.picBox.SizeMode = PictureBoxSizeMode.StretchImage;
                    }

                    DialogResult Resultado = f.ShowDialog();
                    if (Resultado == DialogResult.Yes)
                    {
                        Listar();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            FFProduto    f = new FFProduto(AcaoNaTela.Cadastrar);
            DialogResult dialogResultado = f.ShowDialog();

            if (dialogResultado == DialogResult.Yes)
            {
                Listar();
            }
        }