//Boton Aceptar - Guarda la propiedad y direcciona a la pagina de carga de imagenes
    protected void btnAceptar_Click1(object sender, EventArgs e)
    {
        if (CheckCHBLPalabrasCLaves(1))
        {
            try
            {
                InmueblesBLL bllInmuebles = new InmueblesBLL();

                bllInmuebles.Insert(cargarPropiedad());

                string ID = bllInmuebles.SeleccionaIdDelUltimoInmueble(Membership.GetUser().ProviderUserKey.ToString());

                Response.Redirect("AltaImagen.aspx?IdInmueble=" + ID, false);
            }
            catch (Exception exe)
            {
                //lblError.Text = exe.Message.ToString();
                lblError.Text = "Error al cargar la Propiedad, por favor intente nuevamente";
            }
        }
        else
        {
            lblPalbrasClaves.Visible = true;
        }
    }
コード例 #2
0
    protected void btnAceptar_Click1(object sender, EventArgs e)
    {
        //CalcularSesion();
        //if (CheckCHBLPalabrasCLaves(1))
        //{
            if (Request.QueryString["IdTransaction"] == "0")
            {
                try
                {
                    InmueblesBLL bllInmuebles = new InmueblesBLL();
                    bllInmuebles.Update(cargarPropiedad());
                    Response.Redirect("AltaImagen.aspx?IdInmueble=" + Request.QueryString["IdInmueble"], false);
                }
                catch (Exception exe)
                {
                    //lblError.Text = exe.Message.ToString();

                    lblError.Text = "Error al cargar la Propiedad, por favor intente nuevamente";
                }
            }
            else if (Request.QueryString["IdTransaction"] == "1")
            {
                try
                {
                    InmueblesBLL bllInmuebles = new InmueblesBLL();

                    bllInmuebles.Insert(cargarPropiedad());

                    string ID = bllInmuebles.SeleccionaIdDelUltimoInmueble(Membership.GetUser().ProviderUserKey.ToString());

                    if (Directory.Exists(Server.MapPath("~") + @"\Image_Upload\"))
                    {
                        for (int i = 1; i < 10; i++)
                        {

                            string test = Server.MapPath("~") + @"\Image_Upload\" + IdInmueble + "-0" + i + ".jpg";

                            if (File.Exists(Server.MapPath("~") + @"\Image_Upload\" + IdInmueble + "-0" + i +".jpg"))
                            {
                                File.Copy(Server.MapPath("~") + @"\Image_Upload\" + IdInmueble + "-0" + i + ".jpg", Server.MapPath("~") + @"\Image_Upload\" + ID + "-0" + i + ".jpg");
                                File.Copy(Server.MapPath("~") + @"\Image_Upload\" + IdInmueble + "-0" + i + "_thumb.jpg", Server.MapPath("~") + @"\Image_Upload\" + ID + "-0" + i + "_thumb.jpg");
                            }
                            if (File.Exists(Server.MapPath("~") + @"\Image_Upload\" + IdInmueble + "-" + i + ".jpg"))
                            {
                                File.Copy(Server.MapPath("~") + @"\Image_Upload\" + IdInmueble + "-" + i + ".jpg", Server.MapPath("~") + @"\Image_Upload\" + ID + "-" + i + ".jpg");
                                File.Copy(Server.MapPath("~") + @"\Image_Upload\" + IdInmueble + "-" + i + "_thumb.jpg", Server.MapPath("~") + @"\Image_Upload\" + ID + "-" + i + "_thumb.jpg");
                            }
                        }
                    }

                    Response.Redirect("FichaPropiedad.aspx?IdInmueble=" + ID, false);
                    //Response.Redirect("AltaImagen.aspx?IdInmueble=" + ID, false);
                }
                catch (Exception exe)
                {
                    //lblError.Text = exe.Message.ToString();
                    lblError.Text = "Error al cargar la Propiedad, por favor intente nuevamente";
                }
            }

        //}
        //else
        //{
        //    lblPalbrasClaves.Visible = true;
        //}
    }