Exemple #1
0
 public void CargarView()
 {
     try
     {
         GM_VideosLoad Datos = new GM_VideosLoad()
         {
             Conexion = Comun.Conexion
         };
         GM_VideoNegocio GV = new GM_VideoNegocio();
         Lista = GV.ObtenerListStatusVideo(Datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        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);
        }