Пример #1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (dgv.RowCount == 0)
            {
                FNotificao.AlerForm(" Nenhum Selecionado", TipoNotificacao.aviso);
            }
            else
            {
                string resultado = FNotificao.AlertConfirm("Deseja Editar os Dados do Cliente #" + dgv.CurrentRow.Cells["NomeCompleto"].Value.ToString() + "# ?", TipoNotificacao.pergunta);
                if (resultado == "1")
                {
                    FFCliente frm = new FFCliente(AcaoNaTela.Editar);
                    frm.txtCodigo.Text   = dgv.CurrentRow.Cells["ClienteId"].Value.ToString();
                    frm.txtNome.Text     = dgv.CurrentRow.Cells["NomeCompleto"].Value.ToString();
                    frm.txtTelf.Text     = dgv.CurrentRow.Cells["Telf"].Value.ToString();
                    frm.txtEmail.Text    = dgv.CurrentRow.Cells["Email"].Value.ToString();
                    frm.txtEndereco.Text = dgv.CurrentRow.Cells["Endereco"].Value.ToString();
                    if (dgv.CurrentRow.Cells["Estad"].Value.ToString() == "Activo")
                    {
                        frm.cbEstado.SelectedIndex = 1;
                    }
                    else
                    {
                        frm.cbEstado.SelectedIndex = 2;
                    }

                    DialogResult dialogResult = frm.ShowDialog();
                    if (dialogResult == DialogResult.Yes)
                    {
                        ListarCliente();
                    }
                }
            }
        }
Пример #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (dgv.Rows.Count == 0)
            {
                FNotificao.AlerForm("Nenhum Item Selecionado", TipoNotificacao.aviso);
            }
            else
            {
                FFFornecedor frm = new FFFornecedor(AcaoNaTela.Editar);

                string resultado = FNotificao.AlertConfirm("Deseja Editar os dados do Fornecedor "
                                                           + dgv.CurrentRow.Cells["NomeFornecedor"].Value.ToString() + "?", TipoNotificacao.pergunta);

                if (resultado.Equals("1"))
                {
                    frm.txtCodigo.Text   = dgv.CurrentRow.Cells["FornecedorId"].Value.ToString();
                    frm.txtNome.Text     = dgv.CurrentRow.Cells["NomeFornecedor"].Value.ToString();
                    frm.txtEndereco.Text = dgv.CurrentRow.Cells["Endereco"].Value.ToString();
                    frm.txtTelf.Text     = dgv.CurrentRow.Cells["Telf"].Value.ToString();
                    frm.txtEmail.Text    = dgv.CurrentRow.Cells["Email"].Value.ToString();

                    DialogResult dialogResult = frm.ShowDialog();;
                }
            }
        }
Пример #3
0
        private void btnEncerrar_Click(object sender, EventArgs e)
        {
            string resultado = FNotificao.AlertConfirm("Deseja Encerrar Aplicação?", TipoNotificacao.pergunta);

            if (resultado.Equals("2"))
            {
                return;
            }
            else
            {
                Application.Exit();
            }
        }
Пример #4
0
        private void btnSair_Click(object sender, EventArgs e)
        {
            string resultado = FNotificao.AlertConfirm("Deseja Encerrar a Caixa?", TipoNotificacao.pergunta);

            if (resultado.Equals("1"))
            {
                FecharCaixa();
                MEstoqueOpera m = new MEstoqueOpera();
                m.FecharMEstoque();  //fechar o formulario M-Estoque
            }
            else
            {
                return;
            }
        }
Пример #5
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();
                    }
                }
            }
        }
Пример #6
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (dgv.RowCount == 0)
            {
                FNotificao.AlerForm(" Nenhum Selecionado", TipoNotificacao.aviso);
            }
            else
            {
                string result = FNotificao.AlertConfirm("Deseja Editar os dados do Funcionário #" +
                                                        dgv.CurrentRow.Cells["NomeCompleto"].Value.ToString() + "# ?", TipoNotificacao.pergunta);
                if (result.Equals("1"))
                {
                    FFFuncionario frm = new FFFuncionario(AcaoNaTela.Editar);
                    frm.txtCodigo.Text   = dgv.CurrentRow.Cells["FuncionarioId"].Value.ToString();
                    frm.txtNome.Text     = dgv.CurrentRow.Cells["NomeCompleto"].Value.ToString();
                    frm.txtUsername.Text = dgv.CurrentRow.Cells["NomeUsuario"].Value.ToString();
                    frm.txtTelf.Text     = dgv.CurrentRow.Cells["Telf"].Value.ToString();
                    frm.txtEmail.Text    = dgv.CurrentRow.Cells["Email"].Value.ToString();
                    frm.txtEndereco.Text = dgv.CurrentRow.Cells["Endereco"].Value.ToString();

                    if (dgv.CurrentRow.Cells["Cargo"].Value.ToString() == "Gerente")
                    {
                        frm.cbCargo.SelectedIndex = 1;
                    }
                    else
                    {
                        frm.cbCargo.SelectedIndex = 2;
                    }

                    if (dgv.CurrentRow.Cells["Estado"].Value.ToString() == "Activo")
                    {
                        frm.cbEstado.SelectedIndex = 1;
                    }
                    else
                    {
                        frm.cbEstado.SelectedIndex = 2;
                    }

                    DialogResult DialogResult = frm.ShowDialog();
                    if (DialogResult == DialogResult.Yes)
                    {
                        ListarFuncionario();
                    }
                }
            }
        }
Пример #7
0
        private void btnRemover_Click(object sender, EventArgs e)
        {
            if (dgv.RowCount == 0)
            {
                FNotificao.AlerForm("Não Existe Nenhum Fármaco na Tela", TipoNotificacao.info);
            }
            else
            {
                string resultado = FNotificao.AlertConfirm("Deseja Eliminar o Fármaco Selecionado?", TipoNotificacao.pergunta);

                if (resultado == "1")
                {
                    RetornoEstoque();
                    SomarTotal();
                    SomarItens();
                    LimparCampos();
                }
            }
        }
Пример #8
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();
                    }
                }
            }
        }