コード例 #1
0
 public void Guardar(bool NuevoRegistro, string ID, string Url, string Alt, string Title, string Description)
 {
     try
     {
         GM_VideosLoad Datos = new GM_VideosLoad()
         {
             NuevoVideo  = NuevoRegistro,
             IDVideo     = ID,
             Url         = Url,
             Alt         = Alt,
             Title       = Title,
             Description = Description,
             Conexion    = Comun.Conexion,
             IDUsuario   = Comun.IDUsuario
         };
         GM_VideoNegocio VN = new GM_VideoNegocio();
         VN.ACStatuVideo(Datos);
         if (Datos.Completado)
         {
             string ScripSucces = DialogMessage.Show(TipoMensaje.Success, "Los datos se han guardado.", "Correctamente", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
             ScriptManager.RegisterStartupScript(this, typeof(Type), "popup", ScripSucces, true);
             Response.Redirect("frmVideosView.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);
             Response.Redirect("frmVideosView.aspx", false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #2
0
        public List <GM_VideosLoad> ObtenerDetalleVideoPagina(GM_VideosLoad Datos)
        {
            try
            {
                List <GM_VideosLoad> Lista = new List <GM_VideosLoad>();
                GM_VideosLoad        ItView;
                SqlDataReader        Dr = SqlHelper.ExecuteReader(Datos.Conexion, "RR_spCSLDB_get_VideosPagina");
                while (Dr.Read())
                {
                    ItView         = new GM_VideosLoad();
                    ItView.IDVideo = Dr.GetString(Dr.GetOrdinal("IDVideo"));
                    ItView.Url     = Dr.GetString(Dr.GetOrdinal("urlVideo"));
                    ItView.Link    = ItView.Url;
                    string[] tokens = ItView.Url.Split(new[] { "v=" }, StringSplitOptions.None);
                    ItView.Url         = "https://img.youtube.com/vi/" + tokens[1] + "/0.jpg";
                    ItView.Alt         = Dr.GetString(Dr.GetOrdinal("alt"));
                    ItView.Title       = Dr.GetString(Dr.GetOrdinal("title"));
                    ItView.Description = Dr.GetString(Dr.GetOrdinal("descripcion"));

                    Lista.Add(ItView);
                }
                return(Lista);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        public void CargaVideoXID(GM_VideosLoad Datos)
        {
            string id       = "";
            bool   espagina = true;

            try
            {
                object[] Parametros = { Datos.NuevoVideo, id, Datos.IDVideo, espagina, Datos.IDUsuario };
                object   Result     = SqlHelper.ExecuteScalar(Datos.Conexion, "RR_spCSLDB_AC_VideosPagina", Parametros);
                int      Resultado  = 0;
                int.TryParse(Result.ToString(), out Resultado);
                if (Resultado == 1)
                {
                    Datos.Completado = true;
                }
                else
                {
                    Datos.Completado = false;
                }
                Datos.Resultado = Resultado;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
 public void CargaVideoXID(GM_VideosLoad Datos)
 {
     try
     {
         RR_AdministradorWebDatos FD = new RR_AdministradorWebDatos();
         FD.CargaVideoXID(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #5
0
 public void OObtenerDetalleVideo(GM_VideosLoad Datos)
 {
     try
     {
         GM_VideoDatos CDV = new GM_VideoDatos();
         CDV.ObtenerDetalleVideo(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #6
0
 public void ACStatuVideo(GM_VideosLoad Datos)
 {
     try
     {
         GM_VideoDatos CD = new GM_VideoDatos();
         CD.AGModuloVideo(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #7
0
 public void EliminarSVideo(GM_VideosLoad Datos)
 {
     try
     {
         GM_VideoDatos CD = new GM_VideoDatos();
         CD.EliminarVideoID(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #8
0
 public List <GM_VideosLoad> ObtenerListStatusVideoPagina(GM_VideosLoad Datos)
 {
     try
     {
         GM_VideoDatos CD = new GM_VideoDatos();
         return(CD.ObtenerDetalleVideoPagina(Datos));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #9
0
 public void CargarDatos(GM_VideosLoad DatosAux)
 {
     try
     {
         hf.Value             = DatosAux.IDVideo.ToString();
         txtUrl.Value         = DatosAux.Url;
         txtAlt.Value         = DatosAux.Alt;
         txtTitle.Value       = (DatosAux.Title);
         txtDescription.Value = (DatosAux.Description);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #10
0
 public void CargarView()
 {
     try
     {
         GM_VideosLoad Datos = new GM_VideosLoad()
         {
             Conexion = Comun.Conexion
         };
         GM_VideoNegocio GV = new GM_VideoNegocio();
         Lista = GV.ObtenerListStatusVideoPagina(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3")
                {
                    ID = Request.QueryString["id"];
                    GM_VideosLoad DatosAux = new GM_VideosLoad {
                        Conexion = Comun.Conexion, IDVideo = ID, IDUsuario = Comun.IDUsuario
                    };
                    GM_VideoNegocio CN = new GM_VideoNegocio();
                    CN.EliminarSVideo(DatosAux);

                    if (DatosAux.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)
                {
                    //string ScripSucces = DialogMessage.Show(TipoMensaje.Success, "Los datos se han guardado.", "Correctamente", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true);
                    //ScriptManager.RegisterStartupScript(this, typeof(Type), "popup", ScripSucces, true);
                }
                else
                {
                }

                this.CargarView();
                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);
            }
        }
コード例 #12
0
 //Delete Video
 public void EliminarVideoID(GM_VideosLoad Datos)
 {
     try
     {
         object[] Parametros = { Datos.IDVideo, Datos.IDUsuario };
         object   Result     = SqlHelper.ExecuteScalar(Datos.Conexion, "GM_spCSLDB_del_ModuloVideo", Parametros);
         int      Resultado  = 0;
         int.TryParse(Result.ToString(), out Resultado);
         if (Resultado == 1)
         {
             Datos.Completado = true;
         }
         Datos.Resultado = Resultado;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #13
0
 //Agree Video
 public void AGModuloVideo(GM_VideosLoad Datos)
 {
     try
     {
         object[] Parametros = { Datos.NuevoVideo, Datos.IDVideo, Datos.Url, Datos.Alt, Datos.Title, Datos.Description, Datos.IDUsuario };
         Object   Result     = SqlHelper.ExecuteScalar(Datos.Conexion, "GM_spCSLDB_AC_ModuloVideo", Parametros);
         int      Resultado  = 0;
         int.TryParse(Result.ToString(), out Resultado);
         if (Resultado == 1)
         {
             Datos.Completado = true;
         }
         Datos.Resultado = Resultado;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #14
0
 //Edit Video
 public void ObternerTipoDetalleVideo(GM_VideosLoad Datos)
 {
     try
     {
         object[]      Parametros = { Datos.IDVideo };
         SqlDataReader Dr         = SqlHelper.ExecuteReader(Datos.Conexion, "GM_spCSLDB_get_VideosViewDetalle", Parametros);
         while (Dr.Read())
         {
             Datos.Url         = Dr.GetString(Dr.GetOrdinal("Url"));
             Datos.Alt         = Dr.GetString(Dr.GetOrdinal("alt"));
             Datos.Title       = Dr.GetString(Dr.GetOrdinal("title"));
             Datos.Description = Dr.GetString(Dr.GetOrdinal("descripcion"));
             Datos.Completado  = true;
             break;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #15
0
        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);
        }
コード例 #16
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)
                        {
                            ID = Request.QueryString["id"];
                            GM_VideosLoad DatosAux = new GM_VideosLoad {
                                Conexion = Comun.Conexion, IDVideo = ID
                            };
                            GM_VideoNegocio CN = new GM_VideoNegocio();
                            CN.ObtenerDetalleVideo(DatosAux);
                            if (DatosAux.Completado)
                            {
                                this.CargarDatos(DatosAux);
                            }
                            else
                            {
                                Response.Redirect("frmVideosLoad.aspx?errorMessage=" + DatosAux.Resultado);
                            }
                        }
                        else
                        {
                            Response.Redirect("frmVideosLoad.aspx?errorMessage=2");
                        }
                    }
                    else
                    {
                        Response.Redirect("frmVideosLoad.aspx?errorMessage=3");
                    }
                }
                else
                {
                    this.IniciarDatos();
                }
            }
            else
            {
                string txtUrl         = Request.Form["ctl00$cph_MasterBody$txtUrl"].ToString();
                string txtAlt         = Request.Form["ctl00$cph_MasterBody$txtAlt"].ToString();
                string txtTitle       = Request.Form["ctl00$cph_MasterBody$txtTitle"].ToString();
                string txtDescription = Request.Form["ctl00$cph_MasterBody$txtDescription"].ToString();
                string IDVideo        = "";
                try
                {
                    string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString();

                    IDVideo = AuxID;
                    bool NuevoRegistro = string.IsNullOrEmpty(IDVideo);
                    this.Guardar(NuevoRegistro, IDVideo, txtUrl, txtAlt, txtTitle, txtDescription);
                }
                catch (Exception ex)
                {
                    Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message);
                }
            }
        }