コード例 #1
0
        private void SalvarBoletim()
        {
            if (ValidarBoletim())
            {
                boletimOcorrencia = new BoletimOcorrencia(dtpDataOcorrencia.Text, dtpHoraInicio.Text, dtpSegHoraInicio.Text, dtpHoraTermino.Text,
                                                          dtpSegHoraTermino.Text, txtKmInicio.Text, txtSegKmInicio.Text, txtKmFim.Text, txtSegKmTermino.Text, cmbOcasiao.Text,
                                                          cmbNatOcorrencia.Text, txtBoPc.Text, Convert.ToInt32(cmbPlantao.SelectedValue), Convert.ToInt32(cmbEquipe.SelectedValue),
                                                          Convert.ToInt32(cmbViatura.SelectedValue), Convert.ToInt32(cmbMotorista.SelectedValue),
                                                          Convert.ToInt32(cmbEncarregado.SelectedValue), cmbAuxiliar.Text, txtEnderecoOcorrencia.Text);

                if (chkApoio.Checked == true)
                {
                    boletimOcorrencia.Viatura_Apoio    = Convert.ToInt32(cmbViaturaApoio.SelectedValue);
                    boletimOcorrencia.MotoristaApoio   = Convert.ToInt32(cmbMotoristaApoio.SelectedValue);
                    boletimOcorrencia.EncarregadoApoio = Convert.ToInt32(cmbEncarregadoApoio.SelectedValue);
                    boletimOcorrencia.AuxiliarApoio    = cmbAuxiliarApoio.Text;

                    boletimOcorrencia.InstituicaoApoio       = cmbApoio.Text;
                    boletimOcorrencia.MotoristaInstituicao   = txtMotoristaApoio.Text.Trim();
                    boletimOcorrencia.EncarregadoInstituicao = txtEncarregadoApoio.Text.Trim();
                }

                _boletimOcorrenciaServices.CadastrarBoletimOcorrencia(boletimOcorrencia);
                RetornarIDBoletim();
            }
        }
コード例 #2
0
 public string CadastrarBoletimOcorrencia(BoletimOcorrencia boletimOcorrencia)
 {
     _boletimOcorrenciaRepository = new BoletimOcorrenciaRepository();
     _boletimOcorrenciaRepository.CadastrarBoletimOcorrencia(boletimOcorrencia);
     return("Boletim cadastrado com sucesso!");
 }