private void buttonExcluir_Click(object sender, EventArgs e)
        {
            if (dataGridViewEntradaSaida.SelectedRows.Count > 0)
            {
                if (saida.strConfirmado == 'S')
                {
                    FormMessage.ShowMessegeWarning("Já foi confirmado o recebimento para este lançamento . " +
                                                   "Caso deseje cancelar, é necessário cancelar este recebimento antes!");
                    return;
                }

                if (FormMessage.ShowMessegeQuestion("Deseja cancelar este lançamento?") == DialogResult.Yes)
                {
                    pictureBoxLoad.Visible = true;
                    thread = new Thread(Desativar);
                    form1.ExecutarThread(thread);
                    this.Activate();
                    ExecutarConsulta();
                }
            }
            else
            {
                FormMessage.ShowMessegeInfo("Selecione um lançamento da lista!");
            }
        }
        private void buttonRemover_Click(object sender, EventArgs e)
        {
            if (dataGridViewPedido.SelectedRows.Count > 0)
            {
                GridPedidoInfo gridPedidoInfo = (GridPedidoInfo)dataGridViewPedido.SelectedRows[0].DataBoundItem;

                for (int i = 0; i < gridPedidoColecao.Count; i++)
                {
                    if (gridPedidoInfo.cod == gridPedidoColecao[i].cod)
                    {
                        gridPedidoColecao.RemoveAt(i);
                    }
                }

                dataGridViewPedido.DataSource = null;
                dataGridViewPedido.DataSource = gridPedidoColecao;

                ContarItens();
                textBoxProdutoCod.Select();
                buttonConfirmar.Enabled = true;
                buttonVenda.Enabled     = false;
            }
            else
            {
                FormMessage.ShowMessegeWarning("Selecione o item que deseja remover!");
            }
        }
Пример #3
0
 private void ButtonUnid_Click(object sender, EventArgs e)
 {
     if (infoUnid != null)
     {
         if (colecaoComp.Count < infoUnid.unicomputador)
         {
             Inserir();
         }
         else
         {
             if (VerificaComputador())
             {
                 Inserir();
             }
             else
             {
                 FormMessage.ShowMessegeWarning("Esta unidade possui a lincença para " + infoUnid.unicomputador + "e todas já estão ativas!");
             }
         }
     }
     else
     {
         Inserir();
     }
 }
Пример #4
0
        private void LostFocus_Subcategoria()
        {
            if (!string.IsNullOrEmpty(textBoxSub.Text))
            {
                if (int.TryParse(textBoxSub.Text, out int cod))
                {
                    ProdSubCategoriaInfo prodSubCategoriaInfo = produtoNegocios.ConsultarProdSubCategoriaId(cod);

                    if (prodSubCategoriaInfo != null)
                    {
                        textBoxSub.Text    = string.Format("{0:000}", prodSubCategoriaInfo.Prodsubcatid);
                        labelValorSub.Text = prodSubCategoriaInfo.Prodsubcatnome;

                        CodDescricaoInfo prodCategoriaInfo = produtoNegocios.ConsultarProdCategoriaId(prodSubCategoriaInfo.prodsubcatidcategoria);
                        textBoxCategoria.Text    = string.Format("{0:000}", prodCategoriaInfo.cod);
                        labelValorCategoria.Text = prodCategoriaInfo.descricao;
                    }
                    else
                    {
                        FormMessage.ShowMessegeWarning("Não foi encontrado, digite outro código!");
                        textBoxSub.Select();
                        textBoxSub.Clear();
                    }
                }
            }
        }
Пример #5
0
        private void ButtonSalvar_Click(object sender, EventArgs e)
        {
            if (Campos())
            {
                negocioAparelho = new AparelhoNegocio(Form1.Empresa.empconexao);

                if (iphoneCompraInfo == null)
                {
                    infoCelular.Pessoa = infoFornecedor;
                    infoCelular.Id     = negocioAparelho.InsertIphone(infoCelular);
                    PreencherInfo();
                    negocioAparelho.InsertIphoneCompra(iphoneCompraInfo);
                }
                else
                {
                }

                FormMessage.ShowMessegeInfo("Registro salva com sucesso!");
                this.DialogResult = DialogResult.Yes;
            }
            else
            {
                FormMessage.ShowMessegeWarning("Informe os valores de compra de venda e compra!");
            }
        }
Пример #6
0
        private bool CamposObrigatorios()
        {
            string aviso = "O preenchimento dos campos abaixo é obrigatório!";
            bool   campo = true;

            if (string.IsNullOrEmpty(textBoxContaCod.Text))
            {
                aviso = Environment.NewLine + labelDestino.Text;
                campo = false;
            }

            if (!decimal.TryParse(textBoxValor.Text, out decimal cod))
            {
                if (!(cod > 0))
                {
                    aviso = Environment.NewLine + labelSangria.Text;
                    campo = false;
                }
            }

            if (!campo)
            {
                FormMessage.ShowMessegeWarning(aviso);
            }

            return(campo);
        }
Пример #7
0
        private void ButtonBuscar_Click(object sender, EventArgs e)
        {
            string cpf = maskedTextBoxCpf.Text;

            if (!string.IsNullOrEmpty(cpf))
            {
                negocioUser  = new UserNegocio(Form1.Empresa.empconexao);
                negocioEmail = new EmailNegocio(Form1.EmpresaEmail, Form1.Empresa.empfantasia);
                pessoa       = negocioUser.ConsultarPessoaCpf(cpf);

                if (pessoa != null)
                {
                    labelNome.Text  = "Nome: " + pessoa.pssnome;
                    labelEmail.Text = "E-mail: " + pessoa.pssemail;

                    user = negocioUser.ConsultarUsuarioFuncId(pessoa.pssid);

                    buttonBuscar.Enabled = false;
                    buttonEmail.Enabled  = true;
                }
                else
                {
                    buttonBuscar.Enabled = true;
                    buttonEmail.Enabled  = false;
                    FormMessage.ShowMessegeWarning("Ninguém foi encontrado!");
                }
            }
        }
Пример #8
0
        private void CriarFuncoes(KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            default:
                if (VendaAtiva)
                {
                    switch (e.KeyCode)
                    {
                    case Keys.F6:
                        textBoxQuant.Select();
                        break;

                    case Keys.F7:
                        textBoxBarras.Select();
                        break;

                    case Keys.F12:

                        if (!(dataGridViewItens.Rows.Count > 0))
                        {
                            FormMessage.ShowMessegeWarning("Nenhum item foi lançado!");
                            return;
                        }

                        ConcluirVenda();
                        break;

                    default:
                        break;
                    }
                }
                break;
            }
        }
        private void Loja_Leave()
        {
            if (!string.IsNullOrEmpty(textBoxCodLoja.Text))
            {
                if (int.TryParse(textBoxCodLoja.Text, out int cod))
                {
                    EletroLojaInfo loja = negocioServ.ConsultarEletroLojaId(cod);

                    if (loja != null)
                    {
                        textBoxCodLoja.Text     = string.Format("{0:000}", cod);
                        labelLojaDescricao.Text = loja.LojDescricao;
                    }
                    else
                    {
                        textBoxCodLoja.Text     = string.Empty;
                        labelLojaDescricao.Text = string.Empty;
                    }
                }
                else
                {
                    FormMessage.ShowMessegeWarning("Insira um valor numérico!");
                    textBoxCodLoja.Text     = string.Empty;
                    labelLojaDescricao.Text = string.Empty;
                }
            }
        }
Пример #10
0
        private void ButtonSalvar_Click(object sender, EventArgs e)
        {
            if (CampoObrigatorio())
            {
                PreencherCelular();

                if (this.Modal)
                {
                    if (string.IsNullOrEmpty(maskedTextBoxImei.Text) || maskedTextBoxImei.Text.Length < 15)
                    {
                        FormMessage.ShowMessegeWarning("Insira o IMEI do aparelho!");
                        labelImei.ForeColor = Color.Red;
                        maskedTextBoxImei.Select();
                        return;
                    }

                    SelecionadoIphone = cel;
                    this.DialogResult = DialogResult.Yes;
                }
                else
                {
                    FormAparelhoMenu.SelecionadoAparelho = cel;
                    this.Close();
                    Application.OpenForms["FormAparelhoMenu"].DialogResult = DialogResult.Yes;
                }

                //thread = new Thread(Salvar);
                //form1.ExecutarThread(thread);
            }
        }
Пример #11
0
        private void Login()
        {
            int log = accessLogin.LoginAutentic(login);

            switch (log)
            {
            case 0:
                FormMessage.ShowMessegeWarning("Senha ou login incorreto!");
                break;

            case 1:
                if (checkBoxSalvarLogin.Checked)
                {
                    serializarNegocios.SerializarObjeto(Form1.User, FileNameLogin);
                }
                else
                {
                    serializarNegocios.ExcluirArquivo(FileNameLogin);
                }

                this.DialogResult = DialogResult.Yes;
                break;

            case 2:
                FormMessage.ShowMessegeWarning("Senha ou login incorreto!");
                break;

            case 3:
                FormMessage.ShowMessegeWarning("Você está bloqueado!");
                break;

            default:
                break;
            }
        }
        private void ExecuteTurnoAbrir()
        {
            Caixa caixa = new Caixa();

            caixaAbrirInfo = caixa.CaixaAberto();
            int numTurno = 1;

            if (caixaTurnoColacao != null)
            {
                numTurno = caixaTurnoColacao.Count + 1;
            }

            CaixaTurnoInfo turnoSalvar = new CaixaTurnoInfo
            {
                caixaturnonum         = numTurno,
                caixaturnoidabrir     = caixaAbrirInfo.caixaabririd,
                caixaturnoidfuncabrir = Form1.User.useidfuncionario,
                caixaturnovalorabrir  = Convert.ToDecimal(textBoxValor.Text),
            };

            if (caixaNegocios.InsertCaixaTurno(turnoSalvar) > 0)
            {
                FormMessage.ShowMessegeInfo("O turno foi aberto com sucesso!");
                this.DialogResult = DialogResult.Yes;
            }
            else
            {
                FormMessage.ShowMessegeWarning("Falha ao tentar abrir o turno!");
            }
        }
        private void ExecuteCaixaAbrir()
        {
            if (FormMessage.ShowMessegeQuestion("Deseja abrir o caixa?") == DialogResult.Yes)
            {
                CaixaAbrirInfo caixaAbrir = new CaixaAbrirInfo
                {
                    caixaabrirdata      = DateTime.Now,
                    caixaabririd        = 0,
                    caixaabriridfunc    = Form1.User.useidfuncionario,
                    caixaabrirvalor     = Convert.ToDecimal(textBoxValor.Text),
                    caixaabriridunidade = Form1.Unidade.uniid
                };

                if (caixaNegocios.InsertCaixaAbrir(caixaAbrir) > 0)
                {
                    ExecuteTurnoAbrir();
                    FormMessage.ShowMessegeInfo("O caixa foi aberto com sucesso!");
                    this.DialogResult = DialogResult.Yes;
                }
                else
                {
                    FormMessage.ShowMessegeWarning("Falha ao tentar abrir o caixa!");
                }
            }
        }
        private void textBoxCategoriaCod_Leave(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBoxCategoriaCod.Text))
            {
                textBoxCategoriaCod.Text = "000";
            }
            else
            {
                if (int.TryParse(textBoxCategoriaCod.Text, out int cod))
                {
                    if (cod > 0)
                    {
                        CodDescricaoInfo codDescricaoInfo = entradaSaidaNegocios.ConsultarEntradaSaidaCategoriaId(cod);

                        if (codDescricaoInfo != null)
                        {
                            textBoxCategoriaCod.Text     = string.Format("{0:000}", codDescricaoInfo.cod);
                            labelCategoriaDescricao.Text = codDescricaoInfo.descricao;
                            buttonBuscar.Select();
                        }
                        else
                        {
                            FormMessage.ShowMessegeWarning("Código não identificado!");
                            textBoxCategoriaCod.Text     = "000";
                            labelCategoriaDescricao.Text = "Todas as categorias";
                            textBoxCategoriaCod.Select();
                        }
                    }
                }
            }
        }
Пример #15
0
        private void FormIphoneModelo_Load(object sender, EventArgs e)
        {
            colecaoCores = negocioServ.ConsultarIphoneCorColecao();

            colecaoIpad   = new IphoneModeloColecao();
            colecaoIphone = new IphoneModeloColecao();

            foreach (IphoneModeloInfo phone in Form1.IphoneColecao)
            {
                if (phone.iphmodipad)
                {
                    colecaoIpad.Add(phone);
                }
                else
                {
                    colecaoIphone.Add(phone);
                }
            }

            colecaoCor = Form1.IphoneCorColecao;
            comboBoxModelo.DataSource    = colecaoIphone;
            comboBoxModelo.SelectedIndex = -1;
            cod = 1;

            if (colecaoCor == null)
            {
                FormMessage.ShowMessegeWarning("O formulário ainda não está pronto, tente mais tarde!");
                this.DialogResult = DialogResult.Cancel;
            }
        }
        private void Autorizada_Leave()
        {
            if (!string.IsNullOrEmpty(textBoxCodAutorizada.Text))
            {
                if (int.TryParse(textBoxCodAutorizada.Text, out int cod))
                {
                    AutorizadaInfo auto = negocioServ.ConsultarAutorizadaId(cod);

                    if (auto != null)
                    {
                        textBoxCodAutorizada.Text     = string.Format("{0:000}", cod);
                        labelAutorizadaDescricao.Text = auto.autnome;
                    }
                    else
                    {
                        textBoxCodAutorizada.Text     = string.Empty;
                        labelAutorizadaDescricao.Text = string.Empty;
                    }
                }
                else
                {
                    FormMessage.ShowMessegeWarning("Insira um valor numérico!");
                    textBoxCodAutorizada.Text     = string.Empty;
                    labelAutorizadaDescricao.Text = string.Empty;
                }
            }
        }
Пример #17
0
        private void Salvar()
        {
            CaixaNegocios  caixaNegocios  = new CaixaNegocios(Form1.Empresa.empconexao);
            CaixaAbrirInfo caixaAbrirInfo = caixaNegocios.ConsultarCaixaAberto(Form1.Unidade.uniid);
            Caixa          caixa          = new Caixa();
            CaixaTurnoInfo caixaTurnoInfo = caixa.ConsultarTurnoAberto();

            SangriaInfo sangriaInfo = new SangriaInfo
            {
                sangriadatacad   = DateTime.Now,
                sangriaid        = 0,
                sangriaidcaixa   = caixaAbrirInfo.caixaabririd,
                sangriaidfunc    = Form1.User.useidfuncionario,
                sangriaidtipo    = contaCod,
                sangriaidunidade = caixaAbrirInfo.caixaabriridunidade,
                sangriaobs       = obs,
                sangriavalor     = valor,
                sangriaidturno   = caixaTurnoInfo.caixaturnoid
            };

            if (caixaNegocios.InsertSangria(sangriaInfo) > 0)
            {
                Form1.encerrarThread = true;
                FormMessage.ShowMessegeInfo("Salvo com sucesso.");
                this.Close();
            }
            else
            {
                Form1.encerrarThread = true;
                FormMessage.ShowMessegeWarning("Falha ao tentar salvar!");
            }


            pictureBoxLoad.Visible = false;
        }
        private void buttonSalvar_Click(object sender, EventArgs e)
        {
            if (!(string.IsNullOrEmpty(textBoxCodAutorizada.Text) || string.IsNullOrEmpty(textBoxCodEletro.Text) ||
                  string.IsNullOrEmpty(textBoxCodLoja.Text) || string.IsNullOrEmpty(textBoxNotaNome.Text) || string.IsNullOrEmpty(textBoxNotaS.Text) ||
                  string.IsNullOrEmpty(textBoxNotaN.Text)))
            {
                if (infoNota == null)
                {
                    PreencherNotaInfo();
                    thread = new Thread(Salvar);
                    form1.ExecutarThread(thread);
                    this.Activate();
                }
                else
                {
                    int idnota = infoNota.notId;
                    PreencherNotaInfo();
                    infoNota.notId = idnota;
                    thread         = new Thread(Alterar);
                    form1.ExecutarThread(thread);
                    this.Activate();
                }

                if (idSave > 0)
                {
                    NumNota = idSave;
                    FormMessage.ShowMessegeInfo("Nota salva com sucesso!");
                    this.DialogResult = DialogResult.Yes;
                }
            }
            else
            {
                FormMessage.ShowMessegeWarning("Preencher os campos obrigatórios!");
            }
        }
        private void buttonInicializar_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(textBoxFornecedorCod.Text))
            {
                estoqueLancamentoInfo = new EstoqueLancamentoInfo
                {
                    estoquelancamentoid       = 0,
                    estoquelancamentodatahora = DateTime.Now
                };

                negocioEstoque = new EstoqueNegocios(Form1.Empresa.empconexao, Form1.Unidade.uniassistencia);
                estoqueLancamentoInfo.estoquelancamentoid = negocioEstoque.InsertEstoqueLancamento(estoqueLancamentoInfo, Form1.Unidade.uniid);

                if (!string.IsNullOrEmpty(textBoxFornecedorCod.Text) && estoqueLancamentoInfo.estoquelancamentoid > 0) //o número 1 é referente a compra de mercadoria
                {
                    labelValorCod.Text             = string.Format("{0:000000}", estoqueLancamentoInfo.estoquelancamentoid);
                    labelValorData.Text            = estoqueLancamentoInfo.estoquelancamentodatahora.ToLongDateString();
                    textBoxFornecedorCod.Enabled   = false;
                    buttonAddFornecedor.Enabled    = false;
                    buttonBuscarFornecedor.Enabled = false;
                    buttonInicializar.Enabled      = false;

                    groupBoxItem.Enabled = true;
                    textBoxProdutoCod.Select();
                }

                buttonFechar.Text = "&Cancel.";
                Cancelar          = true;
            }
            else
            {
                FormMessage.ShowMessegeWarning("Selecione um fornecedor!");
                textBoxFornecedorCod.Select();
            }
        }
Пример #20
0
        private void maskedTextBoxCep_TextChanged(object sender, EventArgs e)
        {
            if (maskedTextBoxCep.Text.Length > 7)
            {
                CepInfo cepInfo = new CepInfo();

                cepInfo = clienteNegocios.ConsultarCep(maskedTextBoxCep.Text);

                if (cepInfo != null)
                {
                    textBoxLogradouro.Text = cepInfo.Logradouro;
                    textBoxBairro.Text     = cepInfo.Bairro;
                    textBoxCidade.Text     = cepInfo.Cidade;
                    textBoxUF.Text         = cepInfo.Uf;
                    textBoxIdent.Text      = cepInfo.Bairro;
                    textBoxIdent.Enabled   = true;
                }
                else
                {
                    FormMessage.ShowMessegeWarning("CEP não encontrado, tente outro CEP!");
                }
            }
            else
            {
                textBoxLogradouro.Clear();
                textBoxBairro.Clear();
                textBoxCidade.Clear();
                textBoxUF.Clear();
            }
        }
Пример #21
0
        private void ButtonEmail_Click(object sender, EventArgs e)
        {
            if (pessoa.pssemail == "*****@*****.**")
            {
                FormMessage.ShowMessegeWarning("O email não é válido,  não será possível enviar o email!");
                return;
            }

            string mensagem = string.Empty;

            mensagem += "Segue abaixo o seu login e senha," + Environment.NewLine;
            mensagem += Environment.NewLine;
            mensagem += "Login: "******"Senha: " + user.usesenha + Environment.NewLine;
            mensagem += Environment.NewLine;
            mensagem += Environment.NewLine;
            mensagem += "Att," + Environment.NewLine;
            mensagem += "LevitSoft Soluções.";

            if (negocioEmail.EnviarEmailBasico(pessoa.pssemail, "Esqueci minha senha!", mensagem))
            {
                this.DialogResult = DialogResult.Yes;
            }
            else
            {
                this.DialogResult = DialogResult.Abort;
            }
        }
Пример #22
0
        private void buttonSalvar_Click(object sender, EventArgs e)
        {
            if (!CamposPreenchidos())
            {
                int cod;
                PreencherUnidade();

                cod            = empresaNegocios.InsertUnidade(unidadeInfo);
                textBoxId.Text = string.Format("{0:000000}", cod);

                if (cod > 0)
                {
                    FormMessage.ShowMessegeInfo("Salvo com sucesso!");
                    buttonSalvar.Enabled = false;
                }
                else
                {
                    FormMessage.ShowMessegeWarning("Não foi possível salvar!");
                }
            }
            else
            {
                FormMessage.ShowMessegeWarning("Preencha todos os campos!");
            }
        }
        private bool CamposObrigatorio()
        {
            string campos     = string.Empty;
            bool   confCampos = true;

            if (string.IsNullOrEmpty(textBoxCodCat.Text))
            {
                campos    += "\nCategoria";
                confCampos = false;
            }

            if (string.IsNullOrEmpty(textBoxObs.Text))
            {
                campos    += "\nObservações";
                confCampos = false;
            }

            if (!(Convert.ToDecimal(textBoxValor.Text) > 0))
            {
                campos    += "\nValor do lançamento";
                confCampos = false;
            }

            if (confCampos)
            {
                return(confCampos);
            }
            else
            {
                FormMessage.ShowMessegeWarning("Preenchar os campos abaixo: " + campos);
                return(confCampos);
            }
        }
Пример #24
0
        private int InserirVenda()
        {
            vendaInfo.venidstatus = 2;
            vendaInfo.venid       = vendaNegocios.InsertVenda(vendaInfo);

            if (vendaInfo.venid > 0)
            {
                foreach (VendaDetalhesInfo vendaDetalhesInfo in vendacolecao)
                {
                    vendaDetalhesInfo.vendetalhesidvenda = vendaInfo.venid;

                    if (vendaNegocios.InsertVendaDetalhes(vendaDetalhesInfo) == 0)
                    {
                        FormMessage.ShowMessegeWarning("Falha ao salvar os itens!");
                        return(0);
                    }
                }

                VendaConcluida = vendaInfo;
                return(vendaInfo.venid);
            }
            else
            {
                return(0);
            }
        }
        private void PesquisarThread()
        {
            if (!string.IsNullOrEmpty(palavraPesquisa))
            {
                colecaoGrid = new GridServicoColecao();

                if (radio)
                {
                    if (int.TryParse(palavraPesquisa, out int cod))
                    {
                        GridServicoInfo grid = negocioServ.ConsultarGridServicoOs(cod);

                        if (grid != null)
                        {
                            colecaoGrid.Add(grid);
                        }
                    }
                    else
                    {
                        FormMessage.ShowMessegeWarning("Insira um valor válido!");
                    }
                }
                else
                {
                    colecaoGrid = negocioServ.ConsultarGridServicoCliente(palavraPesquisa);
                }
            }
            else
            {
                colecaoGrid = negocioServ.ConsultarGridServicoDia();
            }

            Form1.encerrarThread   = true;
            pictureBoxLoad.Visible = false;
        }
Пример #26
0
        private bool CampoObrigatorio()
        {
            if (string.IsNullOrEmpty(textBoxPara.Text))
            {
                FormMessage.ShowMessegeWarning("Informe o email de destino!");
                textBoxPara.Select();
                return(false);
            }

            if (string.IsNullOrEmpty(textBoxAssunto.Text))
            {
                FormMessage.ShowMessegeWarning("Informe o assunto!");
                textBoxAssunto.Select();
                return(false);
            }

            if (string.IsNullOrEmpty(textBoxMessage.Text))
            {
                FormMessage.ShowMessegeWarning("Informe a mensagem que deseja enviar!");
                textBoxMessage.Select();
                return(false);
            }

            return(true);
        }
Пример #27
0
        private void buttonRemover_Click(object sender, EventArgs e)
        {
            if (dataGridViewItens.SelectedRows.Count > 0)
            {
                for (int i = 0; i < colecaoItemVenda.Count; i++)
                {
                    if (itemSelecionando.Id > 0)
                    {
                        if (itemSelecionando.Id == colecaoItemVenda[i].Id)
                        {
                            colecaoItemVenda.RemoveAt(i);
                            AdicionarItemGrid();
                            break;
                        }
                    }
                    else
                    {
                        if (itemSelecionando.Barras == colecaoItemVenda[i].Barras)
                        {
                            colecaoItemVenda.RemoveAt(i);
                            AdicionarItemGrid();
                            break;
                        }
                    }
                }

                textBoxBarras.Select();
            }
            else
            {
                FormMessage.ShowMessegeWarning("Selecione o produto que deseja excluir!");
            }
        }
Пример #28
0
        private void Consultar(object txt)
        {
            TextBox box = (TextBox)txt;


            FormPessoaConsultar formPessoaConsultar = new FormPessoaConsultar(true);

            if (formPessoaConsultar.ShowDialog(this) == DialogResult.Yes)
            {
                infoPessoa = formPessoaConsultar.SelecionadoCliente;

                if (infoPessoa.pssemail == "*****@*****.**")
                {
                    FormMessage.ShowMessegeWarning("A pessoa selecionada não possui e-mail cadastrado!");
                    return;
                }

                string novoEmail = FormTextoFormat.PrimeiroNome(infoPessoa.pssnome) + " - " + infoPessoa.pssemail;
                if (string.IsNullOrEmpty(box.Text))
                {
                    box.Text = novoEmail;
                }
                else
                {
                    box.Text += ";" + novoEmail;
                }

                box.Select();
                box.SelectionStart = box.Text.Length;
            }
        }
Пример #29
0
        private void AddPagamento()
        {
            if (Convert.ToDecimal(textBoxForma.Text) > 0)
            {
                if (decimal.TryParse(textBoxValor.Text, out decimal cod))
                {
                    GridFormaPagamentoInfo gridFormaPagamentoInfo = new GridFormaPagamentoInfo
                    {
                        pagband          = Convert.ToInt32(comboBoxBandeira.SelectedValue),
                        pagbanddescricao = comboBoxBandeira.Text,
                        pagdescricao     = labelValorForma.Text,
                        pagid            = Convert.ToInt32(textBoxForma.Text),
                        pagtipo          = Convert.ToInt32(comboBoxTipo.SelectedValue),
                        pagvalor         = Convert.ToDecimal(textBoxValor.Text),
                        parcela          = comboBoxTipo.Text + "/" + comboBoxParcela.Text,
                        parc             = Convert.ToInt32(comboBoxParcela.Text.Replace("x", ""))
                    };

                    gridFormaPagamentoColecao.Add(gridFormaPagamentoInfo);
                    PreencherGrid();
                }
                else
                {
                    FormMessage.ShowMessegeWarning("Insira um valor válido!");
                    textBoxValor.Clear();
                }
            }
            else
            {
                FormMessage.ShowMessegeWarning("Defina a forma de pagamento!");
            }
        }
Пример #30
0
        private void Logar()
        {
Iniciar:
            if (!(string.IsNullOrEmpty(textBoxLogin.Text) || string.IsNullOrEmpty(maskedTextBoxSenha.Text)))
            {
                if (!string.IsNullOrEmpty(labelUnidadeDescricao.Text))
                {
                    login[0] = textBoxLogin.Text;
                    login[1] = maskedTextBoxSenha.Text;
                    Login();
                }
                else
                {
                    FormMessage.ShowMessegeWarning("Selecione uma unidade!");
                    if (ConsultarUnidade())
                    {
                        goto Iniciar;
                    }
                }
            }
            else
            {
                FormMessage.ShowMessegeWarning("Digite o seu LOGIN E SENHA!");
            }
        }