protected void btnConcluir_Click(object sender, EventArgs e) { Acidente a = new Acidente(); a.preenchimentoCompleto = true; update(a); }
public override Socorro GerarSolicitacaoDeSocorro(Acidente acidente) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"Solicitação de socorro para o acidente: {acidente.Titulo}"); stringBuilder.AppendLine($"Número da solicitação de socorro: #{acidente.Id}"); stringBuilder.AppendLine($"Gerando solicitação de socorro para acidentes PEQUENOS."); switch (acidente.LocalAcidente) { case LocalAcidente.Terrestre: stringBuilder.AppendLine("O tipo de resgate será TERRESTRE."); break; case LocalAcidente.Marinho: stringBuilder.AppendLine("O tipo de resgate será MARINHO."); break; case LocalAcidente.Aereo: stringBuilder.AppendLine("O tipo de resgate será AÉREO."); break; default: throw new Exception("Local do acidente desconhecido!"); } return(new Socorro(mensagemSocorro: stringBuilder.ToString())); }
protected void btnSalvar_Click(object sender, EventArgs e) { Acidente a = new Acidente(); a.preenchimentoCompleto = false; update(a); }
public void save(Acidente f) { if (f.id == 0) { acordoPrevioBll.create(f); } else { acordoPrevioBll.update(f); } }
static void Main(string[] args) { Acidente acidentePequeno = new Acidente("Gato preso", "Gato preso em cima da árvore!", TipoAcidente.Pequeno, LocalAcidente.Terrestre); Acidente acidenteMedio = new Acidente("Batida de barcos", "Dois barcos se colidiram na praia XYZ as 2 horas da tarde.", TipoAcidente.Medio, LocalAcidente.Marinho); Acidente acidenteGrande = new Acidente("Queda de avião", "Avião sofre pane e cai durante a noite de segunda feira.", TipoAcidente.Grande, LocalAcidente.Aereo); Socorro socorroPequenoFactory = SocorroFactory.GerarFabricaDeSocorro(acidentePequeno.TipoAcidente); Socorro socorroMedioFactory = SocorroFactory.GerarFabricaDeSocorro(acidenteMedio.TipoAcidente); Socorro socorroGrandeFactory = SocorroFactory.GerarFabricaDeSocorro(acidenteGrande.TipoAcidente); var socorroPequeno = socorroPequenoFactory.GerarSolicitacaoDeSocorro(acidentePequeno); var socorroMedio = socorroMedioFactory.GerarSolicitacaoDeSocorro(acidenteMedio); var socorroGrande = socorroGrandeFactory.GerarSolicitacaoDeSocorro(acidenteGrande); socorroPequeno.ExibirSolicitacaoDeSocorro(); socorroMedio.ExibirSolicitacaoDeSocorro(); socorroGrande.ExibirSolicitacaoDeSocorro(); }
private void btnSalvar_Click(object sender, EventArgs e) { acidente = new Acidente(cmbTipoAcidente.Text, cmbTipoAcidente.Text, txtMarca.Text, txtModelo.Text, txtPlaca.Text, Convert.ToInt32(cmbUf.SelectedValue), txtCidade.Text, txtChassi.Text, txtCor.Text, txtAno.Text, txtPontoImpacto.Text, cmbDanos.Text, idBoletim); acidente.ColisaoFrontalDireita = colisao.ColisaoFrontalDireita; acidente.ColisaoFrontal = colisao.ColisaoFrontal; acidente.ColisaoFrontalEsquerda = colisao.ColisaoFrontalEsquerda; acidente.ColisaoLateralDireita = colisao.ColisaoLateralDireita; acidente.ColisaoLateralEsquerda = colisao.ColisaoLateralEsquerda; acidente.ColisaoLateralTrasDireita = colisao.ColisaoLateralTrasDireita; acidente.ColisaoLateralTrasEsquerda = colisao.ColisaoLateralTrasEsquerda; acidente.ColisaoTraseira = colisao.ColisaoTraseira; acidente.ColisaoTraseiraDireita = colisao.ColisaoTraseiraDireita; acidente.ColisaoTraseiraEsquerda = colisao.ColisaoTraseiraEsquerda; _acidenteServices = new AcidenteServices(_acidenteRespository); MessageBox.Show(_acidenteServices.CadastrarAcidente(acidente)); }
public virtual Socorro GerarSolicitacaoDeSocorro(Acidente acidente) => throw new NotImplementedException();
public override void Socorrer(Acidente acidente) { Console.Write($"\n\nAcidente: {acidente.Titulo}\n"); Console.Write($"Número da solicitação de socorro: #{Id}\n"); Console.Write("Gerando solicitação de socorro para acidentes GRANDES."); }
private void update(Acidente a) { try { FormularioBll formularioBll = new FormularioBll(); AcidenteBLL acidenteBll = new AcidenteBLL(); a.id = string.IsNullOrEmpty(hfId.Value) ? 0 : Convert.ToInt32(hfId.Value); a.formularioId = Convert.ToInt32(hfFormularioId.Value); a.questao_1 = rbQuestao_1.SelectedValue; a.obs_questao_1 = string.IsNullOrEmpty(txtObsQuestao_1.Text) ? null : txtObsQuestao_1.Text; a.questao_2 = rbQuestao_2.SelectedValue; a.obs_questao_2 = string.IsNullOrEmpty(txtObsQuestao_2.Text) ? null : txtObsQuestao_2.Text; a.obs_questao_3 = string.IsNullOrEmpty(txtObsQuestao_3.Text) ? null : txtObsQuestao_3.Text; a.questao_3 = rbQuestao_3.SelectedValue; a.obs_questao_4 = string.IsNullOrEmpty(txtObsQuestao_4.Text) ? null : txtObsQuestao_4.Text; a.questao_4 = rbQuestao_4.Text; a.obs_questao_5 = string.IsNullOrEmpty(txtObsQuestao_5.Text) ? null : txtObsQuestao_5.Text; a.questao_5 = rbQuestao_5.SelectedValue; a.questao_6 = rbQuestao_6.SelectedValue; a.obs_questao_6 = string.IsNullOrEmpty(txtObsQuestao_6.Text) ? null : txtObsQuestao_6.Text; a.questao_7 = rbQuestao_7.SelectedValue; a.obs_questao_7 = string.IsNullOrEmpty(txtObsQuestao_7.Text) ? null : txtObsQuestao_7.Text; a.questao_8 = rbQuestao_8.SelectedValue; a.obs_questao_8 = string.IsNullOrEmpty(txtObsQuestao_8.Text) ? null : txtObsQuestao_8.Text; a.questao_9 = rbQuestao_9.SelectedValue; a.obs_questao_9 = string.IsNullOrEmpty(txtObsQuestao_9.Text) ? null : txtObsQuestao_9.Text; a.questao_10 = rbQuestao_10.SelectedValue; a.obs_questao_10 = string.IsNullOrEmpty(txtObsQuestao_10.Text) ? null : txtObsQuestao_10.Text; a.questao_11 = rbQuestao_11.SelectedValue; a.obs_questao_11 = string.IsNullOrEmpty(txtObsQuestao_11.Text) ? null : txtObsQuestao_11.Text; a.questao_12 = rbQuestao_12.SelectedValue; a.obs_questao_12 = string.IsNullOrEmpty(txtObsQuestao_12.Text) ? null : txtObsQuestao_12.Text; a.questao_13 = rbQuestao_13.SelectedValue; a.obs_questao_13 = string.IsNullOrEmpty(txtObsQuestao_13.Text) ? null : txtObsQuestao_13.Text; a.questao_14 = rbQuestao_14.SelectedValue; a.obs_questao_14 = string.IsNullOrEmpty(txtObsQuestao_14.Text) ? null : txtObsQuestao_14.Text; a.questao_15 = rbQuestao_15.SelectedValue; a.obs_questao_15 = string.IsNullOrEmpty(txtObsQuestao_15.Text) ? null : txtObsQuestao_15.Text; a.questao_16 = rbQuestao_16.SelectedValue; a.obs_questao_16 = string.IsNullOrEmpty(txtObsQuestao_16.Text) ? null : txtObsQuestao_16.Text; a.questao_17 = rbQuestao_17.SelectedValue; a.obs_questao_17 = string.IsNullOrEmpty(txtObsQuestao_17.Text) ? null : txtObsQuestao_17.Text; a.questao_18 = rbQuestao_18.SelectedValue; a.obs_questao_18 = string.IsNullOrEmpty(txtObsQuestao_18.Text) ? null : txtObsQuestao_18.Text; a.questao_19 = rbQuestao_19.SelectedValue; a.obs_questao_19 = string.IsNullOrEmpty(txtObsQuestao_19.Text) ? null : txtObsQuestao_19.Text; a.questao_20 = rbQuestao_20.SelectedValue; a.obs_questao_20 = string.IsNullOrEmpty(txtObsQuestao_20.Text) ? null : txtObsQuestao_20.Text; a.consideracao = string.IsNullOrEmpty(txtConsideracoesFinais.Text) ? null : txtConsideracoesFinais.Text; a.obs_questao_22 = string.IsNullOrEmpty(txtObsQuestao_22.Text) ? null : txtObsQuestao_22.Text; acidenteBll.save(a); formularioBll.update(a.formularioId, UserControlHeader.linha, UserControlHeader.contrato, (a.preenchimentoCompleto == true ? true : false)); UserControlExecQuestao1.Salvar(a.formularioId); if (UserControlQuestao3_4.panelPrincipal3.Visible) { UserControlQuestao3_4.SaveQuestao3_4(a.formularioId); } if (UserControlQuestao5.panelPrincipal5.Visible) { UserControlQuestao5.Salvar(a.formularioId); } if (UserControlQuestao6.panelPrincipal6.Visible) { UserControlQuestao6.Salvar(a.formularioId); } UserControlQuestao7.Salvar(a.formularioId); UserControlOcorrenciaNet.Salvar(a.formularioId); if (UserControlQuestao11.panelPrincipal11.Visible) { UserControlQuestao11.Salvar(a.formularioId); } if (UserControlQuestao12.panelPrincipal12.Visible) { UserControlQuestao12.Salvar(a.formularioId); } if (UserControlQuestao14.panelPrincipal14.Visible) { UserControlQuestao14.Salvar(a.formularioId); } Util.Alertbootsrap("Dados atualizados", this, upSalvar); } catch (Exception ex) { Util.Alertbootsrap(string.Concat(ex.Message, " - ", ex.InnerException), this, upSalvar); } }
public string CadastrarAcidente(Acidente acidente) { _acidenteRepository = new AcidenteRepository(); _acidenteRepository.CadastrarAcidente(acidente); return("Acidente cadastrado com sucesso"); }
public static Acidente CreateAcidente(int id, string local, global::System.DateTime data, double valor) { Acidente acidente = new Acidente(); acidente.Id = id; acidente.Local = local; acidente.Data = data; acidente.Valor = valor; return acidente; }
public void AddToAcidentes(Acidente acidente) { base.AddObject("Acidentes", acidente); }