public ConjuntoHabitacional_ENT datosConjuntoHabitacional()
    {
        ConjuntoHabitacional_ENT oConjunto = new ConjuntoHabitacional_ENT();

        oConjunto.CodigoConjunto                = Convert.ToString(text_codigo_conjunto.Text);
        oConjunto.NombreConjunto                = Convert.ToString(text_nombre_conjunto.Text);
        oConjunto.Etapa                         = Convert.ToString(text_etapa.Text);
        oConjunto.IdComunaConjunto              = Convert.ToInt32(drop_id_comuna_conjunto.SelectedValue);
        oConjunto.DireccionConjunto             = Convert.ToString(text_direccion_conjunto.Text);
        oConjunto.RutConstructora               = Convert.ToString(text_rut_constructora.Text);
        oConjunto.NombreConstructora            = Convert.ToString(text_nombre_constructora.Text);
        oConjunto.RutEmpresaVendedora           = Convert.ToString(text_rut_empresa_vendedora.Text);
        oConjunto.NombreEmpresaVendedora        = Convert.ToString(text_nombre_empresa_vendedora.Text);
        oConjunto.RepresentanteEmpresaVendedora = Convert.ToString(text_nombre_representante.Text);
        oConjunto.IdComunaEmpresaVendedora      = Convert.ToInt32(drop_id_comuna_empresa_vendedora.SelectedValue);
        oConjunto.DireccionEmpresaVendedora     = Convert.ToString(text_direccion_empresa_vendedora.Text);
        oConjunto.AreaEmpresaVendedora          = Convert.ToString(text_area_empresa_vendedora.Text);
        oConjunto.TelefonoEmpresaVendedora      = Convert.ToString(text_telefono_empresa_vendedora.Text);
        oConjunto.EmailEmpresaVendedora         = Convert.ToString(text_email_empresa_vendedora.Text);
        //oConjunto.FechaContrato = text_fecha_contrato.Equals("") ? DateTime.Today : Convert.ToDateTime(text_fecha_contrato.Text); ;
        //oConjunto.FechaTerminoConstruccion = text_fecha_termino_construccion.Equals("") ? DateTime.Today : Convert.ToDateTime(text_fecha_termino_construccion.Text);
        //oConjunto.FechaRecepcionMunicipal = text_fecha_recepcion_municipal.Equals("") ? DateTime.Today : Convert.ToDateTime(text_fecha_recepcion_municipal.Text);
        //oConjunto.FechaRecepcionProhogar = text_fecha_recepcion_prohogar.Equals("") ? DateTime.Today : Convert.ToDateTime(text_fecha_recepcion_prohogar.Text);

        return(oConjunto);
    }
    private void cargarFormulario(ConjuntoHabitacional_ENT conjunto)
    {
        txtCodigoConjunto.Text              = conjunto.CodigoConjunto;
        txtNombreConjunto.Text              = conjunto.NombreConjunto;
        txtEtapa.Text                       = conjunto.Etapa;
        txtDireccionConjunto.Text           = conjunto.DireccionConjunto;
        txtRutConstructora.Text             = conjunto.RutConstructora;
        txtNombreConstructora.Text          = conjunto.NombreConstructora;
        txtRutVendedora.Text                = conjunto.RutEmpresaVendedora;
        txtNombreVendedora.Text             = conjunto.NombreEmpresaVendedora;
        txtNombreRepresentateVendedora.Text = conjunto.RepresentanteEmpresaVendedora;
        txtDireccionVendedora.Text          = conjunto.DireccionEmpresaVendedora;
        txtCodigoFonoVendedora.Text         = conjunto.AreaEmpresaVendedora;
        txtFonoVendedora.Text               = conjunto.TelefonoEmpresaVendedora;
        txtMailVendedora.Text               = conjunto.EmailEmpresaVendedora;
        txtFechaContrato.Text               = conjunto.FechaContrato.Year.Equals(1900)?"":conjunto.FechaContrato.ToShortDateString();
        txtFechaTermino.Text                = conjunto.FechaTerminoConstruccion.Year.Equals(1900)?"":conjunto.FechaTerminoConstruccion.ToShortDateString();
        txtFechaRecepcionMunicipal.Text     = conjunto.FechaRecepcionMunicipal.Year.Equals(1900)?"":conjunto.FechaRecepcionMunicipal.ToShortDateString();
        txtFechaRecepcionProHogar.Text      = conjunto.FechaRecepcionProhogar.Year.Equals(1900)?"":conjunto.FechaRecepcionProhogar.ToShortDateString();
        new Utilidad().cargarRegion(ddlRegionConjunto, conjunto.ComunaConjunto.Ciudad.Region.IdRegion.ToString());
        new Utilidad().cargarCiudad(ddlCiudadConjunto, conjunto.ComunaConjunto.Ciudad.Region.IdRegion.ToString(), conjunto.ComunaConjunto.Ciudad.IdCiudad.ToString());
        new Utilidad().cargarComuna(ddlComuna, conjunto.ComunaConjunto.Ciudad.IdCiudad.ToString(), conjunto.ComunaConjunto.IdComuna.ToString());

        new Utilidad().cargarRegion(ddlRegionVendedora, conjunto.ComunaVendedora.Ciudad.Region.IdRegion.ToString());
        new Utilidad().cargarCiudad(ddlCiudadVendedora, conjunto.ComunaVendedora.Ciudad.Region.IdRegion.ToString(), conjunto.ComunaVendedora.Ciudad.IdCiudad.ToString());
        new Utilidad().cargarComuna(ddlComunaVendedora, conjunto.ComunaVendedora.Ciudad.IdCiudad.ToString(), conjunto.ComunaVendedora.IdComuna.ToString());
    }
    public ConjuntoHabitacional_ENT datosConjuntoHabitacional()
    {
        ConjuntoHabitacional_ENT oConjunto = new ConjuntoHabitacional_ENT();

        oConjunto.CodigoConjunto                = "";
        oConjunto.NombreConjunto                = Convert.ToString(txtNombreConjunto.Text);
        oConjunto.Etapa                         = Convert.ToString(txtEtapa.Text);
        oConjunto.ComunaConjunto.IdComuna       = Convert.ToInt32(ddlComuna.SelectedValue);
        oConjunto.DireccionConjunto             = Convert.ToString(txtDireccionConjunto.Text);
        oConjunto.RutConstructora               = Convert.ToString(txtRutConstructora.Text);
        oConjunto.NombreConstructora            = Convert.ToString(txtNombreConstructora.Text);
        oConjunto.RutEmpresaVendedora           = Convert.ToString(txtRutVendedora.Text);
        oConjunto.NombreEmpresaVendedora        = Convert.ToString(txtNombreVendedora.Text);
        oConjunto.RepresentanteEmpresaVendedora = Convert.ToString(txtNombreRepresentateVendedora.Text);
        oConjunto.IdComunaEmpresaVendedora      = Convert.ToInt32(ddlComunaVendedora.SelectedValue);
        oConjunto.DireccionEmpresaVendedora     = Convert.ToString(txtDireccionVendedora.Text);
        oConjunto.AreaEmpresaVendedora          = Convert.ToString(txtCodigoFonoVendedora.Text);
        oConjunto.TelefonoEmpresaVendedora      = Convert.ToString(txtFonoVendedora.Text);
        oConjunto.EmailEmpresaVendedora         = Convert.ToString(txtMailVendedora.Text);
        oConjunto.FechaContrato                 = txtFechaContrato.Text.Equals("") ? new DateTime(1900, 1, 1) : Convert.ToDateTime(txtFechaContrato.Text);;
        oConjunto.FechaTerminoConstruccion      = txtFechaTermino.Text.Equals("") ? new DateTime(1900, 1, 1) : Convert.ToDateTime(txtFechaTermino.Text);
        oConjunto.FechaRecepcionMunicipal       = txtFechaRecepcionMunicipal.Text.Equals("") ? new DateTime(1900, 1, 1) : Convert.ToDateTime(txtFechaRecepcionMunicipal.Text);
        oConjunto.FechaRecepcionProhogar        = txtFechaRecepcionProHogar.Text.Equals("") ? new DateTime(1900, 1, 1) : Convert.ToDateTime(txtFechaRecepcionProHogar.Text);
        return(oConjunto);
    }
Beispiel #4
0
 public int getCount(ConjuntoHabitacional_ENT conjunto, int all)
 {
     try
     {
         using (SqlConnection sqlConn = new SqlConnection(this.ConexionPH))
         {
             sqlConn.Open();
             string     query = this.cargarQuery("ProHogar.ConjuntoHabitacional_DAO.getCountFiltro");
             SqlCommand cmd   = new SqlCommand(query, sqlConn)
             {
                 CommandType = CommandType.Text
             };
             cmd.Parameters.AddWithValue("@codigo_conjunto", all.Equals(1)?"%":conjunto.CodigoConjunto.Equals("") ? "" : conjunto.CodigoConjunto + "%");
             cmd.Parameters.AddWithValue("@nombre_conjunto", all.Equals(1) ? "%" : conjunto.NombreConjunto.Equals("") ? "" : conjunto.NombreConjunto + "%");
             cmd.Parameters.AddWithValue("@id_region", conjunto.IdComunaConjunto);
             SqlDataReader reader = cmd.ExecuteReader();
             if (reader.Read())
             {
                 return(reader["total"].Equals(DBNull.Value) ? 0 : Convert.ToInt32(reader["total"]));
             }
             else
             {
                 return(0);
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Error en ProHogar.ConjuntoHabitacional_DAO.getCountFiltro", ex);
     }
 }
Beispiel #5
0
        public List <ConjuntoHabitacional_ENT> getAllByPage(ConjuntoHabitacional_ENT conjunto, int desde, int hasta, int all)
        {
            try
            {
                using (SqlConnection sqlConn = new SqlConnection(this.ConexionPH))
                {
                    sqlConn.Open();
                    string     query = this.cargarQuery("ProHogar.ConjuntoHabitacional_DAO.getAllByPage");
                    SqlCommand cmd   = new SqlCommand(query, sqlConn)
                    {
                        CommandType = CommandType.Text
                    };
                    cmd.Parameters.AddWithValue("@codigo_conjunto", all.Equals(1) ? "%" : conjunto.CodigoConjunto.Equals("") ? "" : conjunto.CodigoConjunto + "%");
                    cmd.Parameters.AddWithValue("@nombre_conjunto", all.Equals(1) ? "%" : conjunto.NombreConjunto.Equals("") ? "" : conjunto.NombreConjunto + "%");
                    cmd.Parameters.AddWithValue("@id_region", conjunto.IdComunaConjunto);
                    cmd.Parameters.AddWithValue("@desde", desde);
                    cmd.Parameters.AddWithValue("@hasta", hasta);
                    List <ConjuntoHabitacional_ENT> listConjunto = new List <ConjuntoHabitacional_ENT>();
                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        ConjuntoHabitacional_ENT oConjunto = new ConjuntoHabitacional_ENT();

                        oConjunto.IdConjuntoHabitacional = Convert.ToInt32(reader["id_conjunto_habitacional"]);
                        oConjunto.CodigoConjunto         = reader["codigo_conjunto"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["codigo_conjunto"]);
                        oConjunto.NombreConjunto         = reader["nombre_conjunto"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["nombre_conjunto"]);
                        oConjunto.Etapa                         = reader["etapa"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["etapa"]);
                        oConjunto.IdComunaConjunto              = reader["id_comuna_conjunto"].Equals(DBNull.Value) ? 0 : Convert.ToInt32(reader["id_comuna_conjunto"]);
                        oConjunto.DireccionConjunto             = reader["direccion_conjunto"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["direccion_conjunto"]);
                        oConjunto.RutConstructora               = reader["rut_constructora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["rut_constructora"]);
                        oConjunto.NombreConstructora            = reader["nombre_constructora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["nombre_constructora"]);
                        oConjunto.RutEmpresaVendedora           = reader["rut_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["rut_empresa_vendedora"]);
                        oConjunto.NombreEmpresaVendedora        = reader["nombre_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["nombre_empresa_vendedora"]);
                        oConjunto.RepresentanteEmpresaVendedora = reader["representante_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["representante_empresa_vendedora"]);
                        oConjunto.IdComunaEmpresaVendedora      = reader["id_comuna_empresa_vendedora"].Equals(DBNull.Value) ? 0 : Convert.ToInt32(reader["id_comuna_empresa_vendedora"]);
                        oConjunto.DireccionEmpresaVendedora     = reader["direccion_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["direccion_empresa_vendedora"]);
                        oConjunto.AreaEmpresaVendedora          = reader["area_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["area_empresa_vendedora"]);
                        oConjunto.TelefonoEmpresaVendedora      = reader["telefono_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["telefono_empresa_vendedora"]);
                        oConjunto.EmailEmpresaVendedora         = reader["email_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["email_empresa_vendedora"]);
                        oConjunto.FechaContrato                 = reader["fecha_contrato"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_contrato"]);
                        oConjunto.FechaTerminoConstruccion      = reader["fecha_termino_construccion"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_termino_construccion"]);
                        oConjunto.FechaRecepcionMunicipal       = reader["fecha_recepcion_municipal"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_recepcion_municipal"]);
                        oConjunto.FechaRecepcionProhogar        = reader["fecha_recepcion_prohogar"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_recepcion_prohogar"]);

                        listConjunto.Add(oConjunto);
                    }
                    return(listConjunto);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en ProHogar.ConjuntoHabitacional_DAO.getAllByPage", ex);
            }
        }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ConjuntoHabitacional_ENT conjunto = (ConjuntoHabitacional_ENT)Session["conjuntoHabitacionalSeleccionado"];
         this.cargarSeguimientoPaginado(conjunto, 1);
     }
     else
     {
     }
 }
Beispiel #7
0
    protected void btnComentario_Click(object sender, EventArgs e)
    {
        ConjuntoHabitacional_ENT conjunto    = (ConjuntoHabitacional_ENT)Session["conjuntoHabitacionalSeleccionado"];
        Seguimiento_ENT          seguimiento = new Seguimiento_ENT();

        seguimiento.IdConjuntoHabitacional = conjunto.IdConjuntoHabitacional;
        seguimiento.Mensaje   = txtComentario.InnerText;
        seguimiento.IdUsuario = 1;
        seguimiento.Fecha     = DateTime.Now;
        seguimiento           = new Seguimiento_BSS().save(seguimiento);
        this.cargarSeguimientoPaginado(conjunto, 1);
    }
Beispiel #8
0
    private void cargarSeguimientoPaginado(ConjuntoHabitacional_ENT conjunto, int pagina)
    {
        txtCodigoConjunto.Text = conjunto.CodigoConjunto;
        txtNombreConjunto.Text = conjunto.NombreConjunto;
        txtEtapa.Text          = conjunto.Etapa;
        Seguimiento_BSS seguimiento = new Seguimiento_BSS();

        seguimiento.Pagina = pagina;
        seguimiento.IdConjuntoHabitacional = conjunto.IdConjuntoHabitacional;
        seguimiento.CantidadRegistros      = Convert.ToInt32(new Utilidad().traerParametro("cantRegistros"));
        seguimiento.generarResultado();
        this.cargarSeguimiento(seguimiento.Elementos);
    }
    protected void btn_grabar_Click(object sender, EventArgs e)
    {
        ConjuntoHabitacional_ENT oConjunto = new ConjuntoHabitacional_ENT();
        bool flag = this.validarIngreso();

        if (flag == true)
        {
            oConjunto = this.datosConjuntoHabitacional();
            oConjunto = new ConjuntoHabitacional_BSS().insertConjuntoHabitacional(oConjunto);
            Session["sessionConjuntoHabitacional"] = oConjunto;
            Response.Redirect("~/views/conjuntoHabitacionalPestanas.aspx");
        }
    }
Beispiel #10
0
        public ConjuntoHabitacional_ENT getByCodigo(string codigo)
        {
            try
            {
                using (SqlConnection sqlConn = new SqlConnection(this.ConexionPH))
                {
                    sqlConn.Open();
                    string     query = this.cargarQuery("ProHogar.ConjuntoHabitacional_DAO.getByCodigo");
                    SqlCommand cmd   = new SqlCommand(query, sqlConn)
                    {
                        CommandType = CommandType.Text
                    };
                    cmd.Parameters.AddWithValue("@codigo_conjunto", codigo);
                    SqlDataReader            reader    = cmd.ExecuteReader();
                    ConjuntoHabitacional_ENT oConjunto = new ConjuntoHabitacional_ENT();
                    if (reader.Read())
                    {
                        oConjunto.IdConjuntoHabitacional = Convert.ToInt32(reader["id_conjunto_habitacional"]);
                        oConjunto.CodigoConjunto         = reader["codigo_conjunto"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["codigo_conjunto"]);
                        oConjunto.NombreConjunto         = reader["nombre_conjunto"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["nombre_conjunto"]);
                        oConjunto.Etapa                         = reader["etapa"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["etapa"]);
                        oConjunto.IdComunaConjunto              = reader["id_comuna_conjunto"].Equals(DBNull.Value) ? 0 : Convert.ToInt32(reader["id_comuna_conjunto"]);
                        oConjunto.DireccionConjunto             = reader["direccion_conjunto"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["direccion_conjunto"]);
                        oConjunto.RutConstructora               = reader["rut_constructora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["rut_constructora"]);
                        oConjunto.NombreConstructora            = reader["nombre_constructora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["nombre_constructora"]);
                        oConjunto.RutEmpresaVendedora           = reader["rut_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["rut_empresa_vendedora"]);
                        oConjunto.NombreEmpresaVendedora        = reader["nombre_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["nombre_empresa_vendedora"]);
                        oConjunto.RepresentanteEmpresaVendedora = reader["representante_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["representante_empresa_vendedora"]);
                        oConjunto.IdComunaEmpresaVendedora      = reader["id_comuna_empresa_vendedora"].Equals(DBNull.Value) ? 0 : Convert.ToInt32(reader["id_comuna_empresa_vendedora"]);
                        oConjunto.DireccionEmpresaVendedora     = reader["direccion_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["direccion_empresa_vendedora"]);
                        oConjunto.AreaEmpresaVendedora          = reader["area_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["area_empresa_vendedora"]);
                        oConjunto.TelefonoEmpresaVendedora      = reader["telefono_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["telefono_empresa_vendedora"]);
                        oConjunto.EmailEmpresaVendedora         = reader["email_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["email_empresa_vendedora"]);
                        oConjunto.FechaContrato                 = reader["fecha_contrato"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_contrato"]);
                        oConjunto.FechaTerminoConstruccion      = reader["fecha_termino_construccion"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_termino_construccion"]);
                        oConjunto.FechaRecepcionMunicipal       = reader["fecha_recepcion_municipal"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_recepcion_municipal"]);
                        oConjunto.FechaRecepcionProhogar        = reader["fecha_recepcion_prohogar"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_recepcion_prohogar"]);

                        return(oConjunto);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en ProHogar.ConjuntoHabitacional_DAO.getByCodigo", ex);
            }
        }
        public ConjuntoHabitacional_ENT getConjuntoHabitacionalID(ConjuntoHabitacional_ENT datosConjuntoHabitacional)
        {
            ConjuntoHabitacional_ENT oConjunto = new ConjuntoHabitacional_DAO().getForIdConjuntoHabitacional(datosConjuntoHabitacional);

            oConjunto.ComunaConjunto = new Comuna_BSS().getComunaID(new Comuna_ENT()
            {
                IdComuna = oConjunto.IdComunaConjunto
            });
            oConjunto.ComunaConjunto.Ciudad = new Ciudad_BSS().getById(new Ciudad_ENT()
            {
                IdCiudad = oConjunto.ComunaConjunto.IdCiudad
            });
            oConjunto.ComunaConjunto.Ciudad.Region = new Region_BSS().getById(new Region_ENT()
            {
                IdRegion = oConjunto.ComunaConjunto.Ciudad.IdRegion
            });

            oConjunto.ComunaVendedora = new Comuna_BSS().getComunaID(new Comuna_ENT()
            {
                IdComuna = oConjunto.IdComunaEmpresaVendedora
            });
            if (oConjunto.ComunaVendedora != null)
            {
                oConjunto.ComunaVendedora.Ciudad = new Ciudad_BSS().getById(new Ciudad_ENT()
                {
                    IdCiudad = oConjunto.ComunaVendedora.IdCiudad
                });
                if (oConjunto.ComunaVendedora.Ciudad != null)
                {
                    oConjunto.ComunaVendedora.Ciudad.Region = new Region_BSS().getById(new Region_ENT()
                    {
                        IdRegion = oConjunto.ComunaVendedora.Ciudad.IdRegion
                    });
                    if (oConjunto.ComunaVendedora.Ciudad.Region == null)
                    {
                        oConjunto.ComunaVendedora.Ciudad.Region = new Region_ENT();
                    }
                }
                else
                {
                    oConjunto.ComunaVendedora.Ciudad = new Ciudad_ENT();
                }
            }
            else
            {
                oConjunto.ComunaVendedora = new Comuna_ENT();
            }

            return(oConjunto);
        }
Beispiel #12
0
        public ConjuntoHabitacional_ENT getForIdConjuntoHabitacional(ConjuntoHabitacional_ENT datosConjuntoHabitacional)
        {
            try
            {
                using (SqlConnection sqlConn = new SqlConnection(this.ConexionPH))
                {
                    sqlConn.Open();
                    SqlCommand cmd = new SqlCommand(this.ConexionPH, sqlConn);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.CommandText = "SP_GET_CONJUNTO_IDCONJUNTOHABITACIONAL";
                    cmd.Parameters.AddWithValue("@id_conjunto_habitacional", datosConjuntoHabitacional.IdConjuntoHabitacional);
                    SqlDataReader            reader    = cmd.ExecuteReader();
                    ConjuntoHabitacional_ENT oConjunto = new ConjuntoHabitacional_ENT();
                    if (reader.Read())
                    {
                        oConjunto.IdConjuntoHabitacional = Convert.ToInt32(reader["id_conjunto_habitacional"]);
                        oConjunto.CodigoConjunto         = reader["codigo_conjunto"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["codigo_conjunto"]);
                        oConjunto.NombreConjunto         = reader["nombre_conjunto"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["nombre_conjunto"]);
                        oConjunto.Etapa                         = reader["etapa"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["etapa"]);
                        oConjunto.IdComunaConjunto              = reader["id_comuna_conjunto"].Equals(DBNull.Value) ? 0 : Convert.ToInt32(reader["id_comuna_conjunto"]);
                        oConjunto.DireccionConjunto             = reader["direccion_conjunto"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["direccion_conjunto"]);
                        oConjunto.RutConstructora               = reader["rut_constructora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["rut_constructora"]);
                        oConjunto.NombreConstructora            = reader["nombre_constructora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["nombre_constructora"]);
                        oConjunto.RutEmpresaVendedora           = reader["rut_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["rut_empresa_vendedora"]);
                        oConjunto.NombreEmpresaVendedora        = reader["nombre_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["nombre_empresa_vendedora"]);
                        oConjunto.RepresentanteEmpresaVendedora = reader["representante_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["representante_empresa_vendedora"]);
                        oConjunto.IdComunaEmpresaVendedora      = reader["id_comuna_empresa_vendedora"].Equals(DBNull.Value) ? 0 : Convert.ToInt32(reader["id_comuna_empresa_vendedora"]);
                        oConjunto.DireccionEmpresaVendedora     = reader["direccion_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["direccion_empresa_vendedora"]);
                        oConjunto.AreaEmpresaVendedora          = reader["area_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["area_empresa_vendedora"]);
                        oConjunto.TelefonoEmpresaVendedora      = reader["telefono_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["telefono_empresa_vendedora"]);
                        oConjunto.EmailEmpresaVendedora         = reader["email_empresa_vendedora"].Equals(DBNull.Value) ? "" : Convert.ToString(reader["email_empresa_vendedora"]);
                        oConjunto.FechaContrato                 = reader["fecha_contrato"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_contrato"]);
                        oConjunto.FechaTerminoConstruccion      = reader["fecha_termino_construccion"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_termino_construccion"]);
                        oConjunto.FechaRecepcionMunicipal       = reader["fecha_recepcion_municipal"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_recepcion_municipal"]);
                        oConjunto.FechaRecepcionProhogar        = reader["fecha_recepcion_prohogar"].Equals(DBNull.Value) ? Convert.ToDateTime(null) : Convert.ToDateTime(reader["fecha_recepcion_prohogar"]);

                        return(oConjunto);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error al ejecutar SP_GET_CONJUNTO_IDCONJUNTOHABITACIONAL", ex);
            }
        }
    private Documento_ENT cargarDocumento()
    {
        ConjuntoHabitacional_ENT conjunto  = (ConjuntoHabitacional_ENT)Session["conjuntoHabitacionalSeleccionado"];
        Documento_ENT            documento = new Documento_ENT();

        documento.IdConjuntoHabitacional = conjunto.IdConjuntoHabitacional;
        documento.Nombre           = txtNombreDocumento.Text;
        documento.Folio            = txtFolioDocumento.Text;
        documento.FechaDocumento   = txtFechaDocumento.Text.Equals("") ? new DateTime(1900, 1, 1) : Convert.ToDateTime(txtFechaDocumento.Text);
        documento.FechaVencimiento = txtFechaVencimiento.Text.Equals("") ? new DateTime(1900, 1, 1) : Convert.ToDateTime(txtFechaVencimiento.Text);
        documento.FechaIngreso     = DateTime.Now;
        documento.Descripcion      = txtDescripcion.InnerText;
        documento.Estado           = true;
        return(documento);
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ConjuntoHabitacional_ENT conjunto = (ConjuntoHabitacional_ENT)Session["conjuntoHabitacionalSeleccionado"];
         this.cargarFormulario(conjunto);
     }
     else
     {
         ConjuntoHabitacional_ENT conjunto = (ConjuntoHabitacional_ENT)Session["conjuntoHabitacionalSeleccionado"];
         txtCodigoConjunto.Text = conjunto.CodigoConjunto;
         txtNombreConjunto.Text = conjunto.NombreConjunto;
         txtEtapa.Text          = conjunto.Etapa;
     }
 }
 protected void btnGrabar_Click(object sender, EventArgs e)
 {
     if (this.validar())
     {
         ConjuntoHabitacional_ENT conjunto        = this.datosConjuntoHabitacional();
         ConjuntoHabitacional_ENT conjuntoSession = (ConjuntoHabitacional_ENT)Session["conjuntoHabitacionalSeleccionado"];
         conjunto.IdConjuntoHabitacional = conjuntoSession.IdConjuntoHabitacional;
         conjunto.CodigoConjunto         = conjuntoSession.CodigoConjunto;
         conjunto.Etapa = conjuntoSession.Etapa;
         new ConjuntoHabitacional_BSS().update(conjunto);
         Session["conjuntoHabitacionalSeleccionado"] = conjunto;
         ClientScript.RegisterStartupScript(this.GetType(), "",
                                            JavaScript.alert("Conjunto Habitacional Actualizado exitósamente"));
         Response.Redirect("~/modulo/conjuntoHabitacional/Tabs/ConjuntoHabitacional.aspx");
     }
 }
Beispiel #16
0
        public int update(ConjuntoHabitacional_ENT datosConjuntoHabitacional)
        {
            try
            {
                using (SqlConnection sqlConn = new SqlConnection(this.ConexionPH))
                {
                    sqlConn.Open();
                    SqlCommand cmd = new SqlCommand(this.ConexionPH, sqlConn);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.CommandText = "SP_UPDATE_CONJUNTO_IDCONJUNTOHABITACIONAL";

                    cmd.Parameters.AddWithValue("@id_conjunto_habitacional", datosConjuntoHabitacional.IdConjuntoHabitacional);
                    cmd.Parameters.AddWithValue("@codigo_conjunto", datosConjuntoHabitacional.CodigoConjunto);
                    cmd.Parameters.AddWithValue("@nombre_conjunto", datosConjuntoHabitacional.NombreConjunto);
                    cmd.Parameters.AddWithValue("@etapa", datosConjuntoHabitacional.Etapa);
                    cmd.Parameters.AddWithValue("@id_comuna", datosConjuntoHabitacional.ComunaConjunto.IdComuna);
                    cmd.Parameters.AddWithValue("@direccion_conjunto", datosConjuntoHabitacional.DireccionConjunto);
                    cmd.Parameters.AddWithValue("@rut_constructora", datosConjuntoHabitacional.RutConstructora);
                    cmd.Parameters.AddWithValue("@nombre_constructora", datosConjuntoHabitacional.NombreConstructora);
                    cmd.Parameters.AddWithValue("@rut_empresa_vendedora", datosConjuntoHabitacional.RutEmpresaVendedora);
                    cmd.Parameters.AddWithValue("@nombre_empresa_vendedora", datosConjuntoHabitacional.NombreEmpresaVendedora);
                    cmd.Parameters.AddWithValue("@id_comuna_empresa_vendedora", datosConjuntoHabitacional.IdComunaEmpresaVendedora);
                    cmd.Parameters.AddWithValue("@direccion_empresa_vendedora", datosConjuntoHabitacional.DireccionEmpresaVendedora);
                    cmd.Parameters.AddWithValue("@area_empresa_vendedora", datosConjuntoHabitacional.AreaEmpresaVendedora);
                    cmd.Parameters.AddWithValue("@telefono_empresa_vendedora", datosConjuntoHabitacional.TelefonoEmpresaVendedora);
                    cmd.Parameters.AddWithValue("@email_empresa_vendedora", datosConjuntoHabitacional.EmailEmpresaVendedora);
                    cmd.Parameters.AddWithValue("@fecha_contrato", datosConjuntoHabitacional.FechaContrato);
                    cmd.Parameters.AddWithValue("@fecha_termino_construccion", datosConjuntoHabitacional.FechaTerminoConstruccion);
                    cmd.Parameters.AddWithValue("@fecha_recepcion_municipal", datosConjuntoHabitacional.FechaRecepcionMunicipal);
                    cmd.Parameters.AddWithValue("@fecha_recepcion_prohogar", datosConjuntoHabitacional.FechaRecepcionProhogar);

                    SqlDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        this.error = reader["error"].Equals(1) ? 1 : 0;
                    }
                    return(this.error);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error al ejecutar SP_UPDATE_CONJUNTO_IDCONJUNTOHABITACIONAL", ex);
            }
        }
Beispiel #17
0
 protected void btnGrabar_Click(object sender, EventArgs e)
 {
     if (this.validar())
     {
         ConjuntoHabitacional_ENT conjunto = this.datosConjuntoHabitacional();
         if (new ConjuntoHabitacional_BSS().getByCodigo(conjunto.CodigoConjunto) == null)
         {
             conjunto = new ConjuntoHabitacional_BSS().insertConjuntoHabitacional(conjunto);
             Session["conjuntoHabitacionalSeleccionado"] = conjunto;
             Response.Redirect("~/modulo/conjuntoHabitacional/Listado.aspx");
         }
         else
         {
             ClientScript.RegisterStartupScript(this.GetType(), "",
                                                JavaScript.alert("El código del conjunto habitacional ya se encuentra registrado"));
         }
     }
 }
    private void cargarFormulario(ConjuntoHabitacional_ENT conjunto, string idDocumento)
    {
        txtCodigoConjunto.Text = conjunto.CodigoConjunto;
        txtNombreConjunto.Text = conjunto.NombreConjunto;
        txtEtapa.Text          = conjunto.Etapa;
        Documento_ENT documento = new Documento_BSS().getDocumentoID(new Documento_ENT()
        {
            IdDocumento = Convert.ToInt32(idDocumento)
        });

        txtFolioDocumento.Text   = documento.Folio;
        txtNombreDocumento.Text  = documento.Nombre;
        txtDescripcion.InnerText = documento.Descripcion;
        txtFechaDocumento.Text   = documento.FechaDocumento.Year.Equals(1900) ? "" : documento.FechaDocumento.ToShortDateString();
        txtFechaVencimiento.Text = documento.FechaVencimiento.Year.Equals(1900) ? "" : documento.FechaVencimiento.ToShortDateString();
        divArchivo.InnerHtml     = "<button class='btn btn-mini btn-info' type='button' onclick=\"JAVASCRIPT:window.open('" + Page.ResolveClientUrl("~/modulo/conjuntoHabitacional/archivosCargados/") + documento.ArchivoNombre + "','_blank');\">Ver Archivo Actual</button>";
        hdId.Value = documento.IdDocumento.ToString();
    }
Beispiel #19
0
    private void cargarFormulario(ConjuntoHabitacional_ENT conjunto, List <Documento_ENT> documentos)
    {
        txtCodigoConjunto.Text = conjunto.CodigoConjunto;
        txtNombreConjunto.Text = conjunto.NombreConjunto;
        txtEtapa.Text          = conjunto.Etapa;
        int i = 1;

        foreach (Documento_ENT documento in documentos)
        {
            HtmlTableRow row = new HtmlTableRow();
            row.Cells.Add(new HtmlTableCell()
            {
                InnerHtml = i.ToString()
            });
            row.Cells.Add(new HtmlTableCell()
            {
                InnerHtml = documento.Folio.ToString()
            });
            row.Cells.Add(new HtmlTableCell()
            {
                InnerHtml = documento.Nombre
            });
            row.Cells.Add(new HtmlTableCell()
            {
                InnerHtml = documento.FechaDocumento.Year.Equals(1900)?"": documento.FechaDocumento.ToShortDateString()
            });
            row.Cells.Add(new HtmlTableCell()
            {
                InnerHtml = documento.FechaVencimiento.Year.Equals(1900)?"": documento.FechaVencimiento.ToShortDateString()
            });
            row.Cells.Add(new HtmlTableCell()
            {
                InnerHtml = "<button class='btn btn-mini btn-info' type='button' onclick=\"JAVASCRIPT:visualizarDoc('" + Page.ResolveClientUrl("~/modulo/conjuntoHabitacional/archivosCargados/") + documento.ArchivoNombre + "');\">Ver archivo</button> " +
                            "<button class='btn btn-mini btn-warning' type='button' onclick=\"JAVASCRIPT:modificarDoc(" + documento.IdDocumento + ",'" + new Utilidad().getMD5(documento.IdDocumento.ToString(), DateTime.Now.ToShortDateString()) + "');\">Modificar</button> " +
                            "<button class='btn btn-mini btn-danger' type='button' onclick=\"JaVASCRIPT:confirmarEliminarDoc('" + documento.Nombre + "'," + documento.IdDocumento + ",'" + new Utilidad().getMD5(documento.IdDocumento.ToString(), DateTime.Now.ToShortDateString()) + "');\">Eliminar</button>"
            });
            i++;
            tablaDocumentos.Rows.Add(row);
        }
    }
Beispiel #20
0
 public void cargarDatosConjunto(ConjuntoHabitacional_ENT oConjunto)
 {
     text_codigo_conjunto.Text                      = oConjunto.CodigoConjunto;
     text_nombre_conjunto.Text                      = oConjunto.NombreConjunto;
     text_etapa.Text                                = oConjunto.Etapa;
     drop_id_comuna_conjunto.SelectedValue          = Convert.ToString(oConjunto.IdComunaConjunto);
     text_direccion_conjunto.Text                   = oConjunto.DireccionConjunto;
     text_rut_constructora.Text                     = oConjunto.RutConstructora;
     text_nombre_constructora.Text                  = oConjunto.NombreConstructora;
     text_rut_empresa_vendedora.Text                = oConjunto.RutEmpresaVendedora;
     text_nombre_empresa_vendedora.Text             = oConjunto.NombreEmpresaVendedora;
     text_nombre_representante.Text                 = oConjunto.RepresentanteEmpresaVendedora;
     drop_id_comuna_empresa_vendedora.SelectedValue = Convert.ToString(oConjunto.IdComunaEmpresaVendedora);
     text_direccion_empresa_vendedora.Text          = oConjunto.DireccionEmpresaVendedora;
     text_area_empresa_vendedora.Text               = oConjunto.AreaEmpresaVendedora;
     text_telefono_empresa_vendedora.Text           = oConjunto.TelefonoEmpresaVendedora;
     text_email_empresa_vendedora.Text              = oConjunto.EmailEmpresaVendedora;
     text_fecha_contrato.Value                      = Convert.ToString(oConjunto.FechaContrato);
     text_fecha_termino_construccion.Value          = Convert.ToString(oConjunto.FechaTerminoConstruccion);
     text_fecha_recepcion_municipal.Value           = Convert.ToString(oConjunto.FechaRecepcionMunicipal);
     text_fecha_recepcion_prohogar.Value            = Convert.ToString(oConjunto.FechaRecepcionProhogar);
 }
Beispiel #21
0
    private void cargarConjuntosPaginados(string folio, string nombre,
                                          DateTime fechaDocumento, DateTime fechaVencimiento, int pagina)
    {
        ConjuntoHabitacional_ENT conjunto = (ConjuntoHabitacional_ENT)Session["conjuntoHabitacionalSeleccionado"];
        int all = 0;

        if (folio.Equals("") && nombre.Equals("") && fechaDocumento.Year.Equals(1900) &&
            fechaVencimiento.Year.Equals(1900))
        {
            all = 1;
        }
        Documento_BSS documento = new Documento_BSS();

        documento.IdConjuntoHabitacional = conjunto.IdConjuntoHabitacional;
        documento.Folio             = folio;
        documento.Nombre            = nombre;
        documento.FechaDocumento    = fechaDocumento;
        documento.FechaVencimiento  = fechaVencimiento;
        documento.CantidadRegistros = Convert.ToInt32(new Utilidad().traerParametro("cantRegistros"));
        documento.generarResultado(all);
        this.cargarFormulario(conjunto, documento.Elementos);
    }
        public List <ConjuntoHabitacional_ENT> listConjuntoHabitacional()
        {
            List <ConjuntoHabitacional_ENT> listConjunto    = new ConjuntoHabitacional_DAO().listConjuntoHabitacional();
            List <ConjuntoHabitacional_ENT> newListConjunto = new List <ConjuntoHabitacional_ENT>();

            foreach (ConjuntoHabitacional_ENT dato in listConjunto)
            {
                ConjuntoHabitacional_ENT oConjunto = new ConjuntoHabitacional_ENT();
                Comuna_ENT oComuna = new Comuna_ENT();

                oConjunto.IdConjuntoHabitacional = dato.IdConjuntoHabitacional;
                oConjunto.CodigoConjunto         = dato.CodigoConjunto;
                oConjunto.NombreConjunto         = dato.NombreConjunto;
                oConjunto.Etapa                         = dato.Etapa;
                oConjunto.DireccionConjunto             = dato.DireccionConjunto;
                oConjunto.RutConstructora               = dato.RutConstructora;
                oConjunto.NombreConjunto                = dato.NombreConjunto;
                oConjunto.RutEmpresaVendedora           = dato.RutEmpresaVendedora;
                oConjunto.NombreEmpresaVendedora        = dato.NombreEmpresaVendedora;
                oConjunto.RepresentanteEmpresaVendedora = dato.RepresentanteEmpresaVendedora;
                oComuna.IdComuna                        = dato.IdComunaConjunto;
                oConjunto.NombreComunaConjunto          = new Comuna_BSS().getComunaID(oComuna).Nombre;
                oConjunto.DireccionEmpresaVendedora     = dato.DireccionEmpresaVendedora;
                oConjunto.AreaEmpresaVendedora          = dato.AreaEmpresaVendedora;
                oConjunto.TelefonoEmpresaVendedora      = dato.TelefonoEmpresaVendedora;
                oConjunto.EmailEmpresaVendedora         = dato.EmailEmpresaVendedora;
                oConjunto.FechaContrato                 = dato.FechaContrato;
                oConjunto.FechaTerminoConstruccion      = dato.FechaTerminoConstruccion;
                oConjunto.FechaRecepcionMunicipal       = dato.FechaRecepcionMunicipal;
                oConjunto.FechaRecepcionProhogar        = dato.FechaRecepcionProhogar;

                newListConjunto.Add(oConjunto);
            }


            return(newListConjunto);
        }
Beispiel #23
0
 public int delete(ConjuntoHabitacional_ENT datosConjuntoHabitacional)
 {
     try
     {
         using (SqlConnection sqlConn = new SqlConnection(this.ConexionPH))
         {
             sqlConn.Open();
             SqlCommand cmd = new SqlCommand(this.ConexionPH, sqlConn);
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "SP_DELETE_CONJUNTOHABITACIONAL";
             cmd.Parameters.AddWithValue("@id_conjunto_habitacional", datosConjuntoHabitacional.IdConjuntoHabitacional);
             SqlDataReader reader = cmd.ExecuteReader();
             while (reader.Read())
             {
                 this.error = reader["error"].Equals(1) ? 1 : 0;
             }
             return(this.error);
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Error al ejecutar SP_DELETE_CONJUNTOHABITACIONAL", ex);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             string idDoc = Request.QueryString["ic"].ToString();
             string key   = Request.QueryString["key"].ToString();
             if (!string.IsNullOrEmpty(idDoc) && !string.IsNullOrEmpty(key))
             {
                 ConjuntoHabitacional_ENT conjunto = (ConjuntoHabitacional_ENT)Session["conjuntoHabitacionalSeleccionado"];
                 this.cargarFormulario(conjunto, idDoc);
             }
         }
         catch (Exception ex) { }
     }
     else
     {
         ConjuntoHabitacional_ENT conjunto = (ConjuntoHabitacional_ENT)Session["conjuntoHabitacionalSeleccionado"];
         txtCodigoConjunto.Text = conjunto.CodigoConjunto;
         txtNombreConjunto.Text = conjunto.NombreConjunto;
         txtEtapa.Text          = conjunto.Etapa;
     }
 }
 public int update(ConjuntoHabitacional_ENT conjunto)
 {
     return(new ConjuntoHabitacional_DAO().update(conjunto));
 }
        public int deleteConjuntoHabitacional(ConjuntoHabitacional_ENT datosConjuntoHabitacional)
        {
            int error = new ConjuntoHabitacional_DAO().delete(datosConjuntoHabitacional);

            return(error);
        }
 private void cargarFormulario(ConjuntoHabitacional_ENT conjunto)
 {
     txtCodigoConjunto.Text = conjunto.CodigoConjunto;
     txtNombreConjunto.Text = conjunto.NombreConjunto;
     txtEtapa.Text          = conjunto.Etapa;
 }
        public ConjuntoHabitacional_ENT insertConjuntoHabitacional(ConjuntoHabitacional_ENT datosConjuntoHabitacional)
        {
            ConjuntoHabitacional_ENT oConjunto = new ConjuntoHabitacional_DAO().insert(datosConjuntoHabitacional);

            return(oConjunto);
        }
Beispiel #29
0
 protected void cargarDatosConjunto(ConjuntoHabitacional_ENT oConjunto)
 {
     //text_codigo_conjunto.Text = oConjunto.CodigoConjunto;
     //text_nombre_conjunto.Text = oConjunto.NombreConjunto;
     //text_etapa.Text = oConjunto.Etapa;
 }