コード例 #1
0
        private void OnEdtCPF_Killfocus(object sender, Event e)
        {
            string    sCliente;
            ArrayList ConsCampo = new ArrayList();

            if (edtCPF.Value.Length > 0)
            {
                if (RotinasGlobais.Rotinas.ValidaCPF(edtCPF.Value))
                {
                    sCliente = RotinasGlobais.Rotinas.ConsultaCampoDesc(ConsCampo,
                                                                        ConsultasSQL.ConsSQL.Cliente('S', edtCPF.Value,
                                                                                                     "", "", "", "", "", "", "", "", ""), Resource.STR_CLINENC);
                    if (sCliente.Length == 0)
                    {
                        edtCPF.Clear();
                        edtCPF.SetFocus();
                    }
                    else
                    {
                        edtCliente.Value = sCliente;
                    }
                }
                else
                {
                    wx.MessageDialog.MessageBox(Resource.STR_CPFINV, "Erro",
                                                wx.Dialog.wxOK | wx.Dialog.wxICON_ERROR);
                    edtCPF.Clear();
                    edtCPF.SetFocus();
                }
            }
            else
            {
                edtCliente.Clear();
            }
        }
コード例 #2
0
 private void OnBtnLimpar(object sender, Event e)
 {
     edtCPF.Clear();
     edtCliente.Clear();
     edtISBN.Clear();
     edtLivro.Clear();
     gridVendas.ClearGrid();
     gridVendas.DeleteRows(0, gridVendas.NumberRows - 1, true);
     edtPrecoTotal.Value = "R$ 0,00";
     edtDtHrVenda.Value  = RotinasGlobais.Rotinas.retDataHoraStr(true, true);
     labRegistro.Label   = "Registro 0 de 0";
     edtDtHrVenda.SetFocus();
     e.Skip();
 }
コード例 #3
0
ファイル: CadLivros.cs プロジェクト: riquefsouza/livrusvirtus
        private void OnEdtCodAssunto_Killfocus(object sender, Event e)
        {
            string    sAssunto;
            ArrayList ConsCampo = new ArrayList();

            if (edtCodAssunto.Value.Length > 0)
            {
                sAssunto = RotinasGlobais.Rotinas.ConsultaCampoDesc(
                    ConsCampo, ConsultasSQL.ConsSQL.Assunto('S',
                                                            edtCodAssunto.Value, ""), Resource.STR_ASSNENC);
                if (sAssunto.Length > 0)
                {
                    edtAssunto.Value = sAssunto;
                }
                else
                {
                    edtCodAssunto.Clear();
                    edtCodAssunto.SetFocus();
                }
            }
            else
            {
                edtAssunto.Clear();
            }
        }
コード例 #4
0
ファイル: CadLivros.cs プロジェクト: riquefsouza/livrusvirtus
        private void OnEdtCodAutor_Killfocus(object sender, Event e)
        {
            string    sAutor;
            ArrayList ConsCampo = new ArrayList();

            if (edtCodAutor.Value.Length > 0)
            {
                sAutor = RotinasGlobais.Rotinas.ConsultaCampoDesc(ConsCampo,
                                                                  ConsultasSQL.ConsSQL.Autor('S',
                                                                                             edtCodAutor.Value, ""), Resource.STR_AUTNENC);
                if (sAutor.Length > 0)
                {
                    edtAutor.Value = sAutor;
                }
                else
                {
                    edtCodAutor.Clear();
                    edtCodAutor.SetFocus();
                }
            }
            else
            {
                edtAutor.Clear();
            }
        }
コード例 #5
0
ファイル: CadLivros.cs プロジェクト: riquefsouza/livrusvirtus
        private void OnEdtCodEditora_Killfocus(object sender, Event e)
        {
            string    sEditora;
            ArrayList ConsCampo = new ArrayList();

            if (edtCodEditora.Value.Length > 0)
            {
                sEditora = RotinasGlobais.Rotinas.ConsultaCampoDesc(ConsCampo,
                                                                    ConsultasSQL.ConsSQL.Editora('S',
                                                                                                 edtCodEditora.Value, ""), Resource.STR_EDTNENC);
                if (sEditora.Length > 0)
                {
                    edtEditora.Value = sEditora;
                }
                else
                {
                    edtCodEditora.Clear();
                    edtCodEditora.SetFocus();
                }
            }
            else
            {
                edtEditora.Clear();
            }
        }
コード例 #6
0
        private void OnEdtISBN_Killfocus(object sender, Event e)
        {
            string    sLivro;
            int       nQtdEstoque;
            ArrayList ConsCampo = new ArrayList();

            if (edtISBN.Value.Length > 0)
            {
                if (RotinasGlobais.Rotinas.ValidaISBN(edtISBN.Value))
                {
                    sLivro = RotinasGlobais.Rotinas.ConsultaCampoDesc(ConsCampo,
                                                                      ConsultasSQL.ConsSQL.Livro('Q', edtISBN.Value,
                                                                                                 "", "", "", "", "", "", "", "", ""), Resource.STR_LIVNENC);
                    if (sLivro.Length == 0)
                    {
                        edtISBN.Clear();
                        edtISBN.SetFocus();
                    }
                    else
                    {
                        edtLivro.Value = sLivro;
                        nQtdEstoque    = Int32.Parse(ConsCampo[3].ToString());
                        if (nQtdEstoque > 0)
                        {
                            RotinasGlobais.Rotinas.sPreco      = ConsCampo[2].ToString();
                            RotinasGlobais.Rotinas.sQtdEstoque = ConsCampo[3].ToString();
                        }
                        else
                        {
                            wx.MessageDialog.MessageBox(Resource.STR_LIVNEST, "Erro",
                                                        wx.Dialog.wxOK | wx.Dialog.wxICON_ERROR);
                        }
                    }
                }
                else
                {
                    wx.MessageDialog.MessageBox(Resource.STR_ISBNINV, "Erro",
                                                wx.Dialog.wxOK | wx.Dialog.wxICON_ERROR);
                    edtISBN.Clear();
                    edtISBN.SetFocus();
                }
            }
            else
            {
                edtLivro.Clear();
            }
        }
コード例 #7
0
ファイル: Consultas.cs プロジェクト: riquefsouza/livrusvirtus
 protected void LimparDados()
 {
     labRegistro.Label = "Registro 0 de 0";
     gridConsulta.ClearGrid();
     gridConsulta.DeleteRows(0, gridConsulta.NumberRows - 1, true);
     edtDescricao.Clear();
     edtDescricao.SetFocus();
 }
コード例 #8
0
 public void OnBtnLimparClick(object sender, Event e)
 {
     edtSenhaAtual.Clear();
     edtNovaSenha.Clear();
     edtConfirmarSenha.Clear();
     edtSenhaAtual.SetFocus();
     e.Skip();
 }
コード例 #9
0
ファイル: Cadastros.cs プロジェクト: riquefsouza/livrusvirtus
 protected void NovoDado(string sTextoSql)
 {
     if (RotinasGlobais.Rotinas.ConsultaDadosLista(Registros, sTextoSql))
     {
         Campos            = (ArrayList)Registros[0];
         edtCodigo.Value   = Campos[0].ToString();
         edtCodigo.Enabled = false;
         edtDescricao.SetFocus();
     }
 }
コード例 #10
0
ファイル: CadLivros.cs プロジェクト: riquefsouza/livrusvirtus
 private void OnEdtPreco_Killfocus(object sender, Event e)
 {
     if (RotinasGlobais.Rotinas.ValidaFloat(
             RotinasGlobais.Rotinas.VirgulaParaPonto(edtPreco.Value, false)))
     {
         edtPreco.Value =
             RotinasGlobais.Rotinas.VirgulaParaPonto(edtPreco.Value, true);
     }
     else
     {
         edtPreco.Value = "0,01";
         edtPreco.SetFocus();
     }
 }
コード例 #11
0
        public frmAlterarSenha(wx.Window parent)
            : base(parent, -1, new Point(424, 292), new Size(257, 161),
                   wxTAB_TRAVERSAL, "")
        {
            ClientSize = new Size(249, 134);
            EVT_CLOSE(new EventListener(OnClose));

            labLogin = new wx.StaticText(this, (int)idt.ID_FRMALTERARSENHA_LABLOGIN,
                                         "Login: "******"",
                                       new Point(8, 24), new Size(100, 21));
            edtLogin.Enable(false);
            labSenhaAtual = new wx.StaticText(this, (int)idt.ID_FRMALTERARSENHA_LABSENHAATUAL,
                                              "Senha atual:", new Point(112, 8), new Size(60, 13));
            edtSenhaAtual = new wx.TextCtrl(this, (int)idt.ID_FRMALTERARSENHA_EDTSENHAATUAL,
                                            "", new Point(112, 24), new Size(100, 21), wx.TextCtrl.wxTE_PASSWORD);
            labNovaSenha = new wx.StaticText(this, (int)idt.ID_FRMALTERARSENHA_LABNOVASENHA,
                                             "Nova Senha:", new Point(8, 48), new Size(61, 13));
            edtNovaSenha = new wx.TextCtrl(this, (int)idt.ID_FRMALTERARSENHA_EDTNOVASENHA,
                                           "", new Point(8, 64), new Size(100, 21), wx.TextCtrl.wxTE_PASSWORD);
            labConfirmarSenha = new wx.StaticText(this,
                                                  (int)idt.ID_FRMALTERARSENHA_LABCONFIRMARSENHA, "Confirmar senha:",
                                                  new Point(112, 48), new Size(79, 13));
            edtConfirmarSenha = new wx.TextCtrl(this,
                                                (int)idt.ID_FRMALTERARSENHA_EDTCONFIRMARSENHA, "",
                                                new Point(112, 64), new Size(100, 21), wx.TextCtrl.wxTE_PASSWORD);
            btnSalvar = new wx.Button(this, (int)idt.ID_FRMALTERARSENHA_BTNSALVAR,
                                      "&Salvar", new Point(8, 104), new Size(75, 25));
            btnLimpar = new wx.Button(this, (int)idt.ID_FRMALTERARSENHA_BTNLIMPAR,
                                      "&Limpar", new Point(88, 104), new Size(75, 25));
            btnFechar = new wx.Button(this, (int)idt.ID_FRMALTERARSENHA_BTNFECHAR,
                                      "&Fechar", new Point(168, 104), new Size(75, 25));

            edtLogin.Value              = RotinasGlobais.Rotinas.sUsuarioLogin;
            edtSenhaAtual.MaxLength     = 10;
            edtNovaSenha.MaxLength      = 10;
            edtConfirmarSenha.MaxLength = 10;

            EVT_BUTTON((int)idt.ID_FRMALTERARSENHA_BTNSALVAR,
                       new EventListener(OnBtnSalvarClick));
            EVT_BUTTON((int)idt.ID_FRMALTERARSENHA_BTNLIMPAR,
                       new EventListener(OnBtnLimparClick));
            EVT_BUTTON((int)idt.ID_FRMALTERARSENHA_BTNFECHAR,
                       new EventListener(OnBtnFecharClick));

            FazLayout();
            edtSenhaAtual.SetFocus();
        }
コード例 #12
0
 private void OnEdtDtNasc_Killfocus(object sender, Event e)
 {
     if (edtDtNasc.Value.Length > 0)
     {
         if (!RotinasGlobais.Rotinas.validaDataHora(edtDtNasc.Value, true))
         {
             wx.MessageDialog.MessageBox(Resource.STR_DTHRINV, "Erro",
                                         wx.Dialog.wxOK | wx.Dialog.wxICON_ERROR);
             edtDtNasc.Value = RotinasGlobais.Rotinas.retDataHoraStr(true, false);
             edtDtNasc.SetFocus();
         }
     }
     else
     {
         edtDtNasc.Value = RotinasGlobais.Rotinas.retDataHoraStr(true, false);
     }
     e.Skip();
 }
コード例 #13
0
ファイル: Consultas.cs プロジェクト: riquefsouza/livrusvirtus
        public frmConsultas(wx.Window parent)
            : base(parent, -1, "Consulta de", new Point(0, 0), new Size(365, 263),
                   wxDEFAULT_DIALOG_STYLE | wxCAPTION | wxRESIZE_BORDER |
                   wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
        {
            SetIcon(new wx.Icon("xpms/livrus.xpm"));
            ClientSize = new Size(365, 263);
            Centre();

            labDescricao = new wx.StaticText(this, (int)idt.ID_FRMCONSULTAS_LABDESCRICAO,
                                             "Descrição:", new Point(8, 8), new Size(51, 13), 0);
            edtDescricao = new wx.TextCtrl(this, (int)idt.ID_FRMCONSULTAS_EDTDESCRICAO,
                                           "", new Point(8, 24), new Size(257, 21), 0);
            btnPesquisar = new wx.Button(this, (int)idt.ID_FRMCONSULTAS_BTNPESQUISAR,
                                         "&Pesquisar", new Point(272, 24), new Size(75, 25), 0);

            gridConsulta = new wx.Grid(this, (int)idt.ID_FRMCONSULTAS_GRIDCONSULTA,
                                       new Point(0, 56), new Size(365, 125), wx.Window.wxBORDER_SUNKEN);
            gridConsulta.CreateGrid(1, 2, wx.GridSelectionMode.wxGridSelectRows);
            gridConsulta.SetColLabelValue(0, "Código");
            gridConsulta.SetColSize(0, 80);
            gridConsulta.SetColLabelValue(1, "Descrição");
            gridConsulta.SetColSize(1, 180);
            gridConsulta.Editable = false;
            gridConsulta.HideCellEditControl();
            gridConsulta.ColLabelSize = 21;

            labRegistro = new wx.StaticText(this, (int)idt.ID_FRMCONSULTAS_LABREGISTRO,
                                            "Registro 0 de 0", new Point(8, 16), new Size(144, 13), 0);
            btnLimpar = new wx.Button(this, (int)idt.ID_FRMCONSULTAS_BTNLIMPAR,
                                      "&Limpar", new Point(16, 13), new Size(75, 25), 0);
            btnFechar = new wx.Button(this, (int)idt.ID_FRMCONSULTAS_BTNFECHAR,
                                      "&Fechar", new Point(75, 13), new Size(75, 25), 0);

            FazLayout();
            Registros    = new ArrayList();
            sSelecionado = "";
            edtDescricao.SetFocus();
        }