Exemple #1
0
 private void Guardar(bool NuevoRegistro, string ID, string nombre, string apePat, string apeMat, int partido)
 {
     try
     {
         RR_InformacionCandidato Datos = new RR_InformacionCandidato
         {
             NuevoRegistro   = NuevoRegistro,
             IDCandidato     = ID,
             Nombre          = nombre,
             ApePat          = apePat,
             ApeMat          = apeMat,
             PartidoPolitico = partido,
             Conexion        = Comun.Conexion,
             IDUsuario       = Comun.IDUsuario
         };
         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
         CN.ACInformacionCandidato(Datos);
         if (Datos.Completado)
         {
             Response.Redirect("frmPublicarInformacionCandidato.aspx", false);
         }
         else
         {
             string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error",
                                                     ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
             ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #2
0
 private void Guardar(bool nuevoRegitro, int id, string titulo, string desc)
 {
     try
     {
         RR_CarreraPolitica Datos = new RR_CarreraPolitica
         {
             NuevoRegistro         = nuevoRegitro,
             IDCarreraPolitica     = id,
             TituloCarreraPolitica = titulo,
             DescripcionCarreraPol = desc,
             Conexion  = Comun.Conexion,
             IDUsuario = Comun.IDUsuario
         };
         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
         CN.ACCarreraPolitica(Datos);
         if (Datos.Completado)
         {
             Response.Redirect("frmTextoCarreraPoliticaGrid.aspx", false);
         }
         else
         {
             string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error",
                                                     ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
             ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            CH_Foto DatosAux = new CH_Foto {
                Conexion = Comun.Conexion, IDUsuario = Comun.IDUsuario
            };
            CH_FotoNegocio             FN = new CH_FotoNegocio();
            RR_AdministradorWebNegocio RN = new RR_AdministradorWebNegocio();

            if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3")
            {
                if (Request.QueryString["id"] != null)
                {
                    string ID = Request.QueryString["id"].ToString();
                    if (Request.QueryString["id"].ToString() == ID)
                    {
                        DatosAux.NuevoRegistro = true;
                        DatosAux.IDFoto        = ID;
                        RN.CargarFotoXID(DatosAux);
                        if (DatosAux.Completado)
                        {
                            string ScriptError = DialogMessage.Show(TipoMensaje.Success, "Registro agregado a la página correctamente.", "Información", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
                        }
                        else
                        {
                            string ScriptError = DialogMessage.Show(TipoMensaje.Error, "No se puede agregar el registro a la página registro.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
                        }
                    }
                }
            }
            Lista = FN.ObtenerCatalogoFotos(DatosAux);
        }
 private void Guardar(bool NuevoRegistro, string ID, int idRed, string Cuenta)
 {
     try
     {
         RR_DatosRedesSociales Datos = new RR_DatosRedesSociales
         {
             NuevoRegistro   = NuevoRegistro,
             IDRedSocial     = ID,
             IDTipoRedSocial = idRed,
             Cuenta          = Cuenta,
             Conexion        = Comun.Conexion,
             IDUsuario       = Comun.IDUsuario
         };
         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
         CN.ACRedesSociales(Datos);
         if (Datos.Completado)
         {
             Response.Redirect("frmDatosRedesSocialesGrid.aspx", false);
         }
         else
         {
             string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error",
                                                     ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
             ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["op"] != null)
         {
             if (Request.QueryString["op"] == "2")
             {
                 if (Request.QueryString["id"] != null)
                 {
                     string ID = Request.QueryString["id"].ToString();
                     RR_PropuestaCamapaña Datos = new RR_PropuestaCamapaña {
                         Conexion = Comun.Conexion, IDPropuesta = ID
                     };
                     RR_AdministradorWebNegocio AWN = new RR_AdministradorWebNegocio();
                     Lista = AWN.ObtenerPropuestaDetallada(Datos);
                     this.CargarPropuestas();
                 }
                 else
                 {
                 }
             }
             else
             {
             }
         }
         else
         {
         }
     }
     else
     {
     }
 }
Exemple #6
0
 private void Guardar(bool nuevoRegistro, string id, string nombre, string desc1, string desc2, string desc3, string piePag)
 {
     try
     {
         RR_PropuestaCamapaña DatosAux = new RR_PropuestaCamapaña()
         {
             NuevoRegistro   = nuevoRegistro,
             IDPropuesta     = id,
             NombrePropuesta = nombre,
             Descripcion1    = desc1,
             Descripcion2    = desc2,
             Descripcion3    = desc3,
             PieDePagina     = piePag,
             Conexion        = Comun.Conexion,
             IDUsuario       = Comun.IDUsuario
         };
         RR_AdministradorWebNegocio AWN = new RR_AdministradorWebNegocio();
         AWN.ACPropuestaCampania(DatosAux);
         if (DatosAux.Completado)
         {
             Response.Redirect("frmPropuestaCampañaGrid.aspx", false);
         }
         else
         {
             string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error",
                                                     ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
             ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["op"] != null)
         {
             if (Request.QueryString["op"] == "2")
             {
                 if (Request.QueryString["id"] != null)
                 {
                     string  ID    = Request.QueryString["id"].ToString();
                     RR_Blog Datos = new RR_Blog {
                         Conexion = Comun.Conexion, IDPublicacion = ID
                     };
                     RR_AdministradorWebNegocio AWN = new RR_AdministradorWebNegocio();
                     Lista = AWN.ObtenerBlogDetallado(Datos);
                 }
                 else
                 {
                 }
             }
             else
             {
             }
         }
         else
         {
         }
     }
     else
     {
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["op"] != null)
         {
             if (Request.QueryString["op"] == "2")
             {
                 if (Request.QueryString["id"] != null)
                 {
                     ObtenerEventos();
                     string    ID    = Request.QueryString["id"].ToString();
                     CH_Evento Datos = new CH_Evento {
                         Conexion = Comun.Conexion, IDEvento = ID
                     };
                     RR_AdministradorWebNegocio AWN = new RR_AdministradorWebNegocio();
                     Lista = AWN.ObtenerEventosDesc(Datos);
                 }
                 else
                 {
                 }
             }
             else
             {
             }
         }
         else
         {
         }
     }
     else
     {
     }
 }
        private void CargarIconos()
        {
            RR_DatosRedesSociales Datos = new RR_DatosRedesSociales {
                Conexion = Comun.Conexion
            };
            RR_AdministradorWebNegocio GN = new RR_AdministradorWebNegocio();

            Lista = GN.ObtenerIconosRedes(Datos);
        }
        private void ObtenerEventos()
        {
            GM_Calendar Datos = new GM_Calendar {
                Conexion = Comun.Conexion
            };
            RR_AdministradorWebNegocio AW = new RR_AdministradorWebNegocio();

            ListaEventos = AW.ObtenerEventosCalendario2(Datos);
        }
Exemple #11
0
        private void CargarComboPartido()
        {
            CH_PartidoPolitico Datos = new CH_PartidoPolitico()
            {
                Conexion = Comun.Conexion
            };
            RR_AdministradorWebNegocio GN = new RR_AdministradorWebNegocio();

            ListaPartido = GN.ObtenerComboPartido(Datos);
        }
Exemple #12
0
 public void CargarDescBlog()
 {
     try
     {
         RR_Blog Datos = new RR_Blog {
             Conexion = Comun.Conexion
         };
         RR_AdministradorWebNegocio GN = new RR_AdministradorWebNegocio();
         ListaB = GN.ObtenerDescBlog(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public void CargarPropuestas()
 {
     try
     {
         RR_PropuestaCamapaña Datos = new RR_PropuestaCamapaña {
             Conexion = Comun.Conexion
         };
         RR_AdministradorWebNegocio GN = new RR_AdministradorWebNegocio();
         Lista = GN.ObtenerPropuestas(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #14
0
 public void CargarGridTipoEventoCampania()
 {
     try
     {
         RR_CarreraPolitica Datos = new RR_CarreraPolitica {
             Conexion = Comun.Conexion
         };
         RR_AdministradorWebNegocio GN = new RR_AdministradorWebNegocio();
         Lista = GN.ObtenerCarreraPolXID(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public void CargarGridTipoEventoCampania()
 {
     try
     {
         RR_Donate Datos = new RR_Donate {
             Conexion = Comun.Conexion
         };
         RR_AdministradorWebNegocio GN = new RR_AdministradorWebNegocio();
         Lista = GN.ObtenerTextoDonate(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #16
0
 public void CargarGrid()
 {
     try
     {
         RR_DatosRedesSociales Datos = new RR_DatosRedesSociales()
         {
             Conexion = Comun.Conexion
         };
         RR_AdministradorWebNegocio GN = new RR_AdministradorWebNegocio();
         Lista = GN.ObtenerRedesSociales(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3")
                {
                    if (Request.QueryString["id"] != null)
                    {
                        string AuxID = Request.QueryString["id"];
                        //int.TryParse(Request.QueryString["id"], out AuxID);
                        RR_DatosRedesSociales Datos = new RR_DatosRedesSociales {
                            Conexion = Comun.Conexion, IDRedSocial = AuxID, IDUsuario = Comun.IDUsuario
                        };
                        RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
                        CN.EliminarRedesSocXID(Datos);
                        if (Datos.Completado)
                        {
                            string ScriptError = DialogMessage.Show(TipoMensaje.Success, "Registro eliminado correctamente.", "Información", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
                        }
                        else
                        {
                            string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
                        }
                    }
                }

                if (!IsPostBack)
                {
                }
                else
                {
                }
                this.CargarGrid();
                if (Request.QueryString["errorMessage"] != null)
                {
                    string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al cargar los datos. Intenté nuevamente", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("PageError.aspx?errorNumber=" + ex.HResult);
            }
        }
 private void Guardar(bool nuevoRegitro, int id, string Thacemos, string descHacemos, string Tafiliate, string afiliate,
                      string TproxEvent, string descProxEventos, string tEquipoTrabajo, string descEquipoTrabajo, string Tblog, string blog,
                      string Tcontactanos, string contacto)
 {
     try
     {
         RR_DatosHome Datos = new RR_DatosHome
         {
             NuevoRegistro       = nuevoRegitro,
             IDHomeText          = id,
             TituloHacemos       = Thacemos,
             DescHacemos         = descHacemos,
             TituloAfiliate      = Tafiliate,
             DescAfiliate        = afiliate,
             TituloProxEvent     = TproxEvent,
             DescProxEvent       = descProxEventos,
             TituloEquipoTrabajo = tEquipoTrabajo,
             DescEquipoTrabajo   = descEquipoTrabajo,
             TituloBlog          = Tblog,
             DescBlog            = blog,
             TituloContactanos   = Tcontactanos,
             Contactanos         = contacto,
             Conexion            = Comun.Conexion,
             IDUsuario           = Comun.IDUsuario
         };
         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
         CN.ACDatosHome(Datos);
         if (Datos.Completado)
         {
             Response.Redirect("frmTextoHomeGrid.aspx", false);
         }
         else
         {
             string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error",
                                                     ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
             ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string IDFoto           = "";
            RR_PropuestaCamapaña PC = new RR_PropuestaCamapaña {
                Conexion = Comun.Conexion, IDUsuario = Comun.IDUsuario
            };
            RR_AdministradorWebNegocio RN = new RR_AdministradorWebNegocio();

            if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3")
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id2"] != null)
                {
                    IDFoto = Request.QueryString["id"].ToString();

                    if (Request.QueryString["id"].ToString() == IDFoto)
                    {
                        PC.IDPropuesta = Request.QueryString["id2"].ToString();
                        PC.IDFoto      = IDFoto;
                        RN.CargarFotoPropuesta(PC);
                        if (PC.Completado)
                        {
                            Response.Redirect("frmPropuestaCampañaGrid.aspx", false);
                            string ScriptError = DialogMessage.Show(TipoMensaje.Success, "Registro agregado a la página correctamente.", "Información", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                        }
                        else
                        {
                            string ScriptError = DialogMessage.Show(TipoMensaje.Error, "No se puede agregar el registro a la página registro.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
                        }
                    }
                }
            }
            else if (Request.QueryString["op"] != null && Request.QueryString["op"] == "4")
            {
                if (Request.QueryString["id"] != null)
                {
                    IDPropuesta    = Request.QueryString["id"].ToString();
                    PC.IDPropuesta = IDPropuesta;
                    Lista          = RN.ObtenerCatalogoFotos(PC);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            GM_VideosLoad DatosAux = new GM_VideosLoad {
                Conexion = Comun.Conexion, IDUsuario = Comun.IDUsuario
            };
            GM_VideoNegocio            CN = new GM_VideoNegocio();
            RR_AdministradorWebNegocio RN = new RR_AdministradorWebNegocio();

            try
            {
                if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3")
                {
                    if (Request.QueryString["id"] != null)
                    {
                        string ID = Request.QueryString["id"].ToString();
                        if (Request.QueryString["id"].ToString() == ID)
                        {
                            DatosAux.NuevoVideo = true;
                            DatosAux.IDVideo    = ID;
                            RN.CargaVideoXID(DatosAux);
                            if (DatosAux.Completado)
                            {
                                string ScriptError = DialogMessage.Show(TipoMensaje.Success, "Registro agregado a la página correctamente.", "Información", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                                ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
                            }
                            else
                            {
                                string ScriptError = DialogMessage.Show(TipoMensaje.Error, "No se puede agregar el registro a la página registro.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                                ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("PageError.aspx?errorNumber=" + ex.HResult);
            }
            Lista = CN.ObtenerListStatusVideo(DatosAux);
        }
Exemple #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3")
         {
             if (Request.QueryString["id"] != null)
             {
                 string  AuxID = Request.QueryString["id"];
                 RR_Blog Datos = new RR_Blog {
                     Conexion = Comun.Conexion, IDPublicacion = AuxID, IDUsuario = Comun.IDUsuario
                 };
                 RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
                 CN.EliminarPublicacionesBlogXID(Datos);
                 if (Datos.Completado)
                 {
                     //Mostrar mensaje Success
                 }
                 else
                 {
                     //Mostrar Mensaje de error
                 }
             }
         }
         if (!IsPostBack)
         {
         }
         else
         {
         }
         this.CargarGrid();
     }
     catch (Exception ex)
     {
         Response.Redirect("PageError.aspx?errorNumber=" + ex.HResult);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CargarComboRedes();
         //Se inicializan campos, datos, valores
         if (Request.QueryString["op"] != null)
         {
             if (Request.QueryString["op"] == "2")
             {
                 if (Request.QueryString["id"] != null)
                 {
                     string ID;
                     if (Request.QueryString["id"].ToString() != string.Empty)
                     {
                         ID = Request.QueryString["id"].ToString();
                         //Obtener los datos y dibujarlos.
                         RR_DatosRedesSociales DatosAux = new RR_DatosRedesSociales {
                             Conexion = Comun.Conexion, IDRedSocial = ID
                         };
                         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
                         CN.ObtenerRedesSocXID(DatosAux);
                         if (DatosAux.Completado)
                         {
                             this.CargarDatos(DatosAux);
                         }
                         else
                         {
                             //Ocurrió un error
                             Response.Redirect("frmDatosRedesSocialesGrid.aspx?errorMessage=" + DatosAux.Completado);
                         }
                     }
                     else
                     {
                         Response.Redirect("frmDatosRedesSocialesGrid.aspx?errorMessage=1");
                     }
                 }
                 else
                 {
                     Response.Redirect("frmDatosRedesSocialesGrid.aspx?errorMessage=2");
                 }
             }
             else
             {
                 Response.Redirect("frmDatosRedesSocialesGrid.aspx?errorMessage=3");
             }
         }
         else
         {
             this.IniciarDatos();
         }
     }
     else
     {
         //Page.Validate();
         //if (IsValid)
         //{
         if (Request.Form.Count == 7)
         {
             string Cuenta    = Request.Form["ctl00$cph_MasterBody$txtCuenta"].ToString();
             int    redSocial = Convert.ToInt32(Request.Form["cmbRedSocial"].ToString());
             //int cmbPartido = 0;
             //int.TryParse(Request.Form["cmbPartidos"].ToString(), out cmbPartido);
             int IDColab = 0;
             try
             {
                 string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString();
                 int.TryParse(AuxID, out IDColab);
                 bool NuevoRegistro = (AuxID == "-1");
                 this.Guardar(NuevoRegistro, AuxID, redSocial, Cuenta);
             }
             catch (Exception ex)
             {
                 Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message);
             }
             //}
         }
     }
 }
Exemple #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CargarComboPartido();
     if (!IsPostBack)
     {
         //Se inicializan campos, datos, valores
         if (Request.QueryString["op"] != null)
         {
             if (Request.QueryString["op"] == "2")
             {
                 if (Request.QueryString["id"] != null)
                 {
                     string ID;
                     if (Request.QueryString["id"].ToString() != string.Empty)
                     {
                         ID = Request.QueryString["id"].ToString();
                         //Obtener los datos y dibujarlos.
                         RR_InformacionCandidato DatosAux = new RR_InformacionCandidato {
                             Conexion = Comun.Conexion, IDCandidato = ID
                         };
                         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
                         CN.ACInformacionCandidato(DatosAux);
                         if (DatosAux.Completado)
                         {
                             this.CargarDatos(DatosAux);
                         }
                         else
                         {
                             //Ocurrió un error
                             Response.Redirect("frmPublicarInformacionCandidatoGrid.aspx?errorMessage=" + DatosAux.Completado);
                         }
                     }
                     else
                     {
                         Response.Redirect("frmActividadesEventosGrid.aspx?errorMessage=1");
                     }
                 }
                 else
                 {
                     Response.Redirect("frmActividadesEventosGrid.aspx?errorMessage=2");
                 }
             }
             else
             {
                 Response.Redirect("frmActividadesEventosGrid.aspx?errorMessage=3");
             }
         }
         else
         {
             this.IniciarDatos();
         }
     }
     else
     {
         //Page.Validate();
         //if (IsValid)
         //{
         if (Request.Form.Count == 9)
         {
             string nombre     = Request.Form["ctl00$cph_MasterBody$txtNombre"].ToString();
             string ApePat     = Request.Form["ctl00$cph_MasterBody$txtApePat"].ToString();
             string ApeMat     = Request.Form["ctl00$cph_MasterBody$txtApeMat"].ToString();
             int    cmbPartido = 0;
             int.TryParse(Request.Form["cmbPartido"].ToString(), out cmbPartido);
             int IDColab = 0;
             try
             {
                 string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString();
                 int.TryParse(AuxID, out IDColab);
                 bool NuevoRegistro = (AuxID == "-1");
                 this.Guardar(NuevoRegistro, AuxID, nombre, ApePat, ApeMat, cmbPartido);
             }
             catch (Exception ex)
             {
                 Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message);
             }
             //}
         }
     }
 }
Exemple #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["op"] != null)
         {
             if (Request.QueryString["op"] == "2")
             {
                 if (Request.QueryString["id"] != null)
                 {
                     string ID = Request.QueryString["id"].ToString();
                     if (Request.QueryString["id"].ToString() == ID)
                     {
                         //Obtener los datos y dibujarlos.
                         RR_MiembrosEquipoTrabajo DatosAux = new RR_MiembrosEquipoTrabajo {
                             Conexion = Comun.Conexion, IDMiembroEquipo = ID
                         };
                         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
                         //CN.ObtenerDetalleColaboradoresXID(DatosAux);
                         if (DatosAux.Completado)
                         {
                             this.CargarDatos(DatosAux);
                         }
                         else
                         {
                             //Ocurrió un error
                             Response.Redirect("frmColaboradores.aspx?error=" + "Error al cargar los datos&nError=1");
                         }
                     }
                     else
                     {
                         Response.Redirect("frmColaboradores.aspx");
                     }
                 }
                 else
                 {
                     Response.Redirect("frmColaboradores.aspx");
                 }
             }
             else
             {
                 Response.Redirect("frmColaboradores.aspx");
             }
         }
         else
         {
             this.IniciarDatos();
         }
     }
     else
     {
         if (Request.Form.Count == 10 || Request.Form.Count == 12 || Request.Form.Count == 14 || Request.Form.Count == 16 ||
             Request.Form.Count == 18 || Request.Form.Count == 20)
         {
             bool   isfacebook      = false;
             bool   isinstagram     = false;
             bool   isgoogle        = false;
             bool   isprinterest    = false;
             bool   istwitter       = false;
             bool   Band            = false;
             string IDMiembroEquipo = "";
             if (imgImagen.HasFile) //Hay cambio de imagen
             {
                 Band = true;
             }
             string txtNomb   = Request.Form["ctl00$cph_MasterBody$txtNombre"].ToString();
             string txtApePat = Request.Form["ctl00$cph_MasterBody$txtApePat"].ToString();
             string txtApeMat = Request.Form["ctl00$cph_MasterBody$txtApeMat"].ToString();
             string txtPuesto = Request.Form["ctl00$cph_MasterBody$txtOcupacion"].ToString();
             string txtPagWeb = Request.Form["ctl00$cph_MasterBody$txtPagWeb"].ToString();
             string txtFb     = Request.Form["ctl00$cph_MasterBody$txtfb"] != null ? Request.Form["ctl00$cph_MasterBody$txtfb"].ToString() : string.Empty;
             string txtTw     = Request.Form["ctl00$cph_MasterBody$txtTw"] != null ? Request.Form["ctl00$cph_MasterBody$txtTw"].ToString() : string.Empty;
             string txtGo     = Request.Form["ctl00$cph_MasterBody$txtGo"] != null ? Request.Form["ctl00$cph_MasterBody$txtGo"].ToString() : string.Empty;
             string txtInst   = Request.Form["ctl00$cph_MasterBody$txtIns"] != null ? Request.Form["ctl00$cph_MasterBody$txtIns"].ToString() : string.Empty;
             string txtPrint  = Request.Form["ctl00$cph_MasterBody$txtPri"] != null ? Request.Form["ctl00$cph_MasterBody$txtPri"].ToString() : string.Empty;
             string facebook  = Request.Form["ckfb"] != null ? Request.Form["ckfb"].ToString() : string.Empty;
             string twitter   = Request.Form["cktw"] != null ? Request.Form["cktw"].ToString() : string.Empty;
             string google    = Request.Form["ckgo"] != null ? Request.Form["ckgo"].ToString() : string.Empty;
             string instagram = Request.Form["ckIns"] != null ? Request.Form["ckIns"].ToString() : string.Empty;
             string pinterest = Request.Form["ckPri"] != null ? Request.Form["ckPri"].ToString() : string.Empty;
             if (bool.TryParse(facebook, out isfacebook) == true)
             {
                 isfacebook = true;
             }
             if (bool.TryParse(twitter, out istwitter) == true)
             {
                 istwitter = true;
             }
             if (bool.TryParse(instagram, out isinstagram) == true)
             {
                 isinstagram = true;
             }
             if (bool.TryParse(google, out isgoogle) == true)
             {
                 isgoogle = true;
             }
             if (bool.TryParse(pinterest, out isprinterest) == true)
             {
                 isprinterest = true;
             }
             string         txtUrlImg   = Band ? imgImagen.PostedFile.FileName : string.Empty;
             HttpPostedFile bannerImage = imgImagen.PostedFile as HttpPostedFile;
             try
             {
                 string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString();
                 IDMiembroEquipo = AuxID;
                 bool NuevoRegistro = string.IsNullOrEmpty(IDMiembroEquipo);
                 this.Guardar(NuevoRegistro, IDMiembroEquipo, txtNomb, txtApePat, txtApeMat, txtPuesto, txtPagWeb, isfacebook, istwitter, isinstagram, isgoogle, isprinterest,
                              txtFb, txtTw, txtGo, txtInst, txtPrint, txtUrlImg, bannerImage, Band);
             }
             catch (Exception ex)
             {
                 Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message);
             }
         }
         else
         {
         }
     }
 }
Exemple #25
0
 private void Guardar(bool nuevoRegistro, string id, string nombre, string apPat, string apMat, string puesto, string pagWeb, bool isFb, bool isTw, bool isGoo,
                      bool isInst, bool isPrint, string txtFb, string txtTw, string txtGoo, string txtInst, string txtPrint, string FileName, HttpPostedFile PostedImage, bool BandCambioImagen)
 {
     try
     {
         string BaseDir                 = Server.MapPath("");
         string FileExtension           = BandCambioImagen ? Path.GetExtension(FileName) : string.Empty;
         RR_MiembrosEquipoTrabajo Datos = new RR_MiembrosEquipoTrabajo
         {
             NuevoRegistro   = nuevoRegistro,
             IDMiembroEquipo = id,
             Nombre          = nombre,
             ApePat          = apPat,
             ApeMat          = apMat,
             Puesto          = puesto,
             PagWeb          = pagWeb,
             IsFb            = isFb,
             IsGoo           = isGoo,
             IsInst          = isInst,
             IsTw            = isTw,
             IsPrin          = isPrint,
             Fb               = txtFb,
             Goo              = txtGoo,
             Ins              = txtInst,
             Tw               = txtTw,
             Print            = txtPrint,
             ExtrancionImagen = FileExtension,
             CambiarImagen    = BandCambioImagen,
             UrlImagen        = BaseDir,
             Conexion         = Comun.Conexion,
             IDUsuario        = User.Identity.Name
         };
         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
         CN.ACCatalogoMiembrosEquipoTrabajo(Datos);
         Datos.Completado = true;
         if (Datos.Completado)
         {
             if (BandCambioImagen)
             {
                 if (PostedImage != null && PostedImage.ContentLength > 0)
                 {
                     try
                     {
                         Stream S = PostedImage.InputStream;
                         System.Drawing.Image Img = new System.Drawing.Bitmap(S);
                         Img.Save(BaseDir + Datos.UrlImagen);
                         //CN.ImagenSubidaColaboradroXID(Datos);
                     }
                     catch (Exception)
                     {
                     }
                 }
             }
             Response.Redirect("frmMiembrosEquipoTrabajo.aspx", false);
         }
         else
         {
             string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
             ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //Se inicializan campos, datos, valores
         if (Request.QueryString["op"] != null)
         {
             if (Request.QueryString["op"] == "2")
             {
                 if (Request.QueryString["id"] != null)
                 {
                     int ID = 0;
                     if (int.TryParse(Request.QueryString["id"].ToString(), out ID))
                     {
                         //Obtener los datos y dibujarlos.
                         RR_CarreraPolitica DatosAux = new RR_CarreraPolitica {
                             Conexion = Comun.Conexion, IDCarreraPolitica = ID
                         };
                         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
                         CN.ObtenerTextoCarreraXID(DatosAux);
                         if (DatosAux.Completado)
                         {
                             this.CargarDatos(DatosAux);
                         }
                         else
                         {
                             //Ocurrió un error
                             Response.Redirect("frmTextoHomeGrid.aspx?errorMessage=" + DatosAux.Completado);
                         }
                     }
                     else
                     {
                         Response.Redirect("frmTextoCarreraPoliticaGrid.aspx?errorMessage=1");
                     }
                 }
                 else
                 {
                     Response.Redirect("frmTextoCarreraPoliticaGrid.aspx?errorMessage=2");
                 }
             }
             else
             {
                 Response.Redirect("frmTextoCarreraPoliticaGrid.aspx?errorMessage=3");
             }
         }
         else
         {
             Response.Redirect("frmTextoCarreraPoliticaGrid.aspx", false);
         }
     }
     else
     {
         if (Request.Form.Count == 7)
         {
             string titulo  = Request.Form["ctl00$cph_MasterBody$txttitulo"].ToString();
             string desc    = Request.Form["ctl00$cph_MasterBody$txtdescr"].ToString();
             int    IDTexto = -1;
             try
             {
                 string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString();
                 int.TryParse(AuxID, out IDTexto);
                 bool NuevoRegistro = !(IDTexto > 0);
                 this.Guardar(NuevoRegistro, IDTexto, titulo, desc);
             }
             catch (Exception ex)
             {
                 Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message);
             }
         }
     }
 }
Exemple #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["op"] != null)
                {
                    if (Request.QueryString["op"] == "2")
                    {
                        if (Request.QueryString["id"] != null)
                        {
                            string ID = Request.QueryString["id"].ToString();
                            RR_PropuestaCamapaña Datos = new RR_PropuestaCamapaña {
                                Conexion = Comun.Conexion, IDPropuesta = ID
                            };
                            RR_AdministradorWebNegocio AWN = new RR_AdministradorWebNegocio();
                            AWN.ObtenerPropuestaXID(Datos);
                            if (Datos.Completado)
                            {
                                CargarDatos(Datos);
                            }
                            else
                            {
                                Response.Redirect("frmPropuestaCampañaGrid.aspx?errorMessage=" + "Error al cargar los datos&nError=1");
                            }
                        }
                        else
                        {
                            Response.Redirect("frmPropuestaCampañaGrid.aspx");
                        }
                    }
                    else
                    {
                        Response.Redirect("frmPropuestaCampañaGrid.aspx");
                    }
                }
                else
                {
                    IniciarDatos();
                }
            }
            else
            {
                if (Request.Form.Count == 10)
                {
                    string txtNombre = Request.Form["ctl00$cph_MasterBody$txtPropuesta"].ToString();
                    string txtDesc1  = Request.Form["ctl00$cph_MasterBody$txtProp1"].ToString();
                    string txtDesc2  = Request.Form["ctl00$cph_MasterBody$txtProp2"].ToString();
                    string txtDesc3  = Request.Form["ctl00$cph_MasterBody$txtProp3"].ToString();
                    string txtPiePag = Request.Form["ctl00$cph_MasterBody$txtPiePag"].ToString();



                    try
                    {
                        string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString();
                        //IDColaborador = AuxID;
                        bool NuevoRegistro = AuxID == "";
                        this.Guardar(NuevoRegistro, AuxID, txtNombre, txtDesc1, txtDesc2, txtDesc3, txtPiePag);
                    }
                    catch (Exception ex)
                    {
                        Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message);
                    }
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //Se inicializan campos, datos, valores
         if (Request.QueryString["op"] != null)
         {
             if (Request.QueryString["op"] == "2")
             {
                 if (Request.QueryString["id"] != null)
                 {
                     int ID = 0;
                     if (int.TryParse(Request.QueryString["id"].ToString(), out ID))
                     {
                         //Obtener los datos y dibujarlos.
                         RR_DatosHome DatosAux = new RR_DatosHome {
                             Conexion = Comun.Conexion, IDHomeText = ID
                         };
                         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
                         CN.ObtenerTextoHomeXID(DatosAux);
                         if (DatosAux.Completado)
                         {
                             this.CargarDatos(DatosAux);
                         }
                         else
                         {
                             //Ocurrió un error
                             Response.Redirect("frmTextoHomeGrid.aspx?errorMessage=" + DatosAux.Completado);
                         }
                     }
                     else
                     {
                         Response.Redirect("frmTextoHomeGrid.aspx?errorMessage=1");
                     }
                 }
                 else
                 {
                     Response.Redirect("frmTextoHomeGrid.aspx?errorMessage=2");
                 }
             }
             else
             {
                 Response.Redirect("frmTextoHomeGrid.aspx?errorMessage=3");
             }
         }
         else
         {
             Response.Redirect("frmTextoHomeGrid.aspx?errorMessage=4");
         }
     }
     else
     {
         if (Request.Form.Count == 17)
         {
             string queTHacemos    = Request.Form["ctl00$cph_MasterBody$txtTituloHacemos"].ToString();
             string queHacemos     = Request.Form["ctl00$cph_MasterBody$txtQueHacemos"].ToString();
             string Tafiliate      = Request.Form["ctl00$cph_MasterBody$txtTituloAfiliate"].ToString();
             string afiliate       = Request.Form["ctl00$cph_MasterBody$txtAfiliate"].ToString();
             string TproxEventos   = Request.Form["ctl00$cph_MasterBody$txtTituloProxEventos"].ToString();
             string proxEventos    = Request.Form["ctl00$cph_MasterBody$txtProxEventos"].ToString();
             string TequipoTrabajo = Request.Form["ctl00$cph_MasterBody$txtTituloEquipoTrabajo"].ToString();
             string equipoTrabajo  = Request.Form["ctl00$cph_MasterBody$txtEquipoTrabajo"].ToString();
             string Tblog          = Request.Form["ctl00$cph_MasterBody$txtTituloBlog"].ToString();
             string blog           = Request.Form["ctl00$cph_MasterBody$txtDescTituloBlog"].ToString();
             string Tcontacto      = Request.Form["ctl00$cph_MasterBody$txtTituloContacto"].ToString();
             string contacto       = Request.Form["ctl00$cph_MasterBody$txtContacto"].ToString();
             int    IDstatus       = -1;
             try
             {
                 string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString();
                 int.TryParse(AuxID, out IDstatus);
                 bool NuevoRegistro = !(IDstatus > 0);
                 this.Guardar(NuevoRegistro, IDstatus, queTHacemos, queHacemos, Tafiliate, afiliate, TproxEventos, proxEventos,
                              TequipoTrabajo, equipoTrabajo, Tblog, blog, Tcontacto, contacto);
             }
             catch (Exception ex)
             {
                 Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message);
             }
         }
     }
 }
 private void Guardar(bool NuevoRegistro, string id, string titulo, string tittle, string alt, string descripcion, string FileName, HttpPostedFile PostedImage, bool BandCambioImagen, string textoHtml)
 {
     try
     {
         string  BaseDir       = Server.MapPath("");
         string  FileExtension = BandCambioImagen ? Path.GetExtension(FileName) : string.Empty;
         RR_Blog Datos         = new RR_Blog
         {
             NuevoRegistro = NuevoRegistro,
             IDPublicacion = ID,
             Titulo        = titulo,
             Fecha         = DateTime.Today,
             TextoReducido = textoHtml.Substring(0, 50),
             TextoHtml     = textoHtml,
             UrlImagen     = BaseDir,
             CambioImagen  = BandCambioImagen,
             Alt           = alt,
             Title         = tittle,
             Descripcion   = descripcion,
             TipoArchivo   = FileExtension,
             Conexion      = Comun.Conexion,
             IDUsuario     = Comun.IDUsuario
         };
         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
         CN.ACPublicacionesBlog(Datos);
         if (Datos.Completado)
         {
             if (BandCambioImagen)
             {
                 if (PostedImage != null && PostedImage.ContentLength > 0)
                 {
                     try
                     {
                         string BaseDirMarca = Server.MapPath("~/Images/MarcaAgua/watermark_final.png");
                         if (File.Exists(BaseDirMarca))
                         {
                             Stream S = PostedImage.InputStream;
                             System.Drawing.Image Img = new System.Drawing.Bitmap(S);
                             Img = UtilImagen.ResizeImageW(Img, 1024);
                             Img = UtilImagen.ResizeImageH(Img, 700);
                             System.Drawing.Image Marca = System.Drawing.Image.FromFile(BaseDirMarca);
                             Img = UtilImagen.SetWaterMark("", Img, Marca);
                             Img.Save(Datos.UrlImagen);
                         }
                         else
                         {
                             throw new Exception("No existe la imagen.");
                         }
                     }
                     catch (Exception ex)
                     {
                         throw ex;
                         string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Ocurrió un error al guardar la imagen.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                         ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
                     }
                 }
             }
             Response.Redirect("frmBlogGrid.aspx", false);
         }
         else
         {
             string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error",
                                                     ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
             ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //Se inicializan campos, datos, valores
         if (Request.QueryString["op"] != null)
         {
             if (Request.QueryString["op"] == "2")
             {
                 if (Request.QueryString["id"] != null)
                 {
                     string ID;
                     ID = Request.QueryString["id"];
                     if (ID != null) //(int.TryParse(Request.QueryString["id"].ToString(), out ID))
                     {
                         ID = Request.QueryString["id"];
                         //Obtener los datos y dibujarlos.
                         RR_Blog DatosAux = new RR_Blog {
                             Conexion = Comun.Conexion, IDPublicacion = ID
                         };
                         RR_AdministradorWebNegocio CN = new RR_AdministradorWebNegocio();
                         CN.ObtenerPublicacionesBlogXID(DatosAux);
                         if (DatosAux.Completado)
                         {
                             this.CargarDatos(DatosAux);
                         }
                         else
                         {
                             //Ocurrió un error
                             Response.Redirect("frmBlogGrid.aspx?errorMessage=" + DatosAux.Completado);
                         }
                     }
                     else
                     {
                         Response.Redirect("frmBlogGrid.aspx?errorMessage=1");
                     }
                 }
                 else
                 {
                     Response.Redirect("frmBlogGrid.aspx?errorMessage=2");
                 }
             }
             else
             {
                 Response.Redirect("frmBlogGrid.aspx?errorMessage=3");
             }
         }
         else
         {
             this.IniciarDatos();
         }
     }
     else
     {
         if (Request.Form.Count == 10)
         {
             bool Band = false;
             if (imgLogo.HasFile) //Hay cambio de imagen
             {
                 Band = true;
             }
             string         Titulo      = Request.Form["ctl00$cph_MasterBody$txtTituloBlog"].ToString();
             string         Tittle      = Request.Form["ctl00$cph_MasterBody$txtNombreImagen"].ToString();
             string         Alt         = Request.Form["ctl00$cph_MasterBody$txtAlt"].ToString();
             string         Descripcion = Request.Form["ctl00$cph_MasterBody$txtDescripcion"].ToString();
             string         TextoHtml   = Request.Form["ctl00$cph_MasterBody$txtBlog"].ToString();
             string         txtUrlImg   = Band ? imgLogo.PostedFile.FileName : string.Empty;
             HttpPostedFile bannerImage = imgLogo.PostedFile as HttpPostedFile;
             int            IDColab     = -1;
             try
             {
                 string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString();
                 int.TryParse(AuxID, out IDColab);
                 bool NuevoRegistro = (AuxID == "-1");
                 this.Guardar(NuevoRegistro, AuxID, Titulo, Tittle, Alt, Descripcion, txtUrlImg, bannerImage, Band, TextoHtml);
             }
             catch (Exception ex)
             {
                 Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message);
             }
         }
     }
 }