Пример #1
0
        private void btnStock_Click(object sender, EventArgs e)
        {
            if (dgv.RowCount == 0)
            {
                MessageBox.Show("Não Nenhum Farmaco Selecionado", "Atenção");
            }
            else
            {
                DialogResult result = MessageBox.Show("Deseja Adicionar " + "Novo" + " Estoque do Fármaco #" + dgv.CurrentRow.Cells[0].Value.ToString() + "# ?", "Pergunta!!!",
                                                      MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    FEstoque f = new FEstoque(_NomeGlobal, IdGlobal, _CargoGlobal, AcaoNaTela.Cadastrar);
                    f.IdGlobal            = _IdGlobal;
                    f.txtCodigo.Text      = dgv.CurrentRow.Cells[0].Value.ToString();
                    f.txtFarmaco.Text     = dgv.CurrentRow.Cells[1].Value.ToString();
                    f.txtDescr.Text       = dgv.CurrentRow.Cells[2].Value.ToString();
                    f.txtTipoFarmaco.Text = dgv.CurrentRow.Cells[4].Value.ToString();


                    DialogResult Resultado = f.ShowDialog();
                    if (Resultado == DialogResult.Yes)
                    {
                        Listar();
                    }
                }
            }
        }
Пример #2
0
        private void btnAtualizar_Click(object sender, EventArgs e)
        {
            if (dgv.RowCount == 0)
            {
                FNotificao.AlerForm("Não Nenhum Farmaco Selecionado", TipoNotificacao.aviso);
            }
            else
            {
                string resultado = FNotificao.AlertConfirm("Deseja Adicionar Estoque do Fármaco #" + dgv.CurrentRow.Cells[3].Value.ToString() + "# ?", TipoNotificacao.pergunta);

                if (resultado == "1")
                {
                    FEstoque frm = new FEstoque(_NomeGlobal, _IdGlobal, _CargoGlobal, AcaoNaTela.Atualizar);
                    frm.IdGlobal       = _IdGlobal;
                    frm.txtCodigo.Text = dgv.CurrentRow.Cells["EstoqueId"].Value.ToString();
                    frm.txtDescr.Text  = dgv.CurrentRow.Cells[2].Value.ToString();

                    frm.txtPrecoCompra.Text = dgv.CurrentRow.Cells[9].Value.ToString();
                    frm.txtPrecoVenda.Text  = dgv.CurrentRow.Cells[10].Value.ToString();
                    frm.txtLote.Text        = dgv.CurrentRow.Cells[8].Value.ToString();
                    //frm.txtEstoq.Text = dgv.CurrentRow.Cells[5].Value.ToString();
                    frm.dataProducao.Text = dgv.CurrentRow.Cells[6].Value.ToString();
                    frm.dataExp.Text      = dgv.CurrentRow.Cells[7].Value.ToString();


                    frm.txtFarmaco.Text     = dgv.CurrentRow.Cells[3].Value.ToString();
                    frm.txtTipoFarmaco.Text = dgv.CurrentRow.Cells[1].Value.ToString();
                    frm.txtDescricao.Text   = dgv.CurrentRow.Cells[11].Value.ToString();

                    if (dgv.CurrentRow.Cells[13].Value.ToString() == "Disponível")
                    {
                        frm.ckActivo.Checked = true;
                    }
                    else
                    {
                        frm.ckActivo.Checked = false;
                    }
                    DialogResult DialogResult = frm.ShowDialog();

                    if (DialogResult == DialogResult.Yes)
                    {
                        Listar();
                    }
                }
            }
        }
Пример #3
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            if (dgv.RowCount == 0)
            {
                FNotificao.AlerForm("Não Nenhum Fármaco Selecionado", TipoNotificacao.aviso);
            }
            else
            {
                string resultado = FNotificao.AlertConfirm("Deseja Cadastrar Novo estoque do Fármaco " + dgv.CurrentRow.Cells[3].Value.ToString() + " ?", TipoNotificacao.pergunta);
                if (resultado == "1")
                {
                    FEstoque f = new FEstoque(_NomeGlobal, _IdGlobal, _CargoGlobal, AcaoNaTela.Cadastrar);
                    f.IdGlobal            = _IdGlobal;
                    f.txtCodigo.Text      = dgv.CurrentRow.Cells[0].Value.ToString();
                    f.txtDescr.Text       = dgv.CurrentRow.Cells[2].Value.ToString();
                    f.txtFarmaco.Text     = dgv.CurrentRow.Cells[3].Value.ToString();
                    f.txtTipoFarmaco.Text = dgv.CurrentRow.Cells[1].Value.ToString();

                    if (dgv.CurrentRow.Cells[12].Value.ToString() == "Disponível")
                    {
                        f.ckActivo.Checked = true;
                    }
                    else
                    {
                        f.ckActivo.Checked = false;
                    }

                    DialogResult DialogResult = f.ShowDialog();

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