コード例 #1
0
 private void LimparCampos()
 {
     cliente_txt.Clear();
     email_txt.Clear();
     licenca_txt.Clear();
     dias_txt.Clear();
     Contato.Clear();
     CodCliente_txt.Clear();
 }
コード例 #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     NomeAluno.Clear();
     DataNasc.Clear();
     AnoEscolar.Clear();
     NomeResp.Clear();
     Contato.Clear();
     Email.Clear();
     button1.Enabled    = true;
     button2.Enabled    = true;
     TextBoxCpf.Enabled = true;
     TextBoxCpf.Text    = "";
 }
コード例 #3
0
        private void LimparCampos()
        {
            cliente_txt.Clear();
            email_txt.Clear();
            licenca_txt.Clear();
            dias_txt.Clear();
            Contato.Clear();

            AtivarOpcoes.IsChecked = false;
            manutencao_txt.Text    = null;
            suspensao_txt.Text     = null;
            mensagemManutenance_txt.Clear();
            DataSelecionada_dp.Text    = null;
            HorarioSelecionado_tp.Text = null;
        }
コード例 #4
0
        private void AddEquip_Click(object sender, RoutedEventArgs e)
        {
            //Criando objeto "CadastroEquip" a partir do método Models-CadastrarEquipamento:
            CadastrarEquipamento cadastrarEquip = new CadastrarEquipamento();

            cadastrarEquip.Cliente = Cliente.Text;
            cadastrarEquip.Contato = Contato.Text;
            cadastrarEquip.Email   = Email.Text;
            cadastrarEquip.Senha   = Senha.Text;
            cadastrarEquip.Dongle  = Dongle.Text;
            cadastrarEquip.SN      = SN.Text;
            cadastrarEquip.Data    = Data.Text;
            cadastrarEquip.Func    = Func.Text;
            cadastrarEquip.Tipo    = Tipo + ' ' + ParcNum.Text;
            cadastrarEquip.Obs     = Obs.Text;
            cadastrarEquip.Placa   = Placa.Text;
            cadastrarEquip.NomePc  = NomePc.Text;
            cadastrarEquip.Licença = Licença.Text;
            cadastrarEquip.FlopSec = FlopSec.Text;
            cadastrarEquip.Produto = TextTitulo.Text;
            cadastrarEquip.Mac     = "###";
            cadastrarEquip.Negócio = Negócio;

            try
            {
                //Validando campos que não podem ficar em branco:
                if (string.IsNullOrWhiteSpace(Cliente.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Cliente'");
                }
                if (string.IsNullOrWhiteSpace(Senha.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Contra Senha'");
                }
                if (string.IsNullOrWhiteSpace(Dongle.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Senha Dongle'");
                }
                if (string.IsNullOrWhiteSpace(SN.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Numero de Série'");
                }
                if (string.IsNullOrWhiteSpace(Tipo))
                {
                    throw new ApplicationException("Preencha o campo 'Tipo de Licença'");
                }
                if (string.IsNullOrWhiteSpace(Licença.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Licença'");
                }

                //Chama o procedimento que executa o comando SQL para escrever na tabela.
                cadastrarEquip.CadastrarEquip();

                //Limpa todos os campos:
                Cliente.Clear();
                Contato.Clear();
                Senha.Clear();
                Email.Clear();
                Dongle.Clear();
                SN.Clear();
                ParcNum.Clear();
                Func.Clear();
                Obs.Clear();
                Placa.Clear();
                Licença.Clear();
                FlopSec.Clear();
                NomePc.Clear();
            }

            catch (Exception erro)
            {
                new CaixaDeMensagem(erro.Message);
            }
        }
コード例 #5
0
        private void SalvarAlterações_Click(object sender, RoutedEventArgs e)
        {
            //Criando objeto "cadastrarSpot" a partir do método Models-CadastrarEquipamento:
            AtualizarCadastroEquipamento atualizar = new AtualizarCadastroEquipamento();

            atualizar.Cliente     = Cliente.Text;
            atualizar.Contato     = Contato.Text;
            atualizar.Email       = Email.Text;
            atualizar.Senha       = Senha.Text;
            atualizar.Dongle      = Dongle.Text;
            atualizar.SN          = SN.Text;
            atualizar.Data        = Data.Text;
            atualizar.Tipo        = Tipo.Text;
            atualizar.Func        = Func.Text;
            atualizar.Obs         = Obs.Text;
            atualizar.Placa       = Placa.Text;
            atualizar.NomePc      = NomePc.Text;
            atualizar.Licença     = Licença.Text;
            atualizar.FlopSec     = FlopSec.Text;
            atualizar.Produto     = Produto.Text;
            atualizar.Mac         = MacAdd.Text;
            atualizar.DataLicença = DataLicença.Text;

            if (string.IsNullOrEmpty(Negócio))
            {
                atualizar.Negócio = "Nulo";
            }
            else
            {
                atualizar.Negócio = Negócio;
            }

            try
            {
                //Validando campos que não podem ficar em branco:
                if (string.IsNullOrWhiteSpace(Cliente.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Cliente'");
                }
                if (string.IsNullOrWhiteSpace(Senha.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Contra Senha'");
                }
                if (string.IsNullOrWhiteSpace(Dongle.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Senha Dongle'");
                }
                if (string.IsNullOrWhiteSpace(SN.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Numero de Série'");
                }
                if (string.IsNullOrWhiteSpace(Tipo.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Tipo de Licença'");
                }
                if (string.IsNullOrWhiteSpace(Licença.Text))
                {
                    throw new ApplicationException("Preencha o campo 'Licença'");
                }

                //Chama o procedimento que executa o comando SQL para escrever na tabela.
                atualizar.AtualizarEquip();

                //Limpa todos os campos:
                Cliente.Clear();
                Contato.Clear();
                Senha.Clear();
                Email.Clear();
                Dongle.Clear();
                SN.Clear();
                Data.Clear();
                DataLicença.Clear();
                Tipo.Clear();
                Func.Clear();
                Obs.Clear();
                Placa.Clear();
                Licença.Clear();
                FlopSec.Clear();
                NomePc.Clear();
                MacAdd.Clear();
                Produto.Clear();
                Block_Garantia.Text    = " ";
                Block_Premium.Text     = " ";
                Block_Negócio.Text     = " ";
                RadVenda.IsChecked     = false;
                RadDemo.IsChecked      = false;
                RadAlguel.IsChecked    = false;
                RadFeira.IsChecked     = false;
                DataLicença.FontWeight = FontWeights.Regular;
                DataLicença.Foreground = Brushes.DimGray;
            }
            catch (Exception erro)
            {
                new CaixaDeMensagem(erro.Message);
            }
        }