protected bool setEnviaMensaje() { bool retorno = false; YouCom.DTO.Mensajeria.MensajePropietarioDTO theMensajePropietarioDTO = new YouCom.DTO.Mensajeria.MensajePropietarioDTO(); theMensajePropietarioDTO.MensajeTitulo = TxtAsunto.Text; theMensajePropietarioDTO.MensajeDescripcion = TxtComentarios.Text; theMensajePropietarioDTO.MensajeFecha = DateTime.Now; theMensajePropietarioDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; theMensajePropietarioDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); theMensajePropietarioDTO.TheFamiliaOrigenDTO = myFamiliaDTO; myFamiliaDTO.IdFamilia = decimal.Parse(Session["FamiliaId"].ToString()); theMensajePropietarioDTO.TheFamiliaDestinoDTO = myFamiliaDTO; if (Session["MensajeId"] != null) { theMensajePropietarioDTO.IdPadre = decimal.Parse(Session["MensajeId"].ToString()); } theMensajePropietarioDTO.UsuarioIngreso = myUsuario.Rut; retorno = YouCom.bll.Mensajeria.MensajePropietarioBLL.Insert(theMensajePropietarioDTO); return(retorno); }
protected bool setEnviaIniciativa() { bool retorno = false; YouCom.DTO.Propuesta.PropuestaDTO thePropuestaDTO = new YouCom.DTO.Propuesta.PropuestaDTO(); YouCom.DTO.PropuestaEstadoDTO myPropuestaEstadoDTO = new YouCom.DTO.PropuestaEstadoDTO(); myPropuestaEstadoDTO.IdPropuestaEstado = 1; thePropuestaDTO.ThePropuestaEstadoDTO = myPropuestaEstadoDTO; thePropuestaDTO.NombrePropuesta = TxtNombreIniciativa.Text; thePropuestaDTO.DescripcionPropuesta = this.TxtDescripcion.Text; thePropuestaDTO.DireccionPropuesta = this.TxtDireccion.Text; thePropuestaDTO.FechaPropuesta = DateTime.Now; thePropuestaDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; thePropuestaDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); thePropuestaDTO.TheFamiliaDTO = myFamiliaDTO; thePropuestaDTO.UsuarioIngreso = myUsuario.Rut; retorno = YouCom.bll.PropuestaBLL.Insert(thePropuestaDTO); return(retorno); }
protected bool setEnviaForo() { bool retorno = false; YouCom.DTO.Foro.ForoComunidadDTO theForoComunidadDTO = new YouCom.DTO.Foro.ForoComunidadDTO(); theForoComunidadDTO.TituloForoComunidad = this.TxtTitulo.Text.ToUpper(); theForoComunidadDTO.DescripcionForoComunidad = this.TxtDescripcion.Text.ToUpper(); theForoComunidadDTO.FechaForoComunidad = DateTime.Now; theForoComunidadDTO.IdPadre = 0; theForoComunidadDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; theForoComunidadDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); theForoComunidadDTO.TheFamiliaDTO = myFamiliaDTO; YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO(); myCategoriaDTO.IdCategoria = decimal.Parse(ddlCategoria.SelectedValue); theForoComunidadDTO.TheCategoriaDTO = myCategoriaDTO; YouCom.DTO.Foro.ForoComunidadEstadoDTO myForoComunidadEstadoDTO = new YouCom.DTO.Foro.ForoComunidadEstadoDTO(); myForoComunidadEstadoDTO.IdForoComunidadEstado = 1; theForoComunidadDTO.TheForoComunidadEstadoDTO = myForoComunidadEstadoDTO; theForoComunidadDTO.UsuarioIngreso = myUsuario.Rut; bool respuesta = YouCom.bll.ForoComunidadBLL.Insert(theForoComunidadDTO); return(respuesta); }
protected void rptComentarios_ItemDataBound(object sender, RepeaterItemEventArgs e) { try { if (e.Item.DataItem != null) { Literal LitNombreConsultante = (Literal)e.Item.FindControl("LitNombreConsultante"); Literal LitCantidadRespuestas = (Literal)e.Item.FindControl("LitCantidadRespuestas"); YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamilia(((YouCom.DTO.Avisos.ComentarioAvisoDTO)e.Item.DataItem).TheFamiliaDTO.IdFamilia); LitNombreConsultante.Text = myFamiliaDTO.NombreCompleto; IList <YouCom.DTO.Avisos.ComentarioAvisoDTO> myComentarioAvisoDTO = new List <YouCom.DTO.Avisos.ComentarioAvisoDTO>(); myComentarioAvisoDTO = YouCom.bll.Avisos.ComentarioAvisoBLL.listaComentarioAvisoActivo(); LitCantidadRespuestas.Text = myComentarioAvisoDTO.Count().ToString(); } } catch (Exception ex) { } }
protected void rptMensajes_ItemCommand(object source, RepeaterCommandEventArgs e) { try { if (e.CommandName.Equals("Responder")) { YouCom.DTO.Mensajeria.MensajeDTO myMensajeDTO = new YouCom.DTO.Mensajeria.MensajeDTO(); YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); HiddenField HdnIdMensaje = (HiddenField)e.Item.FindControl("hdnIdMensaje"); Session.Add("MensajeId", HdnIdMensaje.Value); myMensajeDTO = YouCom.bll.Mensajeria.MensajeBLL.detalleMensaje(myFamiliaDTO.IdFamilia, decimal.Parse(HdnIdMensaje.Value)); if (myMensajeDTO.TheMensajeTipoDTO.NombreMensajeTipo == "Administración") { Response.Redirect("Contacto/MensajeAdministracion.aspx", true); } else if (myMensajeDTO.TheMensajeTipoDTO.NombreMensajeTipo == "Porteria") { Response.Redirect("Contacto/MensajePorteria.aspx", true); } else if (myMensajeDTO.TheMensajeTipoDTO.NombreMensajeTipo == "Propietario") { Response.Redirect("Contacto/MensajePropietario.aspx", true); } } } catch (Exception ex) { } }
protected void rptAutorizaciones_ItemCommand(object source, RepeaterCommandEventArgs e) { try { if (e.CommandName.Equals("Eliminar")) { HiddenField HdnIdAccesoHogar = (HiddenField)e.Item.FindControl("HdnIdAccesoHogar"); YouCom.DTO.AccesoHogar.AccesoHogarDTO myAccesoHogarDTO = new YouCom.DTO.AccesoHogar.AccesoHogarDTO(); myAccesoHogarDTO.IdAccesoHogar = decimal.Parse(HdnIdAccesoHogar.Value); myAccesoHogarDTO.UsuarioModificacion = myUsuario.Rut; if (YouCom.bll.AccesoHogar.AccesoHogarBLL.Delete(myAccesoHogarDTO)) { if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Autorización eliminada correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } } if (e.CommandName.Equals("ListaNegra")) { HiddenField HdnIdAccesoHogar = (HiddenField)e.Item.FindControl("HdnIdAccesoHogar"); YouCom.DTO.AccesoHogar.AccesoHogarDTO theAccesoHogarDTO = new YouCom.DTO.AccesoHogar.AccesoHogarDTO(); YouCom.DTO.Propietario.FamiliaDTO theFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); theFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); theAccesoHogarDTO = YouCom.bll.AccesoHogar.AccesoHogarBLL.detalleAccesoHogar(decimal.Parse(HdnIdAccesoHogar.Value)); YouCom.DTO.ListaNegraDTO theListaNegraDTO = new YouCom.DTO.ListaNegraDTO(); theListaNegraDTO.RutListaNegra = YouCom.Service.Generales.Formato.LimpiarRut(theAccesoHogarDTO.RutVisita.ToUpper()); theListaNegraDTO.NombreListaNegra = theAccesoHogarDTO.NombreVisita.ToUpper(); theListaNegraDTO.ApellidoPaternoListaNegra = ""; theListaNegraDTO.ApellidoMaternoListaNegra = ""; theListaNegraDTO.MotivoListaNegra = ""; theListaNegraDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; theListaNegraDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; theListaNegraDTO.TheFamiliaDTO = theFamiliaDTO; theListaNegraDTO.UsuarioIngreso = myUsuario.Rut; bool respuesta = YouCom.bll.ListaNegraBLL.Insert(theListaNegraDTO); if (respuesta) { string script = "alert('Autorización agregada como lista negra correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } else { } } } catch (Exception ex) { } }
protected void btnResponder_Click(object sender, EventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); btnResponder.Visible = false; btnGrabar.Visible = true; MensajeDirectivaDTO theMensajeDirectivaDTO = new MensajeDirectivaDTO(); theMensajeDirectivaDTO.MensajeTitulo = this.txtTituloMensaje.Text.ToUpper(); theMensajeDirectivaDTO.MensajeDescripcion = this.txtMensaje.Text.ToUpper(); theMensajeDirectivaDTO.MensajeFecha = DateTime.Now; theMensajeDirectivaDTO.IdPadre = decimal.Parse(this.hdnIdMensajeDirectiva.Value); YouCom.DTO.Mensajeria.MensajeTipoEnvioDTO myMensajeTipoEnvioDTO = new YouCom.DTO.Mensajeria.MensajeTipoEnvioDTO(); myMensajeTipoEnvioDTO.IdMensajeTipoEnvio = 2; theMensajeDirectivaDTO.TheMensajeTipoEnvioDTO = myMensajeTipoEnvioDTO; YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominioDTO.IdCondominio = decimal.Parse(ddlCondominio.SelectedValue); theMensajeDirectivaDTO.TheCondominioDTO = myCondominioDTO; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue); theMensajeDirectivaDTO.TheComunidadDTO = myComunidadDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO.IdFamilia = decimal.Parse(ddlFamilia.SelectedValue); theMensajeDirectivaDTO.TheFamiliaDTO = myFamiliaDTO; YouCom.DTO.DirectivaDTO myDirectivaDTO = new YouCom.DTO.DirectivaDTO(); myDirectivaDTO.IdDirectiva = decimal.Parse(ddlDirectiva.SelectedValue); theMensajeDirectivaDTO.TheDirectivaDTO = myDirectivaDTO; theMensajeDirectivaDTO.UsuarioIngreso = myUsuario.Rut; bool respuesta = YouCom.bll.Mensajeria.MensajeDirectivaBLL.Insert(theMensajeDirectivaDTO); if (respuesta) { cargarMensajeDirectiva(); this.txtTituloMensaje.Text = string.Empty; this.txtMensaje.Text = string.Empty; if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Mensaje respondido correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { } }
protected void cargarDatosPropietario() { YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); this.TxtNombre.Text = myFamiliaDTO.NombreFamilia; this.TxtPaterno.Text = myFamiliaDTO.ApellidoPaternoFamilia; }
protected void LnkBtnIngresaComentario_Click(object sender, EventArgs e) { PnlComentar.Visible = true; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); this.LitNombre.Text = myFamiliaDTO.NombreFamilia + " " + myFamiliaDTO.ApellidoPaternoFamilia + " " + myFamiliaDTO.ApellidoMaternoFamilia; this.TxtEmail.Text = myFamiliaDTO.EmailFamilia; }
protected void BtnEnviar_Click(object sender, EventArgs e) { try { if (Page.IsValid) { YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); YouCom.DTO.ContactoFamiliaDTO myContactoFamiliaDTO = new YouCom.DTO.ContactoFamiliaDTO(); //myContactoFamiliaDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; //myContactoFamiliaDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; myContactoFamiliaDTO.TheCasaDTO = myFamiliaDTO.TheCasaDTO; YouCom.DTO.Propietario.ParentescoDTO myParentescoDTO = new YouCom.DTO.Propietario.ParentescoDTO(); myParentescoDTO.IdParentesco = decimal.Parse(ddlParentesco.SelectedValue); myContactoFamiliaDTO.TheParentescoDTO = myParentescoDTO; myContactoFamiliaDTO.NombreContacto = this.TxtNombreIntegrante.Text; myContactoFamiliaDTO.TelefonoContacto = this.TxtTelefonoIntegrante.Text; myContactoFamiliaDTO.EmailContacto = this.TxtEmailIntegrante.Text; myContactoFamiliaDTO.UsuarioIngreso = myUsuario.Rut; bool respuesta = YouCom.bll.ContactoFamiliaBLL.Insert(myContactoFamiliaDTO); if (respuesta) { if (enviarMail()) { if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Estimado Cliente, hemos recibido su mensaje, en breve nos contactaremos con usted.');"; script += "parent.location = '" + retorno1 + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('A ocurrido un error. Favor envíe su solicitud al mail [email protected] intente más tarde.');"; script += "parent.location = '" + retorno1 + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } } } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void btnGrabar_Click(object sender, EventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); PropuestaDTO thePropuestaDTO = new PropuestaDTO(); thePropuestaDTO.NombrePropuesta = this.txtPropuestaNombre.Text.ToUpper(); thePropuestaDTO.DescripcionPropuesta = this.txtPropuestaDescripcion.Text.ToUpper(); thePropuestaDTO.FechaPropuesta = DateTime.ParseExact(this.FechaIngreso.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture); thePropuestaDTO.DireccionPropuesta = this.txtDireccion.Text.ToUpper(); YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominioDTO.IdCondominio = decimal.Parse(ddlCondominio.SelectedValue); thePropuestaDTO.TheCondominioDTO = myCondominioDTO; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue); thePropuestaDTO.TheComunidadDTO = myComunidadDTO; YouCom.DTO.PropuestaEstadoDTO myPropuestaEstadoDTO = new YouCom.DTO.PropuestaEstadoDTO(); myPropuestaEstadoDTO.IdPropuestaEstado = decimal.Parse(this.ddlEstado.SelectedValue); thePropuestaDTO.ThePropuestaEstadoDTO = myPropuestaEstadoDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO.IdFamilia = decimal.Parse(ddlFamilia.SelectedValue); thePropuestaDTO.TheFamiliaDTO = myFamiliaDTO; thePropuestaDTO.UsuarioIngreso = myUsuario.Rut; bool respuesta = YouCom.bll.PropuestaBLL.Insert(thePropuestaDTO); if (respuesta) { this.txtPropuestaNombre.Text = string.Empty; this.txtPropuestaDescripcion.Text = string.Empty; this.txtDireccion.Text = string.Empty; this.FechaIngreso.Text = string.Empty; ddlCondominio.ClearSelection(); ddlComunidad.ClearSelection(); ddlFamilia.ClearSelection(); string script = "alert('Propuesta ingresada correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); cargarPropuesta(); } else { } }
protected void btnGrabar_Click(object sender, EventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); ForoComunidadDTO theForoComunidadDTO = new ForoComunidadDTO(); theForoComunidadDTO.TituloForoComunidad = this.txtTituloForo.Text.ToUpper(); theForoComunidadDTO.DescripcionForoComunidad = this.txtDescripcion.Text.ToUpper(); theForoComunidadDTO.FechaPublicacion = DateTime.Now; theForoComunidadDTO.IdPadre = 0; YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominioDTO.IdCondominio = decimal.Parse(ddlCondominio.SelectedValue); theForoComunidadDTO.TheCondominioDTO = myCondominioDTO; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue); theForoComunidadDTO.TheComunidadDTO = myComunidadDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO.IdFamilia = decimal.Parse(ddlFamilia.SelectedValue); theForoComunidadDTO.TheFamiliaDTO = myFamiliaDTO; YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO(); myCategoriaDTO.IdCategoria = decimal.Parse(ddlCategoria.SelectedValue); theForoComunidadDTO.TheCategoriaDTO = myCategoriaDTO; YouCom.DTO.Foro.ForoComunidadEstadoDTO myForoComunidadEstadoDTO = new YouCom.DTO.Foro.ForoComunidadEstadoDTO(); myForoComunidadEstadoDTO.IdForoComunidadEstado = 2; theForoComunidadDTO.TheForoComunidadEstadoDTO = myForoComunidadEstadoDTO; theForoComunidadDTO.UsuarioIngreso = myUsuario.Rut; bool respuesta = YouCom.bll.ForoComunidadBLL.Insert(theForoComunidadDTO); if (respuesta) { this.txtDescripcion.Text = string.Empty; this.txtFecha.Text = string.Empty; this.txtTituloForo.Text = string.Empty; string script = "alert('Mensaje enviado correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); cargarForoComunidad(); } else { } }
protected void BtnEnviar_Click(object sender, EventArgs e) { try { if (Page.IsValid) { YouCom.DTO.Avisos.ComentarioAvisoDTO theComentarioAvisoDTO = new YouCom.DTO.Avisos.ComentarioAvisoDTO(); YouCom.DTO.Avisos.AvisoDTO myAvisosDTO = new YouCom.DTO.Avisos.AvisoDTO(); myAvisosDTO.IdAviso = decimal.Parse(this.HdnIdAviso.Value); theComentarioAvisoDTO.TheAvisosDTO = myAvisosDTO; theComentarioAvisoDTO.ComentarioAviso = this.TxtComentarios.Text.ToUpper(); theComentarioAvisoDTO.EmailComentarioAviso = this.TxtEmail.Text.ToUpper(); theComentarioAvisoDTO.FechaComentarioAviso = DateTime.Now; theComentarioAvisoDTO.IdPadre = 0; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); theComentarioAvisoDTO.TheFamiliaDTO = myFamiliaDTO; theComentarioAvisoDTO.UsuarioIngreso = myUsuario.Rut; theComentarioAvisoDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; theComentarioAvisoDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; bool respuesta = YouCom.bll.Avisos.ComentarioAvisoBLL.Insert(theComentarioAvisoDTO); if (respuesta) { cargarComentarioAvisos(decimal.Parse(HdnIdAviso.Value)); PnlComentar.Visible = false; pnlResultado.Visible = true; litMensaje.Text = "<strong>Estimado Usuario,</strong> El comentario ha sido enviado correctamente."; } else { PnlComentar.Visible = false; pnlResultado.Visible = true; litMensaje.Text = "<strong>Estimado Usuario,</strong> Ha ocurrido un error al momento de enviar el comentario."; } } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void rptVotacion_ItemCommand(object source, RepeaterCommandEventArgs e) { try { if (e.CommandName.Equals("Detalle")) { HiddenField HdnIdPropuesta = (HiddenField)e.Item.FindControl("hdnIdPropuesta"); HiddenField HdnIdVotacionPropuesta = (HiddenField)e.Item.FindControl("hdnIdVotacionPropuesta"); YouCom.DTO.Propuesta.PropuestaDTO myPropuestaDTO = new YouCom.DTO.Propuesta.PropuestaDTO(); myPropuestaDTO = YouCom.bll.PropuestaBLL.detallePropuesta(decimal.Parse(HdnIdPropuesta.Value)); LitPropuestaNombre.Text = myPropuestaDTO.NombrePropuesta; LitPropuestaDecripcion.Text = myPropuestaDTO.DescripcionPropuesta; LitPropuestaFecha.Text = myPropuestaDTO.FechaPropuesta.ToShortDateString(); LitNombreFamilia.Text = myPropuestaDTO.TheFamiliaDTO.NombreCompleto; this.hdnVotacionPropuestaId.Value = HdnIdVotacionPropuesta.Value; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO myVotacionPropuestaRespuestaDTO = new YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO(); myVotacionPropuestaRespuestaDTO = YouCom.bll.VotacionPropuestaRespuestaBLL.detalleVotacionPropuestaRespuesta(decimal.Parse(this.hdnVotacionPropuestaId.Value), myFamiliaDTO.IdFamilia); if (!string.IsNullOrEmpty(myVotacionPropuestaRespuestaDTO.EleccionVotacion)) { rdbSeleccion.SelectedIndex = rdbSeleccion.Items.IndexOf(rdbSeleccion.Items.FindByValue(myVotacionPropuestaRespuestaDTO.EleccionVotacion.ToString())); } if (!string.IsNullOrEmpty(rdbSeleccion.SelectedValue)) { rdbSeleccion.Enabled = false; BtnEnviar.Enabled = false; } else { rdbSeleccion.Enabled = true; BtnEnviar.Enabled = true; } this.SelView(this.mvwVotacion.ActiveViewIndex + 1); } } catch (Exception ex) { } }
protected void getObtieneDetalleAviso(string idAviso) { try { YouCom.DTO.Avisos.AvisoDTO myAvisoDTO = new YouCom.DTO.Avisos.AvisoDTO(); myAvisoDTO = YouCom.bll.Avisos.AvisoBLL.detalleAviso(decimal.Parse(idAviso)); LitAvisoTitulo.Text = myAvisoDTO.TituloAviso; LitAvisoDetalle.Text = myAvisoDTO.DescripcionAviso; LitPrecio.Text = YouCom.Service.Generales.Formato.FormatoMontoPesoSinReplace(myAvisoDTO.PrecioAviso.ToString(), true); YouCom.DTO.Avisos.TipoAvisoDTO myTipoAvisoDTO = new YouCom.DTO.Avisos.TipoAvisoDTO(); myTipoAvisoDTO = YouCom.bll.Avisos.TipoAvisoBLL.detalleTipoAviso(myAvisoDTO.TheTipoAvisoDTO.IdTipoAviso); LitTipo.Text = myTipoAvisoDTO.NombreTipoAviso; LitFechaPublicacion.Text = myAvisoDTO.FechaPublicacion.ToString(); LitFechaTermino.Text = myAvisoDTO.FechaTermino.ToShortDateString(); YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamilia(myAvisoDTO.TheFamiliaDTO.IdFamilia); LitContacto.Text = myFamiliaDTO.NombreCompleto; cargarComentarioAvisos(decimal.Parse(idAviso)); IList <YouCom.DTO.Avisos.ImagenAvisoDTO> myImagenAvisoDTO = new List <YouCom.DTO.Avisos.ImagenAvisoDTO>(); myImagenAvisoDTO = YouCom.bll.Avisos.ImagenAvisoBLL.getListadoImagenAvisoByIdAviso(decimal.Parse(idAviso)); if (myImagenAvisoDTO.Any()) { rptIndicadorCarrusel.DataSource = myImagenAvisoDTO; rptIndicadorCarrusel.DataBind(); rptGaleriaAvisos.DataSource = myImagenAvisoDTO; rptGaleriaAvisos.DataBind(); } else { pnlCarrusel.Visible = false; } this.SelView(this.mvwCompras.ActiveViewIndex + 1); } catch (Exception ex) { } }
protected void BtnEnviar_Click(object sender, EventArgs e) { try { if (Page.IsValid) { YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO myVotacionPropuestaRespuestaDTO = new YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO(); YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); myVotacionPropuestaRespuestaDTO.TheFamiliaDTO = myFamiliaDTO; YouCom.DTO.Propuesta.VotacionPropuestaDTO myVotacionPropuestaDTO = new YouCom.DTO.Propuesta.VotacionPropuestaDTO(); myVotacionPropuestaDTO.IdVotacionPropuesta = decimal.Parse(this.hdnVotacionPropuestaId.Value); myVotacionPropuestaRespuestaDTO.TheVotacionPropuestaDTO = myVotacionPropuestaDTO; myVotacionPropuestaRespuestaDTO.EleccionVotacion = rdbSeleccion.SelectedValue; myVotacionPropuestaRespuestaDTO.FechaVotacion = DateTime.Now; bool respuesta = YouCom.bll.VotacionPropuestaRespuestaBLL.Insert(myVotacionPropuestaRespuestaDTO); if (respuesta) { if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Estimado Cliente, hemos recibido su votación, en breve nos contactaremos con usted.');"; script += "parent.location = '" + retorno1 + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('A ocurrido un error. Favor envíe su solicitud al mail [email protected] intente más tarde.');"; script += "parent.location = '" + retorno1 + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void rptEmpresaServicio_OnItemCommand(object sender, RepeaterCommandEventArgs e) { if (e.CommandName == "Votar") { HiddenField hdnIdEmpresaServicio = new HiddenField(); hdnIdEmpresaServicio = (HiddenField)e.Item.FindControl("hdnIdEmpresaServicio"); RadioButtonList rdblNotas = new RadioButtonList(); rdblNotas = (RadioButtonList)e.Item.FindControl("rdblNotas"); bool retorno = false; YouCom.DTO.Servicio.RankingServicioDTO theRankingServicioDTO = new YouCom.DTO.Servicio.RankingServicioDTO(); YouCom.DTO.Servicio.EmpresaServicioDTO myEmpresaServicioDTO = new YouCom.DTO.Servicio.EmpresaServicioDTO(); myEmpresaServicioDTO.IdEmpresaServicio = decimal.Parse(hdnIdEmpresaServicio.Value); theRankingServicioDTO.TheEmpresaServicioDTO = myEmpresaServicioDTO; theRankingServicioDTO.Nota = int.Parse(rdblNotas.SelectedValue); theRankingServicioDTO.FechaRanking = DateTime.Now; theRankingServicioDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; theRankingServicioDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); theRankingServicioDTO.TheFamiliaDTO = myFamiliaDTO; theRankingServicioDTO.UsuarioIngreso = myUsuario.Rut; retorno = YouCom.bll.RankingServicioBLL.Insert(theRankingServicioDTO); if (retorno) { if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Estimado Cliente, hemos recibido su votación, en breve nos contactaremos con usted.');"; script += "parent.location = '" + YouCom.Service.Configuracion.Config.getPageName(true) + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } } }
protected string creaCuerpo() { string Url = "http://" + Request.Url.Authority + "/mailing/plantilla_contacto_mailing.htm"; System.Net.WebClient client = new System.Net.WebClient(); String htmlCode = client.DownloadString(Url); string newhtmlCode = ""; newhtmlCode = Regex.Replace(htmlCode, "src=\"images", "src=\"" + "http://" + Request.Url.Authority + "/mailing/images", RegexOptions.Multiline | RegexOptions.IgnoreCase); YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); newhtmlCode = Regex.Replace(newhtmlCode, "{Nombre}", myFamiliaDTO.NombreFamilia, RegexOptions.Multiline | RegexOptions.IgnoreCase); newhtmlCode = Regex.Replace(newhtmlCode, "{Apellido}", myFamiliaDTO.ApellidoPaternoFamilia + " " + myFamiliaDTO.ApellidoMaternoFamilia, RegexOptions.Multiline | RegexOptions.IgnoreCase); newhtmlCode = Regex.Replace(newhtmlCode, "{Email}", myFamiliaDTO.EmailFamilia, RegexOptions.Multiline | RegexOptions.IgnoreCase); newhtmlCode = Regex.Replace(newhtmlCode, "{Asunto}", this.TxtAsunto.Text, RegexOptions.Multiline | RegexOptions.IgnoreCase); newhtmlCode = Regex.Replace(newhtmlCode, "{Mensaje}", this.TxtComentarios.Text, RegexOptions.Multiline | RegexOptions.IgnoreCase); return(newhtmlCode); }
protected void BtnEnviar_Click(object sender, EventArgs e) { try { if (Page.IsValid) { YouCom.DTO.Foro.ForoComunidadDTO theForoComunidadDTO = new YouCom.DTO.Foro.ForoComunidadDTO(); YouCom.DTO.Foro.ForoComunidadDTO myForoComunidadDTO = new YouCom.DTO.Foro.ForoComunidadDTO(); myForoComunidadDTO = YouCom.bll.ForoComunidadBLL.detalleForoComunidad(decimal.Parse(this.HdnIdForoComunidad.Value)); theForoComunidadDTO.TituloForoComunidad = myForoComunidadDTO.TituloForoComunidad; theForoComunidadDTO.DescripcionForoComunidad = this.TxtComentarios.Text.ToUpper(); theForoComunidadDTO.FechaForoComunidad = DateTime.Now; theForoComunidadDTO.IdPadre = myForoComunidadDTO.IdForoComunidad; theForoComunidadDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; theForoComunidadDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); theForoComunidadDTO.TheFamiliaDTO = myFamiliaDTO; YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO(); myCategoriaDTO.IdCategoria = myForoComunidadDTO.TheCategoriaDTO.IdCategoria; theForoComunidadDTO.TheCategoriaDTO = myCategoriaDTO; YouCom.DTO.Foro.ForoComunidadEstadoDTO myForoComunidadEstadoDTO = new YouCom.DTO.Foro.ForoComunidadEstadoDTO(); myForoComunidadEstadoDTO.IdForoComunidadEstado = 2; theForoComunidadDTO.TheForoComunidadEstadoDTO = myForoComunidadEstadoDTO; theForoComunidadDTO.UsuarioIngreso = myUsuario.Rut; bool respuesta = YouCom.bll.ForoComunidadBLL.Insert(theForoComunidadDTO); if (respuesta) { if (enviarMail()) { if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Estimado Cliente, hemos recibido su mensaje, en breve nos contactaremos con usted.');"; script += "parent.location = '" + retorno1 + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('A ocurrido un error. Favor envíe su solicitud al mail [email protected] intente más tarde.');"; script += "parent.location = '" + retorno1 + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } } else { if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('A ocurrido un error. Favor envíe su solicitud al mail [email protected] intente más tarde.');"; script += "parent.location = '" + retorno1 + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } } } catch (Exception ex) { Response.Write(ex.Message); } }
//protected void cargarDatosPropietario() //{ // YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); // myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); // this.TxtNombre.Text = myFamiliaDTO.NombreFamilia; // this.TxtPaterno.Text = myFamiliaDTO.ApellidoPaternoFamilia; // this.TxtMaterno.Text = myFamiliaDTO.ApellidoMaternoFamilia; //} protected bool setEnviaAviso() { bool retorno = false; bool salida = false; AvisoDTO theAvisosDTO = new AvisoDTO(); theAvisosDTO.TituloAviso = this.TxtTitulo.Text.ToUpper(); theAvisosDTO.DescripcionAviso = this.TxtDescripcion.Text.ToUpper(); theAvisosDTO.PrecioAviso = decimal.Parse(this.TxtPrecio.Text); theAvisosDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; theAvisosDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO(); myCategoriaDTO.IdCategoria = decimal.Parse(ddlCategoria.SelectedValue); theAvisosDTO.TheCategoriaDTO = myCategoriaDTO; YouCom.DTO.Avisos.TipoAvisoDTO myTipoAvisoDTO = new YouCom.DTO.Avisos.TipoAvisoDTO(); myTipoAvisoDTO.IdTipoAviso = decimal.Parse(ddlTipoAviso.SelectedValue); theAvisosDTO.TheTipoAvisoDTO = myTipoAvisoDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); theAvisosDTO.TheFamiliaDTO = myFamiliaDTO; YouCom.DTO.MonedaDTO myMonedaDTO = new YouCom.DTO.MonedaDTO(); myMonedaDTO.IdMoneda = 1; theAvisosDTO.TheMonedaDTO = myMonedaDTO; YouCom.DTO.Avisos.AvisoEstadoDTO myAvisosEstadoDTO = new YouCom.DTO.Avisos.AvisoEstadoDTO(); myAvisosEstadoDTO.IdAvisoEstado = 1; theAvisosDTO.TheAvisosEstadoDTO = myAvisosEstadoDTO; theAvisosDTO.FechaPublicacion = DateTime.Now; theAvisosDTO.FechaTermino = DateTime.Now.AddMonths(1); theAvisosDTO.UsuarioIngreso = myUsuario.Rut; if (this.FileImagenAviso.HasFile) { theAvisosDTO.ImagenAviso = this.ProcessOtherFile(FileImagenPrincipalAviso, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathAvisosPub")); } retorno = YouCom.bll.Avisos.AvisoBLL.Insert(theAvisosDTO); if (retorno) { string ruta = YouCom.Service.Generales.General.GetPropiedad("UploadsPathAvisosPub"); string valor_retorno = string.Empty; foreach (var file in FileImagenAviso.PostedFiles) { if (!string.IsNullOrEmpty(file.FileName)) { YouCom.DTO.Avisos.ImagenAvisoDTO myImagenAvisoDTO = new YouCom.DTO.Avisos.ImagenAvisoDTO(); Random myRandom = new Random(); string xName = myRandom.Next(1, 1000000).ToString(); if (Intermedia.IMSystem.IMFile.IMFile.GetNameFile(file.FileName).Length > 16) { valor_retorno = xName + "_" + Intermedia.IMSystem.IMFile.IMFile.GetNameFile(file.FileName).Substring(0, 16) + Intermedia.IMSystem.IMFile.IMFile.GetExtensionFile(file.FileName); } else { valor_retorno = xName + "_" + Intermedia.IMSystem.IMFile.IMFile.GetNameFile(file.FileName).Substring(0, Intermedia.IMSystem.IMFile.IMFile.GetNameFile(file.FileName).Length) + Intermedia.IMSystem.IMFile.IMFile.GetExtensionFile(file.FileName); } myImagenAvisoDTO.ThumbailImagenAviso = valor_retorno; myImagenAvisoDTO.GrandeImagenAviso = valor_retorno; myImagenAvisoDTO.TituloImagenAviso = this.TxtTitulo.Text; YouCom.DTO.Avisos.AvisoDTO myAvisoDTO = new YouCom.DTO.Avisos.AvisoDTO(); myAvisoDTO.IdAviso = YouCom.bll.Avisos.AvisoBLL.getObtenerUltimoAviso().IdAviso; myImagenAvisoDTO.TheAvisosDTO = myAvisoDTO; YouCom.bll.Avisos.ImagenAvisoBLL.Insert(myImagenAvisoDTO); file.SaveAs(Server.MapPath(ruta + valor_retorno)); } } salida = true; } return(salida); }
protected void rptAviso_OnItemCommand(object sender, RepeaterCommandEventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); if (e.CommandName == "Editar") { HiddenField hdnIdAvisos = new HiddenField(); hdnIdAvisos = (HiddenField)e.Item.FindControl("hdnIdAviso"); YouCom.DTO.Avisos.AvisoDTO myAvisosDTO = new YouCom.DTO.Avisos.AvisoDTO(); myAvisosDTO = YouCom.bll.Avisos.AvisoBLL.detalleAviso(decimal.Parse(hdnIdAvisos.Value)); this.hdnIdAviso.Value = myAvisosDTO.IdAviso.ToString(); this.txtAvisoDescripcion.Text = myAvisosDTO.DescripcionAviso; this.txtAvisoPrecio.Text = myAvisosDTO.PrecioAviso.ToString().Replace(".0000", ""); this.txtAvisoTitulo.Text = myAvisosDTO.TituloAviso; ddlCondominio.SelectedIndex = ddlCondominio.Items.IndexOf(ddlCondominio.Items.FindByValue(myAvisosDTO.TheCondominioDTO.IdCondominio.ToString())); ddlComunidad.DataSource = YouCom.bll.ComunidadBLL.getListadoComunidadByCondominio(decimal.Parse(ddlCondominio.SelectedValue)); ddlComunidad.DataTextField = "NombreComunidad"; ddlComunidad.DataValueField = "IdComunidad"; ddlComunidad.DataBind(); ddlComunidad.Items.Insert(0, new ListItem("Seleccione Comunidad", string.Empty)); ddlComunidad.SelectedIndex = ddlComunidad.Items.IndexOf(ddlComunidad.Items.FindByValue(myAvisosDTO.TheComunidadDTO.IdComunidad.ToString())); YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamilia(myAvisosDTO.TheFamiliaDTO.IdFamilia); ddlCasa.DataSource = YouCom.bll.CasaBLL.getListadoCasaByComunidad(decimal.Parse(ddlComunidad.SelectedValue)); ddlCasa.DataTextField = "NombreCasa"; ddlCasa.DataValueField = "IdCasa"; ddlCasa.DataBind(); ddlCasa.Items.Insert(0, new ListItem("Seleccione Casa", string.Empty)); ddlCasa.SelectedIndex = ddlCasa.Items.IndexOf(ddlCasa.Items.FindByValue(myFamiliaDTO.TheCasaDTO.IdCasa.ToString())); ddlFamilia.DataSource = YouCom.bll.FamiliaBLL.getListadoFamiliaByCasa(decimal.Parse(ddlCasa.SelectedValue)); ddlFamilia.DataTextField = "NombreCompleto"; ddlFamilia.DataValueField = "IdFamilia"; ddlFamilia.DataBind(); ddlFamilia.Items.Insert(0, new ListItem("Seleccione Familia", string.Empty)); ddlFamilia.SelectedIndex = ddlFamilia.Items.IndexOf(ddlFamilia.Items.FindByValue(myAvisosDTO.TheFamiliaDTO.IdFamilia.ToString())); ddlEstado.SelectedIndex = ddlEstado.Items.IndexOf(ddlEstado.Items.FindByValue(myAvisosDTO.TheAvisosEstadoDTO.IdAvisoEstado.ToString())); ddlCategoria.SelectedIndex = ddlCategoria.Items.IndexOf(ddlCategoria.Items.FindByValue(myAvisosDTO.TheCategoriaDTO.IdCategoria.ToString())); ddlTipoAviso.SelectedIndex = ddlTipoAviso.Items.IndexOf(ddlTipoAviso.Items.FindByValue(myAvisosDTO.TheTipoAvisoDTO.IdTipoAviso.ToString())); ddlCategoria.SelectedIndex = ddlCategoria.Items.IndexOf(ddlCategoria.Items.FindByValue(myAvisosDTO.TheCategoriaDTO.IdCategoria.ToString())); if (!string.IsNullOrEmpty(myAvisosDTO.ImagenAviso)) { this.lnkImagen.Visible = true; this.chkImagen.Visible = true; this.lnkImagen.NavigateUrl = YouCom.Service.Generales.General.GetPropiedad("UploadsPathAvisosPub") + myAvisosDTO.ImagenAviso; } btnGrabar.Visible = false; btnEditar.Visible = true; } if (e.CommandName == "Eliminar") { HiddenField hdnIdAvisos = new HiddenField(); hdnIdAvisos = (HiddenField)e.Item.FindControl("hdnIdAvisos"); AvisoDTO theAvisosDTO = new AvisoDTO(); theAvisosDTO.IdAviso = decimal.Parse(hdnIdAvisos.Value); theAvisosDTO.UsuarioModificacion = myUsuario.Rut; bool validacionIntegridad = YouCom.bll.Avisos.AvisoBLL.ValidaEliminacionAvisos(theAvisosDTO); if (validacionIntegridad) { string script = "alert(' No es posible eliminar un Avisos con informacion asociada.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); return; } else { bool respuesta = YouCom.bll.Avisos.AvisoBLL.Delete(theAvisosDTO); if (respuesta) { cargarAviso(); if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Avisos Eliminada correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { } } } }
protected void rptForoComunidad_OnItemCommand(object sender, RepeaterCommandEventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); if (e.CommandName == "Editar") { HiddenField hdnIdForoComunidad = new HiddenField(); hdnIdForoComunidad = (HiddenField)e.Item.FindControl("hdnIdForoComunidad"); YouCom.DTO.Foro.ForoComunidadDTO myForoComunidadDTO = new YouCom.DTO.Foro.ForoComunidadDTO(); myForoComunidadDTO = YouCom.bll.ForoComunidadBLL.detalleForoComunidad(decimal.Parse(hdnIdForoComunidad.Value)); this.hdnIdForoComunidad.Value = myForoComunidadDTO.IdForoComunidad.ToString(); this.txtTituloForo.Text = myForoComunidadDTO.TituloForoComunidad; this.txtDescripcion.Text = myForoComunidadDTO.DescripcionForoComunidad; this.txtFecha.Text = myForoComunidadDTO.FechaForoComunidad.ToShortDateString(); ddlCondominio.SelectedIndex = ddlCondominio.Items.IndexOf(ddlCondominio.Items.FindByValue(myForoComunidadDTO.TheCondominioDTO.IdCondominio.ToString())); ddlComunidad.DataSource = YouCom.bll.ComunidadBLL.getListadoComunidadByCondominio(decimal.Parse(ddlCondominio.SelectedValue)); ddlComunidad.DataTextField = "NombreComunidad"; ddlComunidad.DataValueField = "IdComunidad"; ddlComunidad.DataBind(); ddlComunidad.Items.Insert(0, new ListItem("Seleccione Comunidad", string.Empty)); ddlComunidad.SelectedIndex = ddlComunidad.Items.IndexOf(ddlComunidad.Items.FindByValue(myForoComunidadDTO.TheComunidadDTO.IdComunidad.ToString())); YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamilia(myForoComunidadDTO.TheFamiliaDTO.IdFamilia); ddlCasa.DataSource = YouCom.bll.CasaBLL.getListadoCasaByComunidad(decimal.Parse(ddlComunidad.SelectedValue)); ddlCasa.DataTextField = "NombreCasa"; ddlCasa.DataValueField = "IdCasa"; ddlCasa.DataBind(); ddlCasa.Items.Insert(0, new ListItem("Seleccione Casa", string.Empty)); ddlCasa.SelectedIndex = ddlCasa.Items.IndexOf(ddlCasa.Items.FindByValue(myFamiliaDTO.TheCasaDTO.IdCasa.ToString())); ddlFamilia.DataSource = YouCom.bll.FamiliaBLL.getListadoFamiliaByCasa(decimal.Parse(ddlCasa.SelectedValue)); ddlFamilia.DataTextField = "NombreCompleto"; ddlFamilia.DataValueField = "IdFamilia"; ddlFamilia.DataBind(); ddlFamilia.Items.Insert(0, new ListItem("Seleccione Familia", string.Empty)); ddlFamilia.SelectedIndex = ddlFamilia.Items.IndexOf(ddlFamilia.Items.FindByValue(myForoComunidadDTO.TheFamiliaDTO.IdFamilia.ToString())); ddlCategoria.SelectedIndex = ddlCategoria.Items.IndexOf(ddlCategoria.Items.FindByValue(myForoComunidadDTO.TheCategoriaDTO.IdCategoria.ToString())); ddlEstado.SelectedIndex = ddlEstado.Items.IndexOf(ddlEstado.Items.FindByValue(myForoComunidadDTO.TheForoComunidadEstadoDTO.IdForoComunidadEstado.ToString())); btnGrabar.Visible = false; btnEditar.Visible = true; } if (e.CommandName == "Eliminar") { HiddenField hdnIdForoComunidad = new HiddenField(); hdnIdForoComunidad = (HiddenField)e.Item.FindControl("hdnIdForoComunidad"); ForoComunidadDTO theForoComunidadDTO = new ForoComunidadDTO(); theForoComunidadDTO.IdForoComunidad = decimal.Parse(hdnIdForoComunidad.Value); theForoComunidadDTO.UsuarioModificacion = myUsuario.Rut; bool validacionIntegridad = YouCom.bll.ForoComunidadBLL.ValidaEliminacionForoComunidad(theForoComunidadDTO); if (validacionIntegridad) { string script = "alert(' No es posible eliminar un foro con informacion asociada.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); return; } else { bool respuesta = YouCom.bll.ForoComunidadBLL.Delete(theForoComunidadDTO); if (respuesta) { cargarForoComunidad(); if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Foro eliminado correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { } } } }
protected void btnEditar_Click(object sender, EventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); btnEditar.Visible = false; btnGrabar.Visible = true; ForoComunidadDTO theForoComunidadDTO = new ForoComunidadDTO(); theForoComunidadDTO.IdForoComunidad = decimal.Parse(this.hdnIdForoComunidad.Value); theForoComunidadDTO.TituloForoComunidad = this.txtTituloForo.Text.ToUpper(); theForoComunidadDTO.DescripcionForoComunidad = this.txtDescripcion.Text.ToUpper(); theForoComunidadDTO.FechaPublicacion = DateTime.Now; theForoComunidadDTO.IdPadre = 0; YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominioDTO.IdCondominio = decimal.Parse(ddlCondominio.SelectedValue); theForoComunidadDTO.TheCondominioDTO = myCondominioDTO; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue); theForoComunidadDTO.TheComunidadDTO = myComunidadDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO.IdFamilia = decimal.Parse(ddlFamilia.SelectedValue); theForoComunidadDTO.TheFamiliaDTO = myFamiliaDTO; YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO(); myCategoriaDTO.IdCategoria = decimal.Parse(ddlCategoria.SelectedValue); theForoComunidadDTO.TheCategoriaDTO = myCategoriaDTO; YouCom.DTO.Foro.ForoComunidadEstadoDTO myForoComunidadEstadoDTO = new YouCom.DTO.Foro.ForoComunidadEstadoDTO(); myForoComunidadEstadoDTO.IdForoComunidadEstado = decimal.Parse(ddlEstado.SelectedValue); theForoComunidadDTO.TheForoComunidadEstadoDTO = myForoComunidadEstadoDTO; if (ddlEstado.SelectedValue == "3") { theForoComunidadDTO.FechaPublicacion = DateTime.Now; theForoComunidadDTO.FechaTermino = DateTime.Now.AddMonths(1); } theForoComunidadDTO.MotivoEstadoForoComunidad = this.txtMotivoEstado.Text; theForoComunidadDTO.UsuarioModificacion = myUsuario.Rut; bool respuesta = YouCom.bll.ForoComunidadBLL.Update(theForoComunidadDTO); if (respuesta) { cargarForoComunidad(); this.txtDescripcion.Text = string.Empty; this.txtFecha.Text = string.Empty; this.txtTituloForo.Text = string.Empty; if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Mensaje respondido correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { } }
protected void btnGrabar_Click(object sender, EventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); List <ListaNegraDTO> listaNegra = new List <ListaNegraDTO>(); listaNegra = (Session["listaNegra"] as List <ListaNegraDTO>); ListaNegraDTO theListaNegraDTO = new ListaNegraDTO(); theListaNegraDTO.RutListaNegra = YouCom.Service.Generales.Formato.LimpiarRut(this.txtRut.Text.ToUpper()); theListaNegraDTO.NombreListaNegra = this.txtNombre.Text.ToUpper(); theListaNegraDTO.ApellidoPaternoListaNegra = this.txtApellidoPaterno.Text.ToUpper(); theListaNegraDTO.ApellidoMaternoListaNegra = this.txtApellidoMaterno.Text.ToUpper(); theListaNegraDTO.MotivoListaNegra = this.txtMotivo.Text; YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominioDTO.IdCondominio = decimal.Parse(ddlCondominio.SelectedValue); theListaNegraDTO.TheCondominioDTO = myCondominioDTO; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue); theListaNegraDTO.TheComunidadDTO = myComunidadDTO; YouCom.DTO.Propietario.CasaDTO myCasaDTO = new YouCom.DTO.Propietario.CasaDTO(); myCasaDTO.IdCasa = decimal.Parse(ddlCasa.SelectedValue); theListaNegraDTO.TheCasaDTO = myCasaDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO.IdFamilia = decimal.Parse(ddlFamilia.SelectedValue); theListaNegraDTO.TheFamiliaDTO = myFamiliaDTO; theListaNegraDTO.UsuarioIngreso = myUsuario.Rut; listaNegra = listaNegra.Where(x => x.RutListaNegra == theListaNegraDTO.RutListaNegra).ToList(); if (listaNegra.Any()) { foreach (var item in listaNegra) { if (item.Estado == "2") { string script = "alert('Lista Negra Existe pero fue eliminado para activarla dirigase a Papelera.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); return; } else { string script = "alert('Lista Negra ya Existe .');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); return; } } } bool respuesta = YouCom.bll.ListaNegraBLL.Insert(theListaNegraDTO); if (respuesta) { this.txtNombre.Text = string.Empty; this.txtRut.Text = string.Empty; this.txtApellidoPaterno.Text = string.Empty; this.txtApellidoMaterno.Text = string.Empty; this.txtMotivo.Text = string.Empty; ddlCondominio.ClearSelection(); ddlCasa.ClearSelection(); ddlFamilia.ClearSelection(); string script = "alert('Lista Negra Ingresada correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); cargarListaNegra(); } else { } }
protected void rptListaNegra_OnItemCommand(object sender, RepeaterCommandEventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); if (e.CommandName == "Editar") { HiddenField hdnIdListaNegra = new HiddenField(); hdnIdListaNegra = (HiddenField)e.Item.FindControl("hdnIdListaNegra"); YouCom.DTO.ListaNegraDTO theListaNegraDTO = new YouCom.DTO.ListaNegraDTO(); theListaNegraDTO = YouCom.bll.ListaNegraBLL.detalleListaNegra(decimal.Parse(hdnIdListaNegra.Value)); this.hdnIdListaNegra.Value = theListaNegraDTO.IdListaNegra.ToString(); this.txtNombre.Text = theListaNegraDTO.NombreListaNegra; this.txtRut.Text = YouCom.Service.Generales.Formato.FormatoRut(theListaNegraDTO.RutListaNegra); this.txtApellidoPaterno.Text = theListaNegraDTO.ApellidoPaternoListaNegra; this.txtApellidoMaterno.Text = theListaNegraDTO.ApellidoMaternoListaNegra; this.txtMotivo.Text = theListaNegraDTO.MotivoListaNegra; ddlCondominio.SelectedIndex = ddlCondominio.Items.IndexOf(ddlCondominio.Items.FindByValue(theListaNegraDTO.TheCondominioDTO.IdCondominio.ToString())); ddlComunidad.DataSource = YouCom.bll.ComunidadBLL.getListadoComunidadByCondominio(decimal.Parse(ddlCondominio.SelectedValue)); ddlComunidad.DataTextField = "NombreComunidad"; ddlComunidad.DataValueField = "IdComunidad"; ddlComunidad.DataBind(); ddlComunidad.Items.Insert(0, new ListItem("Seleccione Comunidad", string.Empty)); ddlComunidad.SelectedIndex = ddlComunidad.Items.IndexOf(ddlComunidad.Items.FindByValue(theListaNegraDTO.TheComunidadDTO.IdComunidad.ToString())); ddlCasa.DataSource = YouCom.bll.CasaBLL.getListadoCasaByComunidad(decimal.Parse(ddlComunidad.SelectedValue)); ddlCasa.DataTextField = "NombreCasa"; ddlCasa.DataValueField = "IdCasa"; ddlCasa.DataBind(); ddlCasa.Items.Insert(0, new ListItem("Seleccione Casa", string.Empty)); YouCom.DTO.Propietario.FamiliaDTO theFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); theFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamilia(theListaNegraDTO.TheFamiliaDTO.IdFamilia); ddlCasa.SelectedIndex = ddlCasa.Items.IndexOf(ddlCasa.Items.FindByValue(theFamiliaDTO.TheCasaDTO.IdCasa.ToString())); List <YouCom.DTO.Propietario.FamiliaDTO> familias = new List <YouCom.DTO.Propietario.FamiliaDTO>(); familias = YouCom.bll.FamiliaBLL.listaFamiliaActivo().Where(x => x.TheCasaDTO.IdCasa == decimal.Parse(ddlCasa.SelectedValue)).ToList(); ddlFamilia.DataSource = familias; ddlFamilia.DataTextField = "NombreCompleto"; ddlFamilia.DataValueField = "IdFamilia"; ddlFamilia.DataBind(); ddlFamilia.Items.Insert(0, new ListItem("Seleccione Integrante Familia", string.Empty)); ddlFamilia.SelectedIndex = ddlFamilia.Items.IndexOf(ddlFamilia.Items.FindByValue(theListaNegraDTO.TheFamiliaDTO.IdFamilia.ToString())); btnGrabar.Visible = false; btnEditar.Visible = true; } if (e.CommandName == "Eliminar") { HiddenField hdnIdListaNegra = new HiddenField(); hdnIdListaNegra = (HiddenField)e.Item.FindControl("hdnIdListaNegra"); ListaNegraDTO theListaNegraDTO = new ListaNegraDTO(); theListaNegraDTO.IdListaNegra = decimal.Parse(hdnIdListaNegra.Value); theListaNegraDTO.UsuarioModificacion = myUsuario.Rut; bool respuesta = YouCom.bll.ListaNegraBLL.Delete(theListaNegraDTO); if (respuesta) { cargarListaNegra(); if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Lista Negra Eliminada correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { } } }
protected void btnEditar_Click(object sender, EventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); btnEditar.Visible = false; btnGrabar.Visible = true; ListaNegraDTO theListaNegraDTO = new ListaNegraDTO(); theListaNegraDTO.RutListaNegra = YouCom.Service.Generales.Formato.LimpiarRut(this.txtRut.Text.ToUpper()); theListaNegraDTO.NombreListaNegra = this.txtNombre.Text.ToUpper(); theListaNegraDTO.ApellidoPaternoListaNegra = this.txtApellidoPaterno.Text.ToUpper(); theListaNegraDTO.ApellidoMaternoListaNegra = this.txtApellidoMaterno.Text.ToUpper(); theListaNegraDTO.MotivoListaNegra = this.txtMotivo.Text; YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominioDTO.IdCondominio = decimal.Parse(ddlCondominio.SelectedValue); theListaNegraDTO.TheCondominioDTO = myCondominioDTO; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue); theListaNegraDTO.TheComunidadDTO = myComunidadDTO; YouCom.DTO.Propietario.CasaDTO myCasaDTO = new YouCom.DTO.Propietario.CasaDTO(); myCasaDTO.IdCasa = decimal.Parse(ddlCasa.SelectedValue); theListaNegraDTO.TheCasaDTO = myCasaDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO.IdFamilia = decimal.Parse(ddlFamilia.SelectedValue); theListaNegraDTO.TheFamiliaDTO = myFamiliaDTO; theListaNegraDTO.UsuarioModificacion = myUsuario.Rut; bool respuesta = YouCom.bll.ListaNegraBLL.Update(theListaNegraDTO); if (respuesta) { cargarListaNegra(); this.txtNombre.Text = string.Empty; this.txtRut.Text = string.Empty; this.txtApellidoPaterno.Text = string.Empty; this.txtApellidoMaterno.Text = string.Empty; this.txtMotivo.Text = string.Empty; ddlCondominio.ClearSelection(); ddlCasa.ClearSelection(); ddlFamilia.ClearSelection(); if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Lista Negra editada correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { } }
protected void btnGrabar_Click(object sender, EventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); List <AvisoDTO> Avisoss = new List <AvisoDTO>(); Avisoss = (Session["Avisos"] as List <AvisoDTO>); AvisoDTO theAvisosDTO = new AvisoDTO(); theAvisosDTO.TituloAviso = this.txtAvisoTitulo.Text.ToUpper(); theAvisosDTO.DescripcionAviso = this.txtAvisoDescripcion.Text.ToUpper(); theAvisosDTO.PrecioAviso = decimal.Parse(this.txtAvisoPrecio.Text); YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominioDTO.IdCondominio = decimal.Parse(ddlCondominio.SelectedValue); theAvisosDTO.TheCondominioDTO = myCondominioDTO; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue); theAvisosDTO.TheComunidadDTO = myComunidadDTO; YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO(); myCategoriaDTO.IdCategoria = decimal.Parse(ddlCategoria.SelectedValue); theAvisosDTO.TheCategoriaDTO = myCategoriaDTO; YouCom.DTO.Avisos.TipoAvisoDTO myTipoAvisoDTO = new YouCom.DTO.Avisos.TipoAvisoDTO(); myTipoAvisoDTO.IdTipoAviso = decimal.Parse(ddlTipoAviso.SelectedValue); theAvisosDTO.TheTipoAvisoDTO = myTipoAvisoDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO.IdFamilia = decimal.Parse(ddlFamilia.SelectedValue); theAvisosDTO.TheFamiliaDTO = myFamiliaDTO; YouCom.DTO.MonedaDTO myMonedaDTO = new YouCom.DTO.MonedaDTO(); myMonedaDTO.IdMoneda = 1; theAvisosDTO.TheMonedaDTO = myMonedaDTO; theAvisosDTO.UsuarioIngreso = myUsuario.Rut; if (this.FileImagenAviso.HasFile) { if (System.IO.Path.GetExtension(FileImagenAviso.PostedFile.FileName) == ".swf") { theAvisosDTO.ImagenAviso = this.ProcessOtherFile(FileImagenAviso, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathAvisosPub")); } else { theAvisosDTO.ImagenAviso = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenAviso, YouCom.Service.Generales.General.GetPropiedad("UploadsPathAvisosPub"), 198, 118, Page); } } bool respuesta = YouCom.bll.Avisos.AvisoBLL.Insert(theAvisosDTO); if (respuesta) { this.txtAvisoDescripcion.Text = string.Empty; this.txtAvisoPrecio.Text = string.Empty; this.txtAvisoTitulo.Text = string.Empty; string script = "alert('Aviso ingresado correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); cargarAviso(); } else { } }
protected void rptFamilia_OnItemCommand(object sender, RepeaterCommandEventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); if (e.CommandName == "Editar") { HiddenField hdnIdFamilia = new HiddenField(); hdnIdFamilia = (HiddenField)e.Item.FindControl("hdnIdFamilia"); YouCom.DTO.Propietario.FamiliaDTO theFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); theFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamilia(decimal.Parse(hdnIdFamilia.Value)); this.hdnIdFamilia.Value = theFamiliaDTO.IdFamilia.ToString(); txtNombre.Text = theFamiliaDTO.NombreFamilia; txtApellidoPaterno.Text = theFamiliaDTO.ApellidoPaternoFamilia; txtApellidoMaterno.Text = theFamiliaDTO.ApellidoMaternoFamilia; txtEmail.Text = theFamiliaDTO.EmailFamilia; txtTelefono.Text = theFamiliaDTO.TelefonoFamilia; txtCelular.Text = theFamiliaDTO.CelularFamilia; this.txtRut.Text = YouCom.Service.Generales.Formato.FormatoRut(theFamiliaDTO.RutFamilia); ddlOcupacion.SelectedIndex = ddlOcupacion.Items.IndexOf(ddlOcupacion.Items.FindByValue(theFamiliaDTO.TheOcupacionDTO.IdOcupacion.ToString())); ddlParentesco.SelectedIndex = ddlParentesco.Items.IndexOf(ddlParentesco.Items.FindByValue(theFamiliaDTO.TheParentescoDTO.IdParentesco.ToString())); ddlCondominio.SelectedIndex = ddlCondominio.Items.IndexOf(ddlCondominio.Items.FindByValue(theFamiliaDTO.TheCondominioDTO.IdCondominio.ToString())); ddlComunidad.DataSource = YouCom.bll.ComunidadBLL.getListadoComunidadByCondominio(decimal.Parse(ddlCondominio.SelectedValue)); ddlComunidad.DataTextField = "NombreComunidad"; ddlComunidad.DataValueField = "IdComunidad"; ddlComunidad.DataBind(); ddlComunidad.Items.Insert(0, new ListItem("Seleccione Comunidad", string.Empty)); ddlComunidad.SelectedIndex = ddlComunidad.Items.IndexOf(ddlComunidad.Items.FindByValue(theFamiliaDTO.TheComunidadDTO.IdComunidad.ToString())); ddlCasa.DataSource = YouCom.bll.CasaBLL.getListadoCasaByComunidad(decimal.Parse(ddlComunidad.SelectedValue)); ddlCasa.DataTextField = "NombreCasa"; ddlCasa.DataValueField = "IdCasa"; ddlCasa.DataBind(); ddlCasa.Items.Insert(0, new ListItem("Seleccione Casa", string.Empty)); btnGrabar.Visible = false; btnEditar.Visible = true; } if (e.CommandName == "Eliminar") { HiddenField hdnIdFamilia = new HiddenField(); hdnIdFamilia = (HiddenField)e.Item.FindControl("hdnIdFamilia"); FamiliaDTO theFamiliaDTO = new FamiliaDTO(); theFamiliaDTO.IdFamilia = decimal.Parse(hdnIdFamilia.Value); theFamiliaDTO.UsuarioModificacion = myUsuario.Rut; bool validacionIntegridad = YouCom.bll.FamiliaBLL.ValidaEliminacionFamilia(theFamiliaDTO); if (validacionIntegridad) { string script = "alert(' No es posible eliminar una familia con informacion asociada.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); return; } else { bool respuesta = YouCom.bll.FamiliaBLL.Delete(theFamiliaDTO); if (respuesta) { cargarFamilia(); if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('Integrante Familia Eliminada correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { } } } }
protected bool setEnviaIngresoHabitual() { CultureInfo ci = new CultureInfo("Es-Es"); bool retorno = false; bool salida = false; YouCom.DTO.AccesoHogar.AccesoHogarDTO theAccesoHogarDTO = new YouCom.DTO.AccesoHogar.AccesoHogarDTO(); theAccesoHogarDTO.Avisar = "S"; theAccesoHogarDTO.NombreVisita = this.TxtNombre.Text.ToUpper(); theAccesoHogarDTO.ApellidoPaternoVisita = this.TxtApellidoPaterno.Text.ToUpper(); theAccesoHogarDTO.ApellidoMaternoVisita = this.TxtApellidoMaterno.Text.ToUpper(); theAccesoHogarDTO.EmailVisita = this.TxtEmail.Text.ToUpper(); theAccesoHogarDTO.RutVisita = YouCom.Service.Formato.Formato.limpiarRut(this.TxtRut.Text); theAccesoHogarDTO.TheCasaDTO = myUsuario.TheFamiliaDTO.TheCasaDTO; theAccesoHogarDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO; theAccesoHogarDTO.TheComunidadDTO = myUsuario.TheComunidadSeleccionDTO; YouCom.DTO.AccesoHogar.TipoVisitaDTO myTipoVisitaDTO = new YouCom.DTO.AccesoHogar.TipoVisitaDTO(); myTipoVisitaDTO.IdTipoVisita = decimal.Parse(this.ddlTipoVisita.SelectedValue); theAccesoHogarDTO.TheTipoVisitaDTO = myTipoVisitaDTO; YouCom.DTO.AccesoHogar.FrecuenciaDTO myFrecuenciaDTO = new YouCom.DTO.AccesoHogar.FrecuenciaDTO(); myFrecuenciaDTO.IdFrecuencia = 2; theAccesoHogarDTO.TheFrecuenciaDTO = myFrecuenciaDTO; YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut); theAccesoHogarDTO.TheFamiliaDTO = myFamiliaDTO; theAccesoHogarDTO.FechaInicio = Convert.ToDateTime(this.TxtFechaInicio.Text); theAccesoHogarDTO.FechaTermino = Convert.ToDateTime(this.TxtFechaTermino.Text); theAccesoHogarDTO.HoraInicio = ddlHoraInicio.SelectedValue + ":" + ddlMinutoInicio.SelectedValue; theAccesoHogarDTO.HoraTermino = ddlHoraTermino.SelectedValue + ":" + ddlMinutoTermino.SelectedValue; theAccesoHogarDTO.UsuarioIngreso = myUsuario.Rut; retorno = YouCom.bll.AccesoHogar.AccesoHogarBLL.Insert(theAccesoHogarDTO); if (retorno) { DateTime Desde = Convert.ToDateTime(this.TxtFechaInicio.Text); DateTime Hasta = Convert.ToDateTime(this.TxtFechaTermino.Text); System.TimeSpan diffResultFecha = Desde - Hasta; if (diffResultFecha.Days > 0) { string script = "alert('La fecha desde debe ser menor que la fecha hasta!!!.');"; script += "parent.location = '" + retorno1 + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } else { System.TimeSpan diffResultFechaCarga = Hasta - Desde; IList <YouCom.DTO.TrxHorasFechasDTO> ITrxHorasFechas = new List <YouCom.DTO.TrxHorasFechasDTO>(); ITrxHorasFechas = YouCom.Service.Generales.General.getGeneraFechas(Desde, diffResultFechaCarga.Days + 1, true, false); foreach (YouCom.DTO.TrxHorasFechasDTO fecha in ITrxHorasFechas) { foreach (ListItem semana in this.rblSemana.Items) { if (semana.Selected) { if (ci.DateTimeFormat.GetDayName(fecha.FechaHora.DayOfWeek).ToUpper() == semana.Text.ToUpper()) { YouCom.DTO.AccesoHogar.AccesoHogarDetalleDTO acceso_detalle = new YouCom.DTO.AccesoHogar.AccesoHogarDetalleDTO(); acceso_detalle.Fecha = fecha.FechaHora; acceso_detalle.UsuarioIngreso = myUsuario.Rut; YouCom.DTO.AccesoHogar.AccesoHogarDTO myAccesoHogarDTO = new YouCom.DTO.AccesoHogar.AccesoHogarDTO(); myAccesoHogarDTO.IdAccesoHogar = theAccesoHogarDTO.IdAccesoHogar; acceso_detalle.TheAccesoHogarDTO = myAccesoHogarDTO; YouCom.bll.AccesoHogar.AccesoHogarDetalleBLL.Insert(acceso_detalle); } } } } } } return(retorno); return(retorno); }
protected void rptVotacionPropuesta_OnItemCommand(object sender, RepeaterCommandEventArgs e) { UserControl wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasaFamilia1"); DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio"); DropDownList ddlComunidad = (DropDownList)wucCondominio.FindControl("ddlComunidad"); DropDownList ddlCasa = (DropDownList)wucCondominio.FindControl("ddlCasa"); DropDownList ddlFamilia = (DropDownList)wucCondominio.FindControl("ddlFamilia"); if (e.CommandName == "Editar") { HiddenField hdnVotacionPropuestaId = new HiddenField(); hdnVotacionPropuestaId = (HiddenField)e.Item.FindControl("hdnVotacionPropuestaId"); YouCom.DTO.Propuesta.PropuestaDTO myPropuestaDTO = new PropuestaDTO(); YouCom.DTO.Propuesta.VotacionPropuestaDTO theVotacionPropuestaDTO = new YouCom.DTO.Propuesta.VotacionPropuestaDTO(); theVotacionPropuestaDTO = YouCom.bll.VotacionPropuestaBLL.detalleVotacionPropuesta(decimal.Parse(hdnVotacionPropuestaId.Value)); myPropuestaDTO = YouCom.bll.PropuestaBLL.detallePropuesta(theVotacionPropuestaDTO.ThePropuestaDTO.IdPropuesta); this.hdnVotacionPropuestaId.Value = theVotacionPropuestaDTO.IdVotacionPropuesta.ToString(); this.txtVotacionPropuestaNombre.Text = theVotacionPropuestaDTO.ThePropuestaDTO.NombrePropuesta; this.txtVotacionPropuestaDescripcion.Text = theVotacionPropuestaDTO.ThePropuestaDTO.DescripcionPropuesta; this.FechaTermino.Text = theVotacionPropuestaDTO.FechaTerminoVotacionPropuesta.ToShortDateString(); this.FechaIngreso.Text = theVotacionPropuestaDTO.FechaInicioVotacionPropuesta.ToShortDateString(); ddlCondominio.SelectedIndex = ddlCondominio.Items.IndexOf(ddlCondominio.Items.FindByValue(theVotacionPropuestaDTO.TheCondominioDTO.IdCondominio.ToString())); ddlComunidad.DataSource = YouCom.bll.ComunidadBLL.getListadoComunidadByCondominio(decimal.Parse(ddlCondominio.SelectedValue)); ddlComunidad.DataTextField = "NombreComunidad"; ddlComunidad.DataValueField = "IdComunidad"; ddlComunidad.DataBind(); ddlComunidad.Items.Insert(0, new ListItem("Seleccione Comunidad", string.Empty)); ddlComunidad.SelectedIndex = ddlComunidad.Items.IndexOf(ddlComunidad.Items.FindByValue(theVotacionPropuestaDTO.TheComunidadDTO.IdComunidad.ToString())); YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO(); myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamilia(myPropuestaDTO.TheFamiliaDTO.IdFamilia); ddlCasa.DataSource = YouCom.bll.CasaBLL.getListadoCasaByComunidad(decimal.Parse(ddlComunidad.SelectedValue)); ddlCasa.DataTextField = "NombreCasa"; ddlCasa.DataValueField = "IdCasa"; ddlCasa.DataBind(); ddlCasa.Items.Insert(0, new ListItem("Seleccione Casa", string.Empty)); ddlCasa.SelectedIndex = ddlCasa.Items.IndexOf(ddlCasa.Items.FindByValue(myFamiliaDTO.TheCasaDTO.IdCasa.ToString())); ddlFamilia.DataSource = YouCom.bll.FamiliaBLL.getListadoFamiliaByCasa(decimal.Parse(ddlCasa.SelectedValue)); ddlFamilia.DataTextField = "NombreCompleto"; ddlFamilia.DataValueField = "IdFamilia"; ddlFamilia.DataBind(); ddlFamilia.Items.Insert(0, new ListItem("Seleccione Familia", string.Empty)); ddlFamilia.SelectedIndex = ddlFamilia.Items.IndexOf(ddlFamilia.Items.FindByValue(myPropuestaDTO.TheFamiliaDTO.IdFamilia.ToString())); ddlEstado.SelectedIndex = ddlEstado.Items.IndexOf(ddlEstado.Items.FindByValue(theVotacionPropuestaDTO.TheVotacionPropuestaEstadoDTO.IdVotacionPropuestaEstado.ToString())); this.HdnPropuestaId.Value = theVotacionPropuestaDTO.ThePropuestaDTO.IdPropuesta.ToString(); IList <VotacionPropuestaRespuestaDTO> theVotacionPropuestaRespuestaDTO = new List <VotacionPropuestaRespuestaDTO>(); theVotacionPropuestaRespuestaDTO = YouCom.bll.VotacionPropuestaRespuestaBLL.getListadoVotacionPropuestaRespuestaByVotacion(decimal.Parse(hdnVotacionPropuestaId.Value)); LitCantidadSi.Text = theVotacionPropuestaRespuestaDTO.Where(x => x.EleccionVotacion == "SI").Count().ToString(); LitCantidadNo.Text = theVotacionPropuestaRespuestaDTO.Where(x => x.EleccionVotacion == "NO").Count().ToString(); btnGrabar.Visible = false; btnEditar.Visible = true; } if (e.CommandName == "Eliminar") { HiddenField hdnVotacionPropuestaId = new HiddenField(); hdnVotacionPropuestaId = (HiddenField)e.Item.FindControl("hdnVotacionPropuestaId"); VotacionPropuestaDTO theVotacionPropuestaDTO = new VotacionPropuestaDTO(); theVotacionPropuestaDTO.IdVotacionPropuesta = decimal.Parse(hdnVotacionPropuestaId.Value); theVotacionPropuestaDTO.UsuarioModificacion = myUsuario.Rut; bool respuesta = YouCom.bll.VotacionPropuestaBLL.Delete(theVotacionPropuestaDTO); if (respuesta) { cargarVotacionPropuesta(); if (!Page.ClientScript.IsClientScriptBlockRegistered("SET")) { string script = "alert('VotacionPropuesta Eliminado correctamente.');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true); } } else { } } if (e.CommandName == "Votaciones") { HiddenField hdnVotacionPropuestaId = new HiddenField(); hdnVotacionPropuestaId = (HiddenField)e.Item.FindControl("hdnVotacionPropuestaId"); pnlAdministracionVotacionPropuesta.Visible = false; pnlVotaciones.Visible = true; IList <VotacionPropuestaRespuestaDTO> theVotacionPropuestaRespuestaDTO = new List <VotacionPropuestaRespuestaDTO>(); theVotacionPropuestaRespuestaDTO = YouCom.bll.VotacionPropuestaRespuestaBLL.getListadoVotacionPropuestaRespuestaByVotacion(decimal.Parse(hdnVotacionPropuestaId.Value)); rptVotaciones.DataSource = theVotacionPropuestaRespuestaDTO; rptVotaciones.DataBind(); } }