Ejemplo n.º 1
0
    protected void btnEditar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        btnEditar.Visible = false;
        btnGrabar.Visible = true;

        ArchivoDTO theArchivoDTO = new ArchivoDTO();

        theArchivoDTO.ArchivoId          = decimal.Parse(this.hdnArchivoId.Value);
        theArchivoDTO.ArchivoTitulo      = this.txtArchivoTitulo.Text.ToUpper();
        theArchivoDTO.ArchivoDescripcion = this.txtArchivoDescripcion.Text.ToUpper();

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio   = decimal.Parse(ddlCondominio.SelectedValue);
        theArchivoDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad    = decimal.Parse(ddlComunidad.SelectedValue);
        theArchivoDTO.TheComunidadDTO = myComunidadDTO;

        CategoriaDTO myCategoria = new CategoriaDTO();

        myCategoria.IdCategoria       = decimal.Parse(this.ddlCategoria.SelectedValue);
        theArchivoDTO.TheCategoriaDTO = myCategoria;

        theArchivoDTO.UsuarioModificacion = myUsuario.Rut;

        if (this.FileArchivo.HasFile)
        {
            theArchivoDTO.ArchivoNombre = this.ProcessOtherFile(FileArchivo, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathBann"));
        }
        else
        {
            YouCom.DTO.ArchivoDTO myArchivoDTO = new YouCom.DTO.ArchivoDTO();
            myArchivoDTO = YouCom.bll.ArchivoBLL.detalleArchivo(decimal.Parse(hdnArchivoId.Value));

            theArchivoDTO.ArchivoNombre = myArchivoDTO.ArchivoNombre;
        }

        bool respuesta = YouCom.bll.ArchivoBLL.Update(theArchivoDTO);

        if (respuesta)
        {
            cargarArchivo();
            this.txtArchivoTitulo.Text      = string.Empty;
            this.txtArchivoDescripcion.Text = string.Empty;

            if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
            {
                string script = "alert('Archivo editado correctamente.');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            }
        }
        else
        {
        }
    }
Ejemplo n.º 2
0
    protected void btnGrabar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        List <CasaDTO> casa = new List <CasaDTO>();

        casa = (Session["casa"] as List <CasaDTO>);

        CasaDTO theCasaDTO = new CasaDTO();

        theCasaDTO.NombreCasa    = this.txtNombre.Text.ToUpper();
        theCasaDTO.DireccionCasa = this.txtDireccion.Text.ToUpper();
        theCasaDTO.TelefonoCasa  = this.txtTelefono.Text;

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio = decimal.Parse(ddlCondominio.SelectedValue);
        theCasaDTO.TheCondominioDTO  = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue);
        theCasaDTO.TheComunidadDTO = myComunidadDTO;

        theCasaDTO.UsuarioIngreso = myUsuario.Rut;

        casa = casa.Where(x => x.NombreCasa == theCasaDTO.NombreCasa).ToList();
        if (casa.Any())
        {
            foreach (var item in casa)
            {
                if (item.Estado == "2")
                {
                    string script = "alert('Casa Existe pero Fue Eliminado Para Activarlo dirigase a Papelera.');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
                else
                {
                    string script = "alert('Casa ya Existe .');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
            }
        }

        bool respuesta = YouCom.bll.CasaBLL.Insert(theCasaDTO);

        if (respuesta)
        {
            this.txtNombre.Text = string.Empty;
            string script = "alert('Casa Ingresada correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarCasa();
        }
        else
        {
        }
    }
Ejemplo n.º 3
0
    protected void btnGrabar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        ProyectoDTO theProyectoDTO = new ProyectoDTO();

        theProyectoDTO.NombreProyecto       = this.txtProyectoNombre.Text.ToUpper();
        theProyectoDTO.DescripcionProyecto  = this.txtProyectoDescripcion.Text.ToUpper();
        theProyectoDTO.FechaInicioProyecto  = DateTime.ParseExact(this.FechaInicio.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theProyectoDTO.FechaTerminoProyecto = DateTime.ParseExact(this.FechaTermino.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theProyectoDTO.FechaEntregaProyecto = DateTime.ParseExact(this.FechaEntrega.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theProyectoDTO.DireccionProyecto    = this.txtDireccion.Text.ToUpper();
        theProyectoDTO.PresupuestoProyecto  = decimal.Parse(this.txtPresupuestoProyecto.Text);

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio    = decimal.Parse(ddlCondominio.SelectedValue);
        theProyectoDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad     = decimal.Parse(ddlComunidad.SelectedValue);
        theProyectoDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.ProyectoEstadoDTO myProyectoEstadoDTO = new YouCom.DTO.ProyectoEstadoDTO();
        myProyectoEstadoDTO.IdProyectoEstado = decimal.Parse(this.ddlEstado.SelectedValue);
        theProyectoDTO.TheProyectoEstadoDTO  = myProyectoEstadoDTO;

        YouCom.DTO.EmpresaContratistaDTO myEmpresaContratistaDTO = new YouCom.DTO.EmpresaContratistaDTO();
        myEmpresaContratistaDTO.IdEmpresaContratista = decimal.Parse(this.ddlEmpresaContratista.SelectedValue);
        theProyectoDTO.TheEmpresaContratistaDTO      = myEmpresaContratistaDTO;

        theProyectoDTO.UsuarioIngreso = myUsuario.Rut;

        bool respuesta = YouCom.bll.ProyectoBLL.Insert(theProyectoDTO);

        if (respuesta)
        {
            cargarProyecto();
            this.txtProyectoNombre.Text      = string.Empty;
            this.txtProyectoDescripcion.Text = string.Empty;
            this.txtDireccion.Text           = string.Empty;
            this.FechaInicio.Text            = string.Empty;
            this.FechaTermino.Text           = string.Empty;
            this.FechaEntrega.Text           = string.Empty;
            this.txtPresupuestoProyecto.Text = string.Empty;

            ddlCondominio.ClearSelection();
            ddlComunidad.ClearSelection();
            this.ddlEmpresaContratista.ClearSelection();

            string script = "alert('Proyecto ingresado correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarProyecto();
        }
        else
        {
        }
    }
Ejemplo n.º 4
0
        public static IList <YouCom.DTO.Propietario.FamiliaDTO> getListadoFamilia()
        {
            IList <YouCom.DTO.Propietario.FamiliaDTO> IFamilia = new List <YouCom.DTO.Propietario.FamiliaDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.Propietario.FamiliaDAL.getListadoFamilia(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.Propietario.FamiliaDTO familia = new YouCom.DTO.Propietario.FamiliaDTO();

                    familia.IdFamilia = decimal.Parse(wobjDataRow["idFamilia"].ToString());

                    YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
                    myCondominioDTO.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString());
                    familia.TheCondominioDTO     = myCondominioDTO;

                    YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
                    myComunidadDTO.IdComunidad = decimal.Parse(wobjDataRow["idComunidad"].ToString());
                    familia.TheComunidadDTO    = myComunidadDTO;

                    YouCom.DTO.Propietario.CasaDTO myCasaDTO = new YouCom.DTO.Propietario.CasaDTO();
                    myCasaDTO.IdCasa     = decimal.Parse(wobjDataRow["idCasa"].ToString());
                    myCasaDTO.NombreCasa = wobjDataRow["nombreCasa"].ToString();
                    familia.TheCasaDTO   = myCasaDTO;

                    YouCom.DTO.Propietario.OcupacionDTO myOcupacionDTO = new YouCom.DTO.Propietario.OcupacionDTO();
                    myOcupacionDTO.IdOcupacion     = decimal.Parse(wobjDataRow["idOcupacion"].ToString());
                    myOcupacionDTO.NombreOcupacion = wobjDataRow["nombreOcupacion"].ToString();
                    familia.TheOcupacionDTO        = myOcupacionDTO;

                    familia.RutFamilia             = wobjDataRow["rutFamilia"].ToString();
                    familia.NombreFamilia          = wobjDataRow["nombreFamilia"].ToString();
                    familia.ApellidoPaternoFamilia = wobjDataRow["apellidoPaternoFamilia"].ToString();
                    familia.ApellidoMaternoFamilia = wobjDataRow["apellidoMaternoFamilia"].ToString();

                    YouCom.DTO.Propietario.ParentescoDTO myParentescoDTO = new YouCom.DTO.Propietario.ParentescoDTO();
                    myParentescoDTO.IdParentesco     = decimal.Parse(wobjDataRow["idParentesco"].ToString());
                    myParentescoDTO.NombreParentesco = wobjDataRow["nombreParentesco"].ToString();
                    familia.TheParentescoDTO         = myParentescoDTO;

                    familia.CelularFamilia  = wobjDataRow["celularFamilia"].ToString();
                    familia.TelefonoFamilia = wobjDataRow["telefonoFamilia"].ToString();
                    familia.EmailFamilia    = wobjDataRow["emailFamilia"].ToString();

                    familia.UsuarioIngreso      = wobjDataRow["usuario_ingreso"].ToString();
                    familia.FechaIngreso        = wobjDataRow["fecha_ingreso"].ToString();
                    familia.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString();
                    familia.FechaModificacion   = wobjDataRow["fecha_modificacion"].ToString();
                    familia.Estado = wobjDataRow["estado"].ToString();

                    IFamilia.Add(familia);
                }
            }

            return(IFamilia);
        }
Ejemplo n.º 5
0
    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
        {
        }
    }
Ejemplo n.º 6
0
    protected void btnEditar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        btnEditar.Visible = false;
        btnGrabar.Visible = true;

        BannerDTO theBannerDTO = new BannerDTO();

        theBannerDTO.BannerId             = decimal.Parse(this.hdnBannerId.Value);
        theBannerDTO.BannerNombre         = this.txtBannerNombre.Text.ToUpper();
        theBannerDTO.BannerDescripcion    = this.txtBannerDescripcion.Text.ToUpper();
        theBannerDTO.BannerTipoDespliegue = this.DDLBannerLink.SelectedValue;
        theBannerDTO.UsuarioModificacion  = myUsuario.Rut;

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio  = decimal.Parse(ddlCondominio.SelectedValue);
        theBannerDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad   = decimal.Parse(ddlComunidad.SelectedValue);
        theBannerDTO.TheComunidadDTO = myComunidadDTO;

        if (this.FileImagenBanner.HasFile)
        {
            if (System.IO.Path.GetExtension(FileImagenBanner.PostedFile.FileName) == ".swf")
            {
                theBannerDTO.BannerImagen = this.ProcessOtherFile(FileImagenBanner, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathBannerPub"));
            }
            else
            {
                theBannerDTO.BannerImagen = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenBanner, YouCom.Service.Generales.General.GetPropiedad("UploadsPathBannerPub"), 198, 118, Page);
            }
        }

        bool respuesta = YouCom.bll.BannerBLL.Update(theBannerDTO);

        if (respuesta)
        {
            cargarBanner();
            this.txtBannerNombre.Text      = string.Empty;
            this.txtBannerDescripcion.Text = string.Empty;
            ddlCondominio.ClearSelection();
            this.DDLBannerLink.ClearSelection();

            if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
            {
                string script = "alert('Banner editado 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");

        VotacionPropuestaDTO theVotacionPropuestaDTO = new VotacionPropuestaDTO();

        theVotacionPropuestaDTO.IdVotacionPropuesta           = decimal.Parse(this.hdnVotacionPropuestaId.Value);
        theVotacionPropuestaDTO.FechaInicioVotacionPropuesta  = DateTime.ParseExact(this.FechaIngreso.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theVotacionPropuestaDTO.FechaTerminoVotacionPropuesta = DateTime.ParseExact(this.FechaTermino.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio             = decimal.Parse(ddlCondominio.SelectedValue);
        theVotacionPropuestaDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue);
        theVotacionPropuestaDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.Propuesta.VotacionPropuestaEstadoDTO myVotacionPropuestaEstadoDTO = new YouCom.DTO.Propuesta.VotacionPropuestaEstadoDTO();
        myVotacionPropuestaEstadoDTO.IdVotacionPropuestaEstado = decimal.Parse(this.ddlEstado.SelectedValue);
        theVotacionPropuestaDTO.TheVotacionPropuestaEstadoDTO  = myVotacionPropuestaEstadoDTO;

        YouCom.DTO.Propuesta.PropuestaDTO myPropuestaDTO = new YouCom.DTO.Propuesta.PropuestaDTO();
        myPropuestaDTO.IdPropuesta = decimal.Parse(this.HdnPropuestaId.Value);
        theVotacionPropuestaDTO.ThePropuestaDTO = myPropuestaDTO;

        theVotacionPropuestaDTO.MotivoEstado = txtMotivoEstado.Text;

        theVotacionPropuestaDTO.UsuarioModificacion = myUsuario.Rut;

        bool respuesta = YouCom.bll.VotacionPropuestaBLL.Insert(theVotacionPropuestaDTO);

        if (respuesta)
        {
            this.txtVotacionPropuestaNombre.Text      = string.Empty;
            this.txtVotacionPropuestaDescripcion.Text = string.Empty;
            this.FechaTermino.Text = string.Empty;
            this.FechaIngreso.Text = string.Empty;

            ddlCondominio.ClearSelection();
            ddlComunidad.ClearSelection();
            ddlFamilia.ClearSelection();

            string script = "alert('VotacionPropuesta ingresada correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarVotacionPropuesta();
        }
        else
        {
        }
    }
Ejemplo n.º 8
0
    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
        {
        }
    }
Ejemplo n.º 9
0
        protected void btnEditar_Click(object sender, EventArgs e)
        {
            UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl(YouCom.Service.Configuracion.Config.getPageName(false) + "1").FindControl("wucCondominio1");
            DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
            DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

            btnEditar.Visible = false;
            BtnCrear.Visible  = true;

            OperadorDTO theUsuarioDTO = new OperadorDTO();

            theUsuarioDTO.Usuario         = YouCom.Service.Formato.Formato.limpiarRut(this.txtRut.Text);
            theUsuarioDTO.Rut             = YouCom.Service.Formato.Formato.limpiarRut(this.txtRut.Text);
            theUsuarioDTO.Password        = this.txtpasswordInicial.Text;
            theUsuarioDTO.Nombres         = this.txtNombre.Text;
            theUsuarioDTO.Paterno         = this.txtPaterno.Text;
            theUsuarioDTO.Materno         = this.txtMaterno.Text;
            theUsuarioDTO.Mail            = this.txtMail.Text;
            theUsuarioDTO.FechaNacimiento = Convert.ToDateTime(this.TxtFechaNacimiento.Text);
            theUsuarioDTO.Password        = txtpasswordInicial.Text;

            YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
            myCondominioDTO.IdCondominio   = decimal.Parse(ddlCondominio.SelectedValue);
            theUsuarioDTO.TheCondominioDTO = myCondominioDTO;

            YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
            myComunidadDTO.IdComunidad    = decimal.Parse(ddlComunidad.SelectedValue);
            theUsuarioDTO.TheComunidadDTO = myComunidadDTO;

            YouCom.DTO.Seguridad.PerfilDTO myPerfilDTO = new YouCom.DTO.Seguridad.PerfilDTO();
            myPerfilDTO.IdPerfil              = decimal.Parse(ddlPerfil.SelectedValue);
            theUsuarioDTO.ThePerfilDTO        = myPerfilDTO;
            theUsuarioDTO.UsuarioModificacion = myUsuario.Rut;

            bool respuesta = YouCom.Seguridad.BLL.UsuarioBLL.Update(theUsuarioDTO);

            if (respuesta)
            {
                cargaUsuarios();
                this.txtNombre.Text = string.Empty;

                if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
                {
                    string script = "alert('Casa editada correctamente.');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                }
            }
            else
            {
            }
        }
Ejemplo n.º 10
0
    protected void btnEditar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        btnEditar.Visible = false;
        btnGrabar.Visible = true;

        ServiciosDTO theServiciosDTO = new ServiciosDTO();

        theServiciosDTO.NombreServicio      = this.txtServicioNombre.Text.ToUpper();
        theServiciosDTO.DescripcionServicio = this.txtServicioDescripcion.Text.ToUpper();

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio     = decimal.Parse(ddlCondominio.SelectedValue);
        theServiciosDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad      = decimal.Parse(ddlComunidad.SelectedValue);
        theServiciosDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO();
        myCategoriaDTO.IdCategoria      = decimal.Parse(ddlCategoria.SelectedValue);
        theServiciosDTO.TheCategoriaDTO = myCategoriaDTO;

        theServiciosDTO.FechaInicio  = DateTime.ParseExact(this.FechaInicio.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theServiciosDTO.FechaTermino = DateTime.ParseExact(this.FechaTermino.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

        theServiciosDTO.UsuarioModificacion = myUsuario.Rut;

        bool respuesta = YouCom.bll.ServiciosBLL.Update(theServiciosDTO);

        if (respuesta)
        {
            cargarServicios();
            this.txtServicioNombre.Text      = string.Empty;
            this.txtServicioDescripcion.Text = string.Empty;
            this.FechaInicio.Text            = string.Empty;
            this.FechaTermino.Text           = string.Empty;

            if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
            {
                string script = "alert('Servicio editado correctamente.');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            }
        }
        else
        {
        }
    }
Ejemplo n.º 11
0
    protected void btnEditar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        btnEditar.Visible = false;
        btnGrabar.Visible = true;

        CategoriaDTO theCategoriaDTO = new CategoriaDTO();

        theCategoriaDTO.IdCategoria          = decimal.Parse(this.hdnIdCategoria.Value);
        theCategoriaDTO.NombreCategoria      = this.txtNombre.Text;
        theCategoriaDTO.DescripcionCategoria = this.txtDescripcion.Text;

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio     = decimal.Parse(ddlCondominio.SelectedValue);
        theCategoriaDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad      = decimal.Parse(ddlComunidad.SelectedValue);
        theCategoriaDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.TipoCategoriaDTO myTipoCategoriaDTO = new YouCom.DTO.TipoCategoriaDTO();
        myTipoCategoriaDTO.IdTipoCategoria  = decimal.Parse(this.ddlTipo.SelectedValue);
        theCategoriaDTO.TheTipoCategoriaDTO = myTipoCategoriaDTO;

        theCategoriaDTO.UsuarioModificacion = myUsuario.Rut;

        bool respuesta = YouCom.bll.CategoriaBLL.Update(theCategoriaDTO);

        if (respuesta)
        {
            cargarCategoria();
            this.txtNombre.Text      = string.Empty;
            this.txtDescripcion.Text = string.Empty;
            this.ddlTipo.ClearSelection();

            if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
            {
                string script = "alert('Categoria editada correctamente.');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            }
        }
        else
        {
        }
    }
Ejemplo n.º 12
0
        public static IList <YouCom.DTO.DirectivaDTO> getListadoDirectiva()
        {
            IList <YouCom.DTO.DirectivaDTO> IDirectiva = new List <YouCom.DTO.DirectivaDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.DirectivaDAL.getListadoDirectiva(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.DirectivaDTO directiva = new YouCom.DTO.DirectivaDTO();

                    directiva.IdDirectiva = decimal.Parse(wobjDataRow["idDirectiva"].ToString());

                    YouCom.DTO.CargoDTO myCargoDTO = new YouCom.DTO.CargoDTO();
                    myCargoDTO.IdCargo     = decimal.Parse(wobjDataRow["idCargo"].ToString());
                    myCargoDTO.NombreCargo = wobjDataRow["nombreCargo"].ToString();
                    directiva.TheCargoDTO  = myCargoDTO;

                    YouCom.DTO.Seguridad.CondominioDTO myCondominio = new YouCom.DTO.Seguridad.CondominioDTO();
                    myCondominio.IdCondominio  = decimal.Parse(wobjDataRow["idCondominio"].ToString());
                    directiva.TheCondominioDTO = myCondominio;

                    YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
                    myComunidadDTO.IdComunidad         = decimal.Parse(wobjDataRow["idComunidad"].ToString());
                    directiva.TheComunidadDTO          = myComunidadDTO;
                    directiva.RutDirectiva             = wobjDataRow["rutDirectiva"].ToString();
                    directiva.NombreDirectiva          = wobjDataRow["nombreDirectiva"].ToString();
                    directiva.ApellidoPaternoDirectiva = wobjDataRow["apellidoPaternoDirectiva"].ToString();
                    directiva.ApellidoMaternoDirectiva = wobjDataRow["apellidoMaternoDirectiva"].ToString();
                    directiva.TelefonoDirectiva        = wobjDataRow["telefonoDirectiva"].ToString();
                    directiva.ImagenDirectiva          = wobjDataRow["imagenDirectiva"].ToString();
                    directiva.EmailDirectiva           = wobjDataRow["correoDirectiva"].ToString();
                    directiva.FechaNacimientoDirectiva = Convert.ToDateTime(wobjDataRow["fechaNacimientoDirectiva"].ToString());

                    directiva.UsuarioIngreso      = wobjDataRow["usuario_ingreso"].ToString();
                    directiva.FechaIngreso        = wobjDataRow["fecha_ingreso"].ToString();
                    directiva.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString();
                    directiva.FechaModificacion   = wobjDataRow["fecha_modificacion"].ToString();

                    directiva.Estado = wobjDataRow["estado"].ToString();

                    IDirectiva.Add(directiva);
                }
            }

            return(IDirectiva);
        }
Ejemplo n.º 13
0
        public static IList <OperadorDTO> getListadoUsuario()
        {
            IList <OperadorDTO> IUsuario = new List <OperadorDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.Seguridad.DAL.UsuarioDAL.getListadoUsuario(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    OperadorDTO usuario = new OperadorDTO();

                    usuario.Rut = wobjDataRow["USU_RUT"].ToString();

                    YouCom.DTO.Seguridad.CondominioDTO myCondominio = new YouCom.DTO.Seguridad.CondominioDTO();
                    myCondominio.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString());
                    usuario.TheCondominioDTO  = myCondominio;

                    YouCom.DTO.Seguridad.ComunidadDTO myComunidad = new YouCom.DTO.Seguridad.ComunidadDTO();
                    myComunidad.IdComunidad  = decimal.Parse(wobjDataRow["idComunidad"].ToString());
                    usuario.TheCondominioDTO = myCondominio;

                    usuario.Nombres = wobjDataRow["nombre_usuario"].ToString();
                    usuario.Paterno = wobjDataRow["paterno_usuario"].ToString();
                    usuario.Materno = wobjDataRow["materno_usuario"].ToString();

                    usuario.Password            = wobjDataRow["password"].ToString();
                    usuario.Mail                = wobjDataRow["mail_usuario"].ToString();
                    usuario.FechaNacimiento     = Convert.ToDateTime(wobjDataRow["fecha_nac_usuario"].ToString());
                    usuario.FechaPassword       = !string.IsNullOrEmpty(wobjDataRow["fecha_password"].ToString()) ? Convert.ToDateTime(wobjDataRow["fecha_password"].ToString()) : DateTime.MinValue;
                    usuario.IntentoFallidoFecha = !string.IsNullOrEmpty(wobjDataRow["intento_fallido_fecha"].ToString()) ? Convert.ToDateTime(wobjDataRow["intento_fallido_fecha"].ToString()) : DateTime.MinValue;
                    usuario.IntentoFallidoCant  = !string.IsNullOrEmpty(wobjDataRow["intento_fallido_cant"].ToString()) ? int.Parse(wobjDataRow["intento_fallido_cant"].ToString()): 0;

                    usuario.UsuarioIngreso      = wobjDataRow["usuario_ingreso"].ToString();
                    usuario.FechaIngreso        = wobjDataRow["fecha_ingreso"].ToString();
                    usuario.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString();
                    usuario.FechaModificacion   = wobjDataRow["fecha_modificacion"].ToString();

                    usuario.Estado = wobjDataRow["estado"].ToString();

                    IUsuario.Add(usuario);
                }
            }

            return(IUsuario);
        }
Ejemplo n.º 14
0
        public static IList <YouCom.DTO.PorteriaDTO> getListadoPorteria()
        {
            IList <YouCom.DTO.PorteriaDTO> IPorteria = new List <YouCom.DTO.PorteriaDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.PorteriaDAL.getListadoPorteria(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.PorteriaDTO portero = new YouCom.DTO.PorteriaDTO();

                    portero.IdPorteria = decimal.Parse(wobjDataRow["IdPorteria"].ToString());

                    YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
                    myCondominioDTO.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString());
                    portero.TheCondominioDTO     = myCondominioDTO;

                    YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
                    myComunidadDTO.IdComunidad = decimal.Parse(wobjDataRow["idComunidad"].ToString());
                    portero.TheComunidadDTO    = myComunidadDTO;

                    portero.NombrePorteria          = wobjDataRow["nombrePorteria"].ToString();
                    portero.ApellidoPaternoPorteria = wobjDataRow["apellidoPaternoPorteria"].ToString();
                    portero.ApellidoMaternoPorteria = wobjDataRow["apellidoMaternoPorteria"].ToString();
                    portero.RutPorteria             = wobjDataRow["rutPorteria"].ToString();
                    portero.TelefonoPorteria        = wobjDataRow["telefonoPorteria"].ToString();
                    portero.EmailPorteria           = wobjDataRow["emailPorteria"].ToString();
                    portero.FechaNacimientoPorteria = Convert.ToDateTime(wobjDataRow["fechaNacimientoPorteria"].ToString());

                    portero.UsuarioIngreso      = wobjDataRow["usuario_ingreso"].ToString();
                    portero.FechaIngreso        = wobjDataRow["fecha_ingreso"].ToString();
                    portero.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString();
                    portero.FechaModificacion   = wobjDataRow["fecha_modificacion"].ToString();

                    portero.Estado = wobjDataRow["estado"].ToString();

                    IPorteria.Add(portero);
                }
            }

            return(IPorteria);
        }
Ejemplo n.º 15
0
    protected void btnGrabar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        List <DirectivaDTO> directivas = new List <DirectivaDTO>();

        directivas = (Session["directiva"] as List <DirectivaDTO>);

        DirectivaDTO theDirectivaDTO = new DirectivaDTO();

        theDirectivaDTO.RutDirectiva             = this.txtRut.Text.ToUpper();
        theDirectivaDTO.NombreDirectiva          = this.txtNombre.Text.ToUpper();
        theDirectivaDTO.ApellidoPaternoDirectiva = this.txtApellidoPaterno.Text.ToUpper();
        theDirectivaDTO.ApellidoMaternoDirectiva = this.txtApellidoMaterno.Text.ToUpper();
        theDirectivaDTO.TelefonoDirectiva        = this.txtTelefono.Text;
        theDirectivaDTO.EmailDirectiva           = this.txtMail.Text;

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio     = decimal.Parse(ddlCondominio.SelectedValue);
        theDirectivaDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad      = decimal.Parse(ddlComunidad.SelectedValue);
        theDirectivaDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.CargoDTO myCargoDTO = new YouCom.DTO.CargoDTO();
        myCargoDTO.IdCargo          = decimal.Parse(ddlCargo.SelectedValue);
        theDirectivaDTO.TheCargoDTO = myCargoDTO;

        theDirectivaDTO.UsuarioIngreso = myUsuario.Rut;

        if (this.FileImagenDirectiva.HasFile)
        {
            if (System.IO.Path.GetExtension(FileImagenDirectiva.PostedFile.FileName) == ".swf")
            {
                theDirectivaDTO.ImagenDirectiva = this.ProcessOtherFile(FileImagenDirectiva, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathDirectivaPub"));
            }
            else
            {
                theDirectivaDTO.ImagenDirectiva = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenDirectiva, YouCom.Service.Generales.General.GetPropiedad("UploadsPathDirectivaPub"), 198, 118, Page);
            }
        }

        directivas = directivas.Where(x => x.NombreDirectiva == theDirectivaDTO.NombreDirectiva).ToList();
        if (directivas.Any())
        {
            foreach (var item in directivas)
            {
                if (item.Estado == "2")
                {
                    string script = "alert('Directiva existe pero fue eliminado para activarlo dirigase a Papelera.');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
                else
                {
                    string script = "alert('Directiva ya Existe .');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
            }
        }

        bool respuesta = YouCom.bll.DirectivaBLL.Insert(theDirectivaDTO);

        if (respuesta)
        {
            this.txtRut.Text             = string.Empty;
            this.txtNombre.Text          = string.Empty;
            this.txtApellidoPaterno.Text = string.Empty;
            this.txtApellidoMaterno.Text = string.Empty;
            this.txtTelefono.Text        = string.Empty;
            this.txtMail.Text            = string.Empty;

            this.ddlCargo.ClearSelection();
            ddlCondominio.ClearSelection();

            string script = "alert('Directiva Ingresado correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarDirectiva();
        }
        else
        {
        }
    }
Ejemplo n.º 16
0
    protected void btnEditar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        btnEditar.Visible = false;
        btnGrabar.Visible = true;

        DirectivaDTO theDirectivaDTO = new DirectivaDTO();

        theDirectivaDTO.IdDirectiva              = decimal.Parse(this.hdnDirectivaId.Value);
        theDirectivaDTO.RutDirectiva             = this.txtRut.Text.ToUpper();
        theDirectivaDTO.NombreDirectiva          = this.txtNombre.Text.ToUpper();
        theDirectivaDTO.ApellidoPaternoDirectiva = this.txtApellidoPaterno.Text.ToUpper();
        theDirectivaDTO.ApellidoMaternoDirectiva = this.txtApellidoMaterno.Text.ToUpper();
        theDirectivaDTO.TelefonoDirectiva        = this.txtTelefono.Text;
        theDirectivaDTO.EmailDirectiva           = this.txtMail.Text;

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio     = decimal.Parse(ddlCondominio.SelectedValue);
        theDirectivaDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad      = decimal.Parse(ddlComunidad.SelectedValue);
        theDirectivaDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.CargoDTO myCargoDTO = new YouCom.DTO.CargoDTO();
        myCargoDTO.IdCargo                  = decimal.Parse(ddlCargo.SelectedValue);
        theDirectivaDTO.TheCargoDTO         = myCargoDTO;
        theDirectivaDTO.UsuarioModificacion = myUsuario.Rut;

        if (this.FileImagenDirectiva.HasFile)
        {
            theDirectivaDTO.ImagenDirectiva = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenDirectiva, YouCom.Service.Generales.General.GetPropiedad("UploadsPathDirectivaPub"), 198, 118, Page);
        }
        else
        {
            YouCom.DTO.DirectivaDTO myDirectivaDTO = new YouCom.DTO.DirectivaDTO();
            myDirectivaDTO = YouCom.bll.DirectivaBLL.detalleDirectiva(decimal.Parse(hdnDirectivaId.Value));

            theDirectivaDTO.ImagenDirectiva = myDirectivaDTO.ImagenDirectiva;
        }

        bool respuesta = YouCom.bll.DirectivaBLL.Update(theDirectivaDTO);

        if (respuesta)
        {
            cargarDirectiva();
            this.txtRut.Text             = string.Empty;
            this.txtNombre.Text          = string.Empty;
            this.txtApellidoPaterno.Text = string.Empty;
            this.txtApellidoMaterno.Text = string.Empty;
            this.txtTelefono.Text        = string.Empty;
            this.txtMail.Text            = string.Empty;

            this.ddlCargo.ClearSelection();
            ddlCondominio.ClearSelection();

            if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
            {
                string script = "alert('Directiva editada correctamente.');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            }
        }
        else
        {
        }
    }
Ejemplo n.º 17
0
    protected void btnGrabar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        List <ServiciosDTO> servicio = new List <ServiciosDTO>();

        servicio = (Session["servicio"] as List <ServiciosDTO>);

        ServiciosDTO theServiciosDTO = new ServiciosDTO();

        theServiciosDTO.NombreServicio      = this.txtServicioNombre.Text.ToUpper();
        theServiciosDTO.DescripcionServicio = this.txtServicioDescripcion.Text.ToUpper();

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio     = decimal.Parse(ddlCondominio.SelectedValue);
        theServiciosDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad      = decimal.Parse(ddlComunidad.SelectedValue);
        theServiciosDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO();
        myCategoriaDTO.IdCategoria      = decimal.Parse(ddlCategoria.SelectedValue);
        theServiciosDTO.TheCategoriaDTO = myCategoriaDTO;

        theServiciosDTO.FechaInicio  = DateTime.ParseExact(this.FechaInicio.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theServiciosDTO.FechaTermino = DateTime.ParseExact(this.FechaTermino.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

        theServiciosDTO.UsuarioIngreso = myUsuario.Rut;

        servicio = servicio.Where(x => x.NombreServicio == theServiciosDTO.NombreServicio).ToList();
        if (servicio.Any())
        {
            foreach (var item in servicio)
            {
                if (item.Estado == "2")
                {
                    string script = "alert('Servicio existe pero fue eliminado para activarlo dirigase a Papelera.');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
                else
                {
                    string script = "alert('Servicio ya Existe .');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
            }
        }

        bool respuesta = YouCom.bll.ServiciosBLL.Insert(theServiciosDTO);

        if (respuesta)
        {
            this.txtServicioNombre.Text      = string.Empty;
            this.txtServicioDescripcion.Text = string.Empty;
            this.FechaInicio.Text            = string.Empty;
            this.FechaTermino.Text           = string.Empty;

            string script = "alert('Servicio ingresado correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarServicios();
        }
        else
        {
        }
    }
Ejemplo n.º 18
0
    protected void btnEditar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasa1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");
        DropDownList ddlCasa       = (DropDownList)wucCondominio.FindControl("ddlCasa");

        btnEditar.Visible = false;
        btnGrabar.Visible = true;

        YouCom.DTO.GastosComunes.GastoComunDTO theGastosComunesDTO = new YouCom.DTO.GastosComunes.GastoComunDTO();
        theGastosComunesDTO.IdGastoComun     = decimal.Parse(this.hdnIdGastoComun.Value);
        theGastosComunesDTO.DescripcionGasto = this.txtDescripcion.Text.ToUpper();
        theGastosComunesDTO.MontoGasto       = decimal.Parse(this.txtMonto.Text);
        theGastosComunesDTO.FechaGasto       = DateTime.ParseExact(this.FechaGasto.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio         = decimal.Parse(ddlCondominio.SelectedValue);
        theGastosComunesDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad          = decimal.Parse(ddlComunidad.SelectedValue);
        theGastosComunesDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.Propietario.CasaDTO myCasa = new YouCom.DTO.Propietario.CasaDTO();
        myCasa.IdCasa = decimal.Parse(ddlCasa.SelectedValue);
        theGastosComunesDTO.TheCasaDTO = myCasa;

        YouCom.DTO.GastosComunes.GastoComunEstadoDTO myGastoComunEstadoDTO = new YouCom.DTO.GastosComunes.GastoComunEstadoDTO();
        myGastoComunEstadoDTO.IdGastoComunEstado   = decimal.Parse(this.ddlEstado.SelectedValue);
        theGastosComunesDTO.TheGastoComunEstadoDTO = myGastoComunEstadoDTO;

        theGastosComunesDTO.FechaPagoGasto      = DateTime.ParseExact(this.FechaPago.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theGastosComunesDTO.ComentarioGasto     = this.txtComentario.Text;
        theGastosComunesDTO.UsuarioModificacion = myUsuario.Rut;

        if (this.FileArchivo.HasFile)
        {
            theGastosComunesDTO.ArchivoGasto = this.ProcessOtherFile(FileArchivo, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathGastoComunPub"));
        }
        else
        {
            YouCom.DTO.GastosComunes.GastoComunDTO myGastosComunesDTO = new YouCom.DTO.GastosComunes.GastoComunDTO();
            myGastosComunesDTO = YouCom.bll.GastosComunes.GastoComunBLL.detalleGastosComunes(decimal.Parse(hdnIdGastoComun.Value));

            theGastosComunesDTO.ArchivoGasto = myGastosComunesDTO.ArchivoGasto;
        }

        bool respuesta = YouCom.bll.GastosComunes.GastoComunBLL.Update(theGastosComunesDTO);

        if (respuesta)
        {
            cargarGastoComun();
            this.txtComentario.Text  = string.Empty;
            this.txtDescripcion.Text = string.Empty;
            this.txtMonto.Text       = string.Empty;
            this.ddlEstado.ClearSelection();
            ddlCondominio.ClearSelection();
            ddlCasa.ClearSelection();

            if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
            {
                string script = "alert('Gasto Común editado correctamente.');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            }
        }
        else
        {
        }
    }
Ejemplo n.º 19
0
    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
        {
        }
    }
Ejemplo n.º 20
0
    protected void btnEditar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        btnEditar.Visible = false;
        btnGrabar.Visible = true;

        NoticiaDTO theNoticiaDTO = new NoticiaDTO();

        theNoticiaDTO.NoticiaId   = decimal.Parse(this.hdnNoticiaId.Value);
        theNoticiaDTO.NotiTitulo  = this.txtNoticiaTitulo.Text.ToUpper();
        theNoticiaDTO.NotiResumen = this.txtNoticiaResumen.Text.ToUpper();
        theNoticiaDTO.NotiDetalle = this.FCKeditorDetalle.Value;
        theNoticiaDTO.NotiAutor   = this.TxtNotiAutor.Text.ToUpper();

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio   = decimal.Parse(ddlCondominio.SelectedValue);
        theNoticiaDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad    = decimal.Parse(ddlComunidad.SelectedValue);
        theNoticiaDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO();
        myCategoriaDTO.IdCategoria    = decimal.Parse(ddlCategoria.SelectedValue);
        theNoticiaDTO.TheCategoriaDTO = myCategoriaDTO;

        theNoticiaDTO.UsuarioModificacion = myUsuario.Rut;

        if (this.FileImagenNoticia.HasFile)
        {
            theNoticiaDTO.NotiImagen = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenNoticia, YouCom.Service.Generales.General.GetPropiedad("UploadsPathBann"), 198, 118, Page);
        }
        else
        {
            YouCom.DTO.NoticiaDTO myNoticiaDTO = new YouCom.DTO.NoticiaDTO();
            myNoticiaDTO = YouCom.bll.NoticiaBLL.detalleNoticia(decimal.Parse(hdnNoticiaId.Value));

            theNoticiaDTO.NotiImagen = myNoticiaDTO.NotiImagen;
        }


        theNoticiaDTO.NotiPublicacion = DateTime.ParseExact(this.FechaPublicacion.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theNoticiaDTO.NotiInicio      = DateTime.ParseExact(this.FechaPublicacion.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

        theNoticiaDTO.NotiExpira = string.Copy(RdbNotiExpira.SelectedItem.Value);

        if (RdbNotiExpira.SelectedValue.Equals("S"))
        {
            theNoticiaDTO.NotiExpiracion = DateTime.ParseExact(this.FechaExpiracion.Text + " 00:00", "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        }
        else
        {
            theNoticiaDTO.NotiExpiracion = DateTime.MaxValue;
        }

        bool respuesta = YouCom.bll.NoticiaBLL.Update(theNoticiaDTO);

        if (respuesta)
        {
            cargarNoticia();
            this.TxtNotiAutor.Text      = string.Empty;
            this.txtNoticiaTitulo.Text  = string.Empty;
            this.txtNoticiaResumen.Text = string.Empty;

            if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
            {
                string script = "alert('Noticia editada correctamente.');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            }
        }
        else
        {
        }
    }
Ejemplo n.º 21
0
    protected void btnEditar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        btnEditar.Visible = false;
        btnGrabar.Visible = true;

        ComercioDTO theComercioDTO = new ComercioDTO();

        theComercioDTO.IdComercio        = decimal.Parse(this.hdnIdComercio.Value);
        theComercioDTO.NombreComercio    = this.txtComercioNombre.Text.ToUpper();
        theComercioDTO.DireccionComercio = this.txtComercioDireccion.Text.ToUpper();
        theComercioDTO.TelefonoComercio  = this.txtComercioTelefono.Text;
        theComercioDTO.UrlComercio       = this.txtComercioURL.Text.ToUpper();
        theComercioDTO.EmailComercio     = this.txtEmail.Text;

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio    = decimal.Parse(ddlCondominio.SelectedValue);
        theComercioDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad     = decimal.Parse(ddlComunidad.SelectedValue);
        theComercioDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO();
        myCategoriaDTO.IdCategoria     = decimal.Parse(ddlCategoria.SelectedValue);
        theComercioDTO.TheCategoriaDTO = myCategoriaDTO;

        theComercioDTO.UsuarioModificacion = myUsuario.Rut;

        if (this.FileImagenComercio.HasFile)
        {
            theComercioDTO.LogoComercio = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenComercio, YouCom.Service.Generales.General.GetPropiedad("UploadsPathComercioPub"), 198, 118, Page);
        }
        else
        {
            YouCom.DTO.ComercioDTO myComercioDTO = new YouCom.DTO.ComercioDTO();
            myComercioDTO = YouCom.bll.ComercioBLL.detalleComercio(decimal.Parse(hdnIdComercio.Value));

            theComercioDTO.LogoComercio = myComercioDTO.LogoComercio;
        }


        bool respuesta = YouCom.bll.ComercioBLL.Update(theComercioDTO);

        if (respuesta)
        {
            cargarComercio();
            this.txtComercioNombre.Text    = string.Empty;
            this.txtComercioDireccion.Text = string.Empty;
            this.txtComercioTelefono.Text  = string.Empty;
            this.txtComercioURL.Text       = string.Empty;

            if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
            {
                string script = "alert('Comercio editado 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;

        VotacionPropuestaDTO theVotacionPropuestaDTO = new VotacionPropuestaDTO();

        theVotacionPropuestaDTO.IdVotacionPropuesta           = decimal.Parse(this.hdnVotacionPropuestaId.Value);
        theVotacionPropuestaDTO.FechaInicioVotacionPropuesta  = DateTime.ParseExact(this.FechaIngreso.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theVotacionPropuestaDTO.FechaTerminoVotacionPropuesta = DateTime.ParseExact(this.FechaTermino.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio             = decimal.Parse(ddlCondominio.SelectedValue);
        theVotacionPropuestaDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad = decimal.Parse(ddlComunidad.SelectedValue);
        theVotacionPropuestaDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.Propuesta.VotacionPropuestaEstadoDTO myVotacionPropuestaEstadoDTO = new YouCom.DTO.Propuesta.VotacionPropuestaEstadoDTO();
        myVotacionPropuestaEstadoDTO.IdVotacionPropuestaEstado = decimal.Parse(this.ddlEstado.SelectedValue);
        theVotacionPropuestaDTO.TheVotacionPropuestaEstadoDTO  = myVotacionPropuestaEstadoDTO;

        YouCom.DTO.Propuesta.PropuestaDTO myPropuestaDTO = new YouCom.DTO.Propuesta.PropuestaDTO();
        myPropuestaDTO.IdPropuesta = decimal.Parse(this.HdnPropuestaId.Value);
        theVotacionPropuestaDTO.ThePropuestaDTO = myPropuestaDTO;

        theVotacionPropuestaDTO.MotivoEstado = txtMotivoEstado.Text;

        theVotacionPropuestaDTO.UsuarioModificacion = myUsuario.Rut;

        bool respuesta = YouCom.bll.VotacionPropuestaBLL.Update(theVotacionPropuestaDTO);

        if (respuesta)
        {
            if (ddlEstado.SelectedValue == "3")
            {
                YouCom.DTO.ProyectoDTO theProyectoDTO = new YouCom.DTO.ProyectoDTO();

                myPropuestaDTO = YouCom.bll.PropuestaBLL.detallePropuesta(myPropuestaDTO.IdPropuesta);

                theProyectoDTO.ThePropuestaDTO = myPropuestaDTO;

                theProyectoDTO.NombreProyecto       = myPropuestaDTO.NombrePropuesta;
                theProyectoDTO.DescripcionProyecto  = myPropuestaDTO.DescripcionPropuesta;
                theProyectoDTO.FechaInicioProyecto  = DateTime.Now;
                theProyectoDTO.FechaTerminoProyecto = DateTime.Now.AddDays(90);
                theProyectoDTO.FechaEntregaProyecto = DateTime.Now.AddDays(120);
                theProyectoDTO.PresupuestoProyecto  = 0;
                theProyectoDTO.DireccionProyecto    = myPropuestaDTO.DireccionPropuesta;

                YouCom.DTO.EmpresaContratistaDTO myEmpresaContratistaDTO = new YouCom.DTO.EmpresaContratistaDTO();
                myEmpresaContratistaDTO.IdEmpresaContratista = 1;
                theProyectoDTO.TheEmpresaContratistaDTO      = myEmpresaContratistaDTO;

                YouCom.DTO.ProyectoEstadoDTO myProyectoEstadoDTO = new YouCom.DTO.ProyectoEstadoDTO();
                myProyectoEstadoDTO.IdProyectoEstado = 1;
                theProyectoDTO.TheProyectoEstadoDTO  = myProyectoEstadoDTO;

                myCondominioDTO.IdCondominio    = decimal.Parse(ddlCondominio.SelectedValue);
                theProyectoDTO.TheCondominioDTO = myCondominioDTO;

                myComunidadDTO.IdComunidad     = decimal.Parse(ddlComunidad.SelectedValue);
                theProyectoDTO.TheComunidadDTO = myComunidadDTO;

                theProyectoDTO.UsuarioIngreso = myUsuario.Rut;

                bool respuesta_votacion = YouCom.bll.ProyectoBLL.Insert(theProyectoDTO);

                if (respuesta_votacion)
                {
                    cargarVotacionPropuesta();
                    this.txtVotacionPropuestaNombre.Text      = string.Empty;
                    this.txtVotacionPropuestaDescripcion.Text = string.Empty;
                    this.FechaTermino.Text = string.Empty;
                    this.FechaIngreso.Text = string.Empty;

                    ddlCondominio.ClearSelection();
                    ddlComunidad.ClearSelection();
                    ddlFamilia.ClearSelection();

                    if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
                    {
                        string script = "alert('Se ha cambiado el estado de la Votacion Propuesta correctamente.');";
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    }
                }
            }
            else
            {
                cargarVotacionPropuesta();
                this.txtVotacionPropuestaNombre.Text      = string.Empty;
                this.txtVotacionPropuestaDescripcion.Text = string.Empty;
                this.FechaTermino.Text = string.Empty;
                this.FechaIngreso.Text = string.Empty;

                ddlCondominio.ClearSelection();
                ddlComunidad.ClearSelection();
                ddlFamilia.ClearSelection();

                if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
                {
                    string script = "alert('Votacion Propuesta editado correctamente.');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                }
            }
        }
        else
        {
        }
    }
Ejemplo n.º 23
0
    protected void btnGrabar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominioCasa1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");
        DropDownList ddlCasa       = (DropDownList)wucCondominio.FindControl("ddlCasa");

        IList <YouCom.DTO.GastosComunes.GastoComunDTO> gastoComun = new List <YouCom.DTO.GastosComunes.GastoComunDTO>();

        gastoComun = (Session["gastoComun"] as List <YouCom.DTO.GastosComunes.GastoComunDTO>);

        YouCom.DTO.GastosComunes.GastoComunDTO theGastosComunesDTO = new YouCom.DTO.GastosComunes.GastoComunDTO();
        theGastosComunesDTO.DescripcionGasto = this.txtDescripcion.Text.ToUpper();
        theGastosComunesDTO.MontoGasto       = decimal.Parse(this.txtMonto.Text);
        theGastosComunesDTO.FechaGasto       = DateTime.ParseExact(this.FechaGasto.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio         = decimal.Parse(ddlCondominio.SelectedValue);
        theGastosComunesDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad          = decimal.Parse(ddlComunidad.SelectedValue);
        theGastosComunesDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.Propietario.CasaDTO myCasa = new YouCom.DTO.Propietario.CasaDTO();
        myCasa.IdCasa = decimal.Parse(ddlCasa.SelectedValue);
        theGastosComunesDTO.TheCasaDTO = myCasa;

        YouCom.DTO.GastosComunes.GastoComunEstadoDTO myGastoComunEstadoDTO = new YouCom.DTO.GastosComunes.GastoComunEstadoDTO();
        myGastoComunEstadoDTO.IdGastoComunEstado   = decimal.Parse(this.ddlEstado.SelectedValue);
        theGastosComunesDTO.TheGastoComunEstadoDTO = myGastoComunEstadoDTO;

        theGastosComunesDTO.FechaPagoGasto = DateTime.MaxValue;
        theGastosComunesDTO.UsuarioIngreso = myUsuario.Rut;

        if (this.FileArchivo.HasFile)
        {
            theGastosComunesDTO.ArchivoGasto = this.ProcessOtherFile(FileArchivo, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathGastoComunPub"));
        }

        gastoComun = gastoComun.Where(x => x.DescripcionGasto == theGastosComunesDTO.DescripcionGasto).ToList();
        if (gastoComun.Any())
        {
            foreach (var item in gastoComun)
            {
                if (item.Estado == "2")
                {
                    string script = "alert('Gasto Común existe pero fue eliminado para activarlo dirigase a Papelera.');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
                else
                {
                    string script = "alert('Gasto Común ya Existe .');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
            }
        }

        bool respuesta = YouCom.bll.GastosComunes.GastoComunBLL.Insert(theGastosComunesDTO);

        if (respuesta)
        {
            this.txtComentario.Text  = string.Empty;
            this.txtDescripcion.Text = string.Empty;
            this.txtMonto.Text       = string.Empty;
            this.ddlEstado.ClearSelection();
            ddlCondominio.ClearSelection();
            ddlCasa.ClearSelection();

            string script = "alert('Gasto Común ingresado correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarGastoComun();
        }
        else
        {
        }
    }
Ejemplo n.º 24
0
    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
        {
        }
    }
Ejemplo n.º 25
0
    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
        {
        }
    }
Ejemplo n.º 26
0
    protected void btnGrabar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        List <ComercioDTO> comercios = new List <ComercioDTO>();

        comercios = (Session["comercio"] as List <ComercioDTO>);

        ComercioDTO theComercioDTO = new ComercioDTO();

        theComercioDTO.NombreComercio    = this.txtComercioNombre.Text.ToUpper();
        theComercioDTO.DireccionComercio = this.txtComercioDireccion.Text.ToUpper();
        theComercioDTO.TelefonoComercio  = this.txtComercioTelefono.Text;
        theComercioDTO.UrlComercio       = this.txtComercioURL.Text.ToUpper();
        theComercioDTO.EmailComercio     = this.txtEmail.Text;

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio    = decimal.Parse(ddlCondominio.SelectedValue);
        theComercioDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad     = decimal.Parse(ddlComunidad.SelectedValue);
        theComercioDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO();
        myCategoriaDTO.IdCategoria     = decimal.Parse(ddlCategoria.SelectedValue);
        theComercioDTO.TheCategoriaDTO = myCategoriaDTO;

        theComercioDTO.UsuarioIngreso = myUsuario.Rut;

        if (this.FileImagenComercio.HasFile)
        {
            if (System.IO.Path.GetExtension(FileImagenComercio.PostedFile.FileName) == ".swf")
            {
                theComercioDTO.LogoComercio = this.ProcessOtherFile(FileImagenComercio, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathComercioPub"));
            }
            else
            {
                theComercioDTO.LogoComercio = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenComercio, YouCom.Service.Generales.General.GetPropiedad("UploadsPathComercioPub"), 198, 118, Page);
            }
        }

        comercios = comercios.Where(x => x.NombreComercio == theComercioDTO.NombreComercio).ToList();
        if (comercios.Any())
        {
            foreach (var item in comercios)
            {
                if (item.Estado == "2")
                {
                    string script = "alert('Comercio existe pero fue eliminado para activarlo dirigase a Papelera.');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
                else
                {
                    string script = "alert('Comercio ya Existe .');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
            }
        }

        bool respuesta = YouCom.bll.ComercioBLL.Insert(theComercioDTO);

        if (respuesta)
        {
            this.txtComercioNombre.Text    = string.Empty;
            this.txtComercioDireccion.Text = string.Empty;
            this.txtComercioTelefono.Text  = string.Empty;
            this.txtComercioURL.Text       = string.Empty;

            string script = "alert('Comercio ingresado correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarComercio();
        }
        else
        {
        }
    }
Ejemplo n.º 27
0
    protected void btnGrabar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        List <NoticiaDTO> noticias = new List <NoticiaDTO>();

        noticias = (Session["noticia"] as List <NoticiaDTO>);

        NoticiaDTO theNoticiaDTO = new NoticiaDTO();

        theNoticiaDTO.NotiTitulo  = this.txtNoticiaTitulo.Text.ToUpper();
        theNoticiaDTO.NotiResumen = this.txtNoticiaResumen.Text.ToUpper();
        theNoticiaDTO.NotiDetalle = this.FCKeditorDetalle.Value;
        theNoticiaDTO.NotiAutor   = this.TxtNotiAutor.Text.ToUpper();

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio   = decimal.Parse(ddlCondominio.SelectedValue);
        theNoticiaDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad    = decimal.Parse(ddlComunidad.SelectedValue);
        theNoticiaDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO();
        myCategoriaDTO.IdCategoria    = decimal.Parse(ddlCategoria.SelectedValue);
        theNoticiaDTO.TheCategoriaDTO = myCategoriaDTO;

        theNoticiaDTO.UsuarioIngreso = myUsuario.Rut;

        if (this.FileImagenNoticia.HasFile)
        {
            if (System.IO.Path.GetExtension(FileImagenNoticia.PostedFile.FileName) == ".swf")
            {
                theNoticiaDTO.NotiImagen = this.ProcessOtherFile(FileImagenNoticia, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathNoticiaPub"));
            }
            else
            {
                theNoticiaDTO.NotiImagen = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenNoticia, YouCom.Service.Generales.General.GetPropiedad("UploadsPathNoticiaPub"), 198, 118, Page);
            }
        }

        theNoticiaDTO.NotiPublicacion = DateTime.ParseExact(this.FechaPublicacion.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theNoticiaDTO.NotiInicio      = DateTime.ParseExact(this.FechaPublicacion.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

        theNoticiaDTO.NotiExpira = string.Copy(RdbNotiExpira.SelectedItem.Value);

        if (RdbNotiExpira.SelectedValue.Equals("S"))
        {
            theNoticiaDTO.NotiExpiracion = DateTime.ParseExact(this.FechaExpiracion.Text + " 00:00", "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        }
        else
        {
            theNoticiaDTO.NotiExpiracion = DateTime.MaxValue;
        }

        noticias = noticias.Where(x => x.NotiTitulo == theNoticiaDTO.NotiTitulo).ToList();
        if (noticias.Any())
        {
            foreach (var item in noticias)
            {
                if (item.Estado == "2")
                {
                    string script = "alert('Noticia existe pero fue eliminado para activarlo dirigase a Papelera.');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
                else
                {
                    string script = "alert('Noticia ya Existe .');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
            }
        }

        bool respuesta = YouCom.bll.NoticiaBLL.Insert(theNoticiaDTO);

        if (respuesta)
        {
            this.TxtNotiAutor.Text      = string.Empty;
            this.txtNoticiaTitulo.Text  = string.Empty;
            this.txtNoticiaResumen.Text = string.Empty;
            string script = "alert('Noticia ingresada correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarNoticia();
        }
        else
        {
        }
    }
    protected void btnGrabar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        List <EmpresaServicioDTO> empresa_servicio = new List <EmpresaServicioDTO>();

        empresa_servicio = (Session["empresa_servicio"] as List <EmpresaServicioDTO>);

        EmpresaServicioDTO theEmpresaServicioDTO = new EmpresaServicioDTO();

        theEmpresaServicioDTO.RazonSocialEmpresaServicio = this.txtRazonSocialEmpresaServicio.Text.ToUpper();
        theEmpresaServicioDTO.RutEmpresaServicio         = this.txtRutEmpresaServicio.Text.ToUpper();
        theEmpresaServicioDTO.DireccionEmpresaServicio   = this.txtEmpresaServicioDireccion.Text.ToUpper();
        theEmpresaServicioDTO.TelefonoEmpresaServicio    = this.txtEmpresaServicioTelefono.Text;
        theEmpresaServicioDTO.CelularEmpresaServicio     = this.txtEmpresaServicioTelefono.Text;
        theEmpresaServicioDTO.UrlEmpresaServicio         = this.txtEmpresaServicioURL.Text.ToUpper();
        theEmpresaServicioDTO.EmailEmpresaServicio       = this.txtEmail.Text;

        YouCom.DTO.Servicio.ServiciosDTO myServiciosDTO = new YouCom.DTO.Servicio.ServiciosDTO();
        myServiciosDTO.IdServicio             = decimal.Parse(ddlServicio.SelectedValue);
        theEmpresaServicioDTO.TheServiciosDTO = myServiciosDTO;

        YouCom.DTO.GiroDTO myGiroDTO = new YouCom.DTO.GiroDTO();
        myGiroDTO.IdGiro = decimal.Parse(ddlGiro.SelectedValue);
        theEmpresaServicioDTO.TheGiroDTO = myGiroDTO;

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio           = decimal.Parse(ddlCondominio.SelectedValue);
        theEmpresaServicioDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad            = decimal.Parse(ddlComunidad.SelectedValue);
        theEmpresaServicioDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.ComunaDTO myComunaDTO = new YouCom.DTO.ComunaDTO();
        myComunaDTO.IdComuna = decimal.Parse(ddlComuna.SelectedValue);
        theEmpresaServicioDTO.TheComunaDTO = myComunaDTO;

        YouCom.DTO.CiudadDTO myCiudadDTO = new YouCom.DTO.CiudadDTO();
        myCiudadDTO.IdCiudad = decimal.Parse(ddlCiudad.SelectedValue);
        theEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO = myCiudadDTO;

        YouCom.DTO.RegionDTO myRegionDTO = new YouCom.DTO.RegionDTO();
        myRegionDTO.IdRegion = decimal.Parse(ddlRegion.SelectedValue);
        theEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO.TheRegionDTO = myRegionDTO;

        YouCom.DTO.PaisDTO myPaisDTO = new YouCom.DTO.PaisDTO();
        myPaisDTO.IdPais = decimal.Parse(ddlPais.SelectedValue);
        theEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO.TheRegionDTO.ThePaisDTO = myPaisDTO;

        theEmpresaServicioDTO.UsuarioIngreso = myUsuario.Rut;

        if (this.FileImagenEmpresaServicio.HasFile)
        {
            if (System.IO.Path.GetExtension(FileImagenEmpresaServicio.PostedFile.FileName) == ".swf")
            {
                theEmpresaServicioDTO.LogoEmpresaServicio = this.ProcessOtherFile(FileImagenEmpresaServicio, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathEmpresaServicioPub"));
            }
            else
            {
                theEmpresaServicioDTO.LogoEmpresaServicio = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenEmpresaServicio, YouCom.Service.Generales.General.GetPropiedad("UploadsPathEmpresaServicioPub"), 198, 118, Page);
            }
        }

        empresa_servicio = empresa_servicio.Where(x => x.RazonSocialEmpresaServicio == theEmpresaServicioDTO.RazonSocialEmpresaServicio).ToList();
        if (empresa_servicio.Any())
        {
            foreach (var item in empresa_servicio)
            {
                if (item.Estado == "2")
                {
                    string script = "alert('Empresa Servicio existe pero fue eliminado para activarlo dirigase a Papelera.');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
                else
                {
                    string script = "alert('Empresa Servicio ya Existe .');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    return;
                }
            }
        }

        bool respuesta = YouCom.bll.EmpresaServicioBLL.Insert(theEmpresaServicioDTO);

        if (respuesta)
        {
            this.txtRutEmpresaServicio.Text         = string.Empty;
            this.txtRazonSocialEmpresaServicio.Text = string.Empty;
            this.txtEmpresaServicioDireccion.Text   = string.Empty;
            this.txtEmpresaServicioTelefono.Text    = string.Empty;
            this.txtEmpresaServicioCelular.Text     = string.Empty;
            this.txtEmpresaServicioURL.Text         = string.Empty;
            this.txtEmail.Text = string.Empty;

            string script = "alert('Empresa Servicio ingresado correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarEmpresaServicio();
        }
        else
        {
        }
    }
    protected void btnEditar_Click(object sender, EventArgs e)
    {
        UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl("wucCondominio1");
        DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
        DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

        btnEditar.Visible = false;
        btnGrabar.Visible = true;

        EmpresaServicioDTO theEmpresaServicioDTO = new EmpresaServicioDTO();

        theEmpresaServicioDTO.IdEmpresaServicio          = decimal.Parse(this.hdnIdEmpresaServicio.Value);
        theEmpresaServicioDTO.RazonSocialEmpresaServicio = this.txtRazonSocialEmpresaServicio.Text.ToUpper();
        theEmpresaServicioDTO.RutEmpresaServicio         = this.txtRutEmpresaServicio.Text.ToUpper();
        theEmpresaServicioDTO.DireccionEmpresaServicio   = this.txtEmpresaServicioDireccion.Text.ToUpper();
        theEmpresaServicioDTO.TelefonoEmpresaServicio    = this.txtEmpresaServicioTelefono.Text;
        theEmpresaServicioDTO.CelularEmpresaServicio     = this.txtEmpresaServicioCelular.Text;
        theEmpresaServicioDTO.UrlEmpresaServicio         = this.txtEmpresaServicioURL.Text.ToUpper();
        theEmpresaServicioDTO.EmailEmpresaServicio       = this.txtEmail.Text;

        YouCom.DTO.Servicio.ServiciosDTO myServiciosDTO = new YouCom.DTO.Servicio.ServiciosDTO();
        myServiciosDTO.IdServicio             = decimal.Parse(ddlServicio.SelectedValue);
        theEmpresaServicioDTO.TheServiciosDTO = myServiciosDTO;

        YouCom.DTO.GiroDTO myGiroDTO = new YouCom.DTO.GiroDTO();
        myGiroDTO.IdGiro = decimal.Parse(ddlGiro.SelectedValue);
        theEmpresaServicioDTO.TheGiroDTO = myGiroDTO;

        YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
        myCondominioDTO.IdCondominio           = decimal.Parse(ddlCondominio.SelectedValue);
        theEmpresaServicioDTO.TheCondominioDTO = myCondominioDTO;

        YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
        myComunidadDTO.IdComunidad            = decimal.Parse(ddlComunidad.SelectedValue);
        theEmpresaServicioDTO.TheComunidadDTO = myComunidadDTO;

        YouCom.DTO.ComunaDTO myComunaDTO = new YouCom.DTO.ComunaDTO();
        myComunaDTO.IdComuna = decimal.Parse(ddlComuna.SelectedValue);
        theEmpresaServicioDTO.TheComunaDTO = myComunaDTO;

        YouCom.DTO.CiudadDTO myCiudadDTO = new YouCom.DTO.CiudadDTO();
        myCiudadDTO.IdCiudad = decimal.Parse(ddlCiudad.SelectedValue);
        theEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO = myCiudadDTO;

        YouCom.DTO.RegionDTO myRegionDTO = new YouCom.DTO.RegionDTO();
        myRegionDTO.IdRegion = decimal.Parse(ddlRegion.SelectedValue);
        theEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO.TheRegionDTO = myRegionDTO;

        YouCom.DTO.PaisDTO myPaisDTO = new YouCom.DTO.PaisDTO();
        myPaisDTO.IdPais = decimal.Parse(ddlPais.SelectedValue);
        theEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO.TheRegionDTO.ThePaisDTO = myPaisDTO;

        theEmpresaServicioDTO.UsuarioModificacion = myUsuario.Rut;

        if (this.FileImagenEmpresaServicio.HasFile)
        {
            theEmpresaServicioDTO.LogoEmpresaServicio = YouCom.Service.Imagenes.Imagen.ProcessFileResize(FileImagenEmpresaServicio, YouCom.Service.Generales.General.GetPropiedad("UploadsPathEmpresaServicioPub"), 198, 118, Page);
        }
        else
        {
            EmpresaServicioDTO myEmpresaServicioDTO = new EmpresaServicioDTO();
            myEmpresaServicioDTO = YouCom.bll.EmpresaServicioBLL.detalleEmpresaServicio(decimal.Parse(hdnIdEmpresaServicio.Value));

            theEmpresaServicioDTO.LogoEmpresaServicio = myEmpresaServicioDTO.LogoEmpresaServicio;
        }


        bool respuesta = YouCom.bll.EmpresaServicioBLL.Update(theEmpresaServicioDTO);

        if (respuesta)
        {
            cargarEmpresaServicio();
            this.txtRutEmpresaServicio.Text         = string.Empty;
            this.txtRazonSocialEmpresaServicio.Text = string.Empty;
            this.txtEmpresaServicioDireccion.Text   = string.Empty;
            this.txtEmpresaServicioTelefono.Text    = string.Empty;
            this.txtEmpresaServicioCelular.Text     = string.Empty;
            this.txtEmpresaServicioURL.Text         = string.Empty;
            this.txtEmail.Text = string.Empty;

            if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
            {
                string script = "alert('Empresa Servicio editado correctamente.');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            }
        }
        else
        {
        }
    }
Ejemplo n.º 30
0
        protected void BtnCrear_Click(object sender, EventArgs e)
        {
            bool         respuesta     = false;
            UserControl  wucCondominio = (UserControl)Page.Master.FindControl("ContentPlaceHolder1").FindControl(YouCom.Service.Configuracion.Config.getPageName(false) + "1").FindControl("wucCondominio1");
            DropDownList ddlCondominio = (DropDownList)wucCondominio.FindControl("ddlCondominio");
            DropDownList ddlComunidad  = (DropDownList)wucCondominio.FindControl("ddlComunidad");

            List <OperadorDTO> usuarios = new List <OperadorDTO>();

            usuarios = (Session["usuarios"] as List <OperadorDTO>);

            usuarios = usuarios.Where(x => x.Rut == YouCom.Service.Formato.Formato.limpiarRut(this.txtRut.Text)).ToList();
            if (usuarios.Any())
            {
                if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
                {
                    string script = "alert('Usuario ya Existe');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                }
            }
            else
            {
                OperadorDTO theUsuarioDTO = new OperadorDTO();
                theUsuarioDTO.Usuario         = YouCom.Service.Formato.Formato.limpiarRut(this.txtRut.Text);
                theUsuarioDTO.Rut             = YouCom.Service.Formato.Formato.limpiarRut(this.txtRut.Text);
                theUsuarioDTO.Password        = this.txtpasswordInicial.Text;
                theUsuarioDTO.Nombres         = this.txtNombre.Text;
                theUsuarioDTO.Paterno         = this.txtPaterno.Text;
                theUsuarioDTO.Materno         = this.txtMaterno.Text;
                theUsuarioDTO.Mail            = this.txtMail.Text;
                theUsuarioDTO.FechaNacimiento = Convert.ToDateTime(this.TxtFechaNacimiento.Text);
                theUsuarioDTO.Password        = txtpasswordInicial.Text;
                theUsuarioDTO.UsuarioIngreso  = myUsuario.Rut;

                YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
                myCondominioDTO.IdCondominio   = decimal.Parse(ddlCondominio.SelectedValue);
                theUsuarioDTO.TheCondominioDTO = myCondominioDTO;

                YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
                myComunidadDTO.IdComunidad    = decimal.Parse(ddlComunidad.SelectedValue);
                theUsuarioDTO.TheComunidadDTO = myComunidadDTO;

                YouCom.DTO.Seguridad.PerfilDTO myPerfilDTO = new YouCom.DTO.Seguridad.PerfilDTO();
                myPerfilDTO.IdPerfil       = decimal.Parse(ddlPerfil.SelectedValue);
                theUsuarioDTO.ThePerfilDTO = myPerfilDTO;

                respuesta = YouCom.Seguridad.BLL.UsuarioBLL.Insert(theUsuarioDTO);

                if (respuesta)
                {
                    if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
                    {
                        string script = "alert('Usuario Insertado Exitosamente.');";
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                    }
                    cargaUsuarios();
                    txtpasswordInicial.Text = string.Empty;
                }
                else
                {
                }
            }
        }