コード例 #1
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
        {
        }
    }
コード例 #2
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
        {
        }
    }
コード例 #3
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
        {
        }
    }
コード例 #4
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
        {
        }
    }
コード例 #5
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 <FamiliaDTO> familia = new List <FamiliaDTO>();

        familia = (Session["familia"] as List <FamiliaDTO>);

        FamiliaDTO theFamiliaDTO = new FamiliaDTO();

        theFamiliaDTO.RutFamilia             = this.txtRut.Text.ToUpper();
        theFamiliaDTO.NombreFamilia          = this.txtNombre.Text.ToUpper();
        theFamiliaDTO.ApellidoPaternoFamilia = this.txtApellidoPaterno.Text.ToUpper();
        theFamiliaDTO.ApellidoMaternoFamilia = this.txtApellidoMaterno.Text.ToUpper();
        theFamiliaDTO.TelefonoFamilia        = this.txtTelefono.Text;
        theFamiliaDTO.EmailFamilia           = this.txtEmail.Text;
        theFamiliaDTO.CelularFamilia         = this.txtCelular.Text;

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

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

        YouCom.DTO.Propietario.ParentescoDTO myParentescoDTO = new YouCom.DTO.Propietario.ParentescoDTO();
        myParentescoDTO.IdParentesco   = decimal.Parse(ddlParentesco.SelectedValue);
        theFamiliaDTO.TheParentescoDTO = myParentescoDTO;

        YouCom.DTO.Propietario.OcupacionDTO myOcupacionDTO = new YouCom.DTO.Propietario.OcupacionDTO();
        myOcupacionDTO.IdOcupacion    = decimal.Parse(ddlOcupacion.SelectedValue);
        theFamiliaDTO.TheOcupacionDTO = myOcupacionDTO;

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

        theFamiliaDTO.UsuarioIngreso = myUsuario.Rut;

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

        bool respuesta = YouCom.bll.FamiliaBLL.Insert(theFamiliaDTO);

        if (respuesta)
        {
            this.txtNombre.Text          = string.Empty;
            this.txtRut.Text             = string.Empty;
            this.txtApellidoPaterno.Text = string.Empty;
            this.txtApellidoMaterno.Text = string.Empty;
            this.txtTelefono.Text        = string.Empty;
            this.txtEmail.Text           = string.Empty;
            this.txtCelular.Text         = string.Empty;
            this.ddlCasa.ClearSelection();
            this.ddlOcupacion.ClearSelection();
            this.ddlParentesco.ClearSelection();

            string script = "alert('Familia Ingresada correctamente.');";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
            cargarFamilia();
        }
        else
        {
        }
    }