Exemple #1
0
        protected void btnLogin_ServerClick(object sender, EventArgs e)
        {
            Barrio        Barrio = new Barrio();
            BarrioNegocio BarNeg = new BarrioNegocio();
            Usuario       User   = new Usuario();
            CentroDeporte Centro = new CentroDeporte();
            CentroNegocio CenNeg = new CentroNegocio();

            User             = (Usuario)Session["User_Home"];
            Centro.Direccion = txbDireccion.Value;
            Centro.Nombre    = txbNombre.Value;

            Centro.Barrio        = new Barrio();
            Centro.Barrio.Nombre = ddBarrio.SelectedValue;

            Barrio = BarNeg.BuscarPorNombre(ddBarrio.SelectedValue);

            Centro.Barrio = Barrio;
            Centro.Dueño  = new Usuario();
            Centro.Dueño  = User;

            if (CenNeg.Guardar(Centro))
            {
                Response.Write("<script>alert('Centro dado de alta correctamente');</script>");
                Response.Redirect("ComercianteHome.aspx");
            }
            else
            {
                Response.Write("<script>alert('Hubo un error al dar de alta, por favor verifique');</script>");
                Response.Redirect("ComercianteHome.aspx");
            }
        }
Exemple #2
0
        protected void ddLocalidad_SelectedIndexChanged(object sender, EventArgs e)
        {
            BarrioNegocio BarNeg = new BarrioNegocio();

            ddBarrio.Items.Clear();
            ddBarrio.DataSource = BarNeg.BuscarPorLocalidad(ddLocalidad.SelectedValue);
            ddBarrio.DataBind();
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BarrioNegocio BarNeg = new BarrioNegocio();

                ddBarrio.DataSource = BarNeg.Listar();
                ddBarrio.DataBind();
            }
        }
Exemple #4
0
        protected void ddProvincia_SelectedIndexChanged(object sender, EventArgs e)
        {
            CiudadNegocio    CiuNeg = new CiudadNegocio();
            LocalidadNegocio LocNeg = new LocalidadNegocio();
            BarrioNegocio    BarNeg = new BarrioNegocio();

            ddCiudad.Items.Clear();
            ddCiudad.DataSource = CiuNeg.BuscarPorProvincia(ddProvincia.SelectedValue);
            ddCiudad.DataBind();

            ddLocalidad.Items.Clear();
            ddLocalidad.DataSource = LocNeg.BuscarPorProvincia(ddProvincia.SelectedValue);
            ddLocalidad.DataBind();

            ddBarrio.Items.Clear();
            ddBarrio.DataSource = BarNeg.BuscarPorProvincia(ddProvincia.SelectedValue);
            ddBarrio.DataBind();
        }
Exemple #5
0
        protected void Carga_Datos()
        {
            ProvinciaNegocio ProvNeg = new ProvinciaNegocio();
            CiudadNegocio    CiuNeg  = new CiudadNegocio();
            LocalidadNegocio LocNeg  = new LocalidadNegocio();
            BarrioNegocio    BarNeg  = new BarrioNegocio();
            ActividadNegocio ActNeg  = new ActividadNegocio();

            ddActividad.DataSource = ActNeg.Listar();
            ddActividad.DataBind();

            ddProvincia.DataSource = ProvNeg.Listar();
            ddProvincia.DataBind();

            ddCiudad.DataSource = CiuNeg.BuscarPorProvincia(ddProvincia.SelectedValue);
            ddCiudad.DataBind();

            ddLocalidad.DataSource = LocNeg.Listar(ddCiudad.SelectedValue);
            ddLocalidad.DataBind();

            ddBarrio.DataSource = BarNeg.Listar();
            ddBarrio.DataBind();
        }