public ActionResult DenunciarFoco(string txtEndereco, string txtBairro, string txtDescricao, string txtDoentes) { FocoDengue f = new FocoDengue { Usuario = "Anonimo", Endereco = txtEndereco, Bairro = txtBairro, Descricao = txtDescricao, Doentes = txtDoentes }; if (DenunciaDAO.DenunciarFoco(f)) { return(RedirectToAction("Index", "Denuncia")); } //if (DenunciaDAO.BuscarUsuarioporNome(txtNomeUsuario) == null && UsuarioDAO.BuscarUsuarioporCPF(u) == null) //{ // DenunciaDAO.DenunciarFoco(f); //return RedirectToAction("Index", "Home"); //} else { return(View()); } }
public ActionResult RemoverDenuncia(int id) { if (id != 0) { DenunciaDAO.RemoverDenuncia(id); } return(RedirectToAction("Index", "Home")); }
public static DenunciaDAO GetDenunciaDAO() { if (denunciaDAO == null) { denunciaDAO = new DenunciaDAO(); } return(denunciaDAO); }
public ActionResult CadastrarDenuncia(Denuncia denuncia) { denuncia.AnimalId = Convert.ToInt32(TempData["AnimalId"]); denuncia.DataDenuncia = DateTime.Now; if (ModelState.IsValid) { if (denuncia.AnimalId != 0) { DenunciaDAO.CadastrarDenuncia(denuncia); return(RedirectToAction("DetalhesAnimal", "Home", new { id = denuncia.AnimalId })); } ModelState.AddModelError("", "Não foi possível enviar a denuncia, volte para página inicial e tente novamente!"); } return(View(denuncia)); }
public Respuesta GenerarDenuncia(Denuncia denuncia) { Respuesta respuesta = new Respuesta(); if (Credenciales.IsValid()) { DenunciaDAO db = new DenunciaDAO(ConfigurationManager.ConnectionStrings["ConnStr"]); DataSet resultado = db.InsertarDenuncia(denuncia); respuesta.Codigo = 0; respuesta.Descripcion = "Exito"; } else { respuesta.Codigo = 404; respuesta.Descripcion = "Error"; } return(respuesta); }
protected void btnRegistrar_Click(object sender, EventArgs e) { BDComun.ObtenerConexion(); // txbIdTipoDen.Text = GenerarRandom(); denunciaVO.IdTipoDenuncia = ddlTipoDen.SelectedItem.Value; denunciaVO.IdDenuncia = Convert.ToInt32(txbIdDenuncia.Text); //debe traer esta info automáticamente denunciaVO.DescDenuncia = txbDescDenuncia.Text; denunciaVO.PrioridadDenuncia = Convert.ToInt32(txbPriorDenuncia.Text); //Debe generar esta info automáticamente //denunciaVO.FechaDenuncia = Convert.ToDateTime(txbFechaDenuncia.Text); denunciaVO.Token = txbToken.Text; int resultado = DenunciaDAO.Agregar(denunciaVO); if (resultado > 0) { this.pnlMostrarDenuncia.Visible = true; this.pnlInsertarDen.Visible = false; this.lblMostrarToken.Text = txbToken.Text; } else { this.pnlInsertarDen.Visible = false; } /* this.tipoDenuncia = this.txbTipoDenuncia.Text; * this.descDenuncia = this.txbDescDenuncia.Text; * this.fechaDenuncia = this.txbFechaDenuncia.Text; * * this.pnlMostrarDenuncia.Visible = true; * this.pnlInsertarDen.Visible = false; * * this.lblTipoDenuncia2.Text = this.tipoDenuncia; * this.lblDescDenuncia2.Text = this.descDenuncia; * this.lblFechaDenuncia2.Text = this.fechaDenuncia;*/ }
protected void btnConsultarDen_Click(object sender, EventArgs e) { BDComun.ObtenerConexion(); denToken = txbConsultarDen.Text; List <DenunciaVO> denuncia = DenunciaDAO.Buscar(denToken); if (denuncia.Count > 0 && denuncia != null) { GridViewConsDen.DataSource = denuncia; GridViewConsDen.DataBind(); } /* * txbToken.Text = denuncia[0].Token; //denunciaVO.Token; * txbFechaDenuncia.Text = "hola";//String.Format("{0:MM/dd/yyyy}", denuncia[1].FechaDenuncia);//denunciaVO.FechaDenuncia; * txbDescripcion.Text = denuncia[2].DescDenuncia;//denunciaVO.DescDenuncia;*/ this.pnlMostrarInfoDen.Visible = true; this.pnlConsultarDen.Visible = false; }
public Respuesta InsertarDenuncia(Denuncia denuncia) { Respuesta respuesta = new Respuesta(); DenunciaDAO db = new DenunciaDAO(ConfigurationManager.ConnectionStrings["conStr"]); DataSet resultado = db.Insertar(denuncia); if (resultado == null) { respuesta = new Respuesta() { Codigo = 404, Descripcion = "No se puede procesar la solicitud" } } ; respuesta = new Respuesta() { Codigo = 0, Descripcion = "La denuncia se inserto exitosamente" }; return(respuesta); } }
public ActionResult RemoverFoco(int?id) { DenunciaDAO.RemoverFoco(DenunciaDAO.BuscarFocoporId(id)); return(RedirectToAction("Index", "Denuncia")); }
// GET: Denuncia public ActionResult Index() { return(View(DenunciaDAO.RetornarListaFocos())); }
public ActionResult Index() { return(View(DenunciaDAO.BuscarDenuncias())); }