/// <summary>
 /// Carga los objetos acorde a su variable de sesion para mandarlo a la pantalla
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!ValidarConexionYUsuarioLogueado(sender))
     {
         return;
     }
     try
     {
         if (Session["UiListaSkusDisponiblesParaPromocionPorPrecioEspecial"] != null)
         {
             UiListaSkusDisponiblesParaPromocionPorPrecioEspecial.DataSource = Session["UiListaSkusDisponiblesParaPromocionPorPrecioEspecial"];
             UiListaSkusDisponiblesParaPromocionPorPrecioEspecial.DataBind();
         }
         if (Session["UiVistaSkusAsociadosPromoPorPrecioEspecial"] != null)
         {
             UiVistaSkusAsociadosPromoPorPrecioEspecial.DataSource = Session["UiVistaSkusAsociadosPromoPorPrecioEspecial"];
             UiVistaSkusAsociadosPromoPorPrecioEspecial.DataBind();
         }
         if (Session["UiVistaDePromocionesPorPrecioEspecial"] != null)
         {
             UiVistaDePromocionesPorPrecioEspecial.DataSource = Session["UiVistaDePromocionesPorPrecioEspecial"];
             UiVistaDePromocionesPorPrecioEspecial.DataBind();
         }
     }
     catch (Exception ex)
     {
         EstablecerError(ex.Message, sender);
     }
 }
        /// <summary>
        /// Callback para el mantenimiento de la vista de skus
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UiVistaSkusAsociadosADescuentoPorPrecioEspecial_OnCustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(sender))
            {
                return;
            }
            var opcion = e.Parameters.Split('|')[0];

            idPromocion = int.Parse(UiTxtCodigoDePromocionDeDescuentoPorPrecioEspecial.Value.ToString()) == 0 ? 0 : int.Parse(UiTxtCodigoDePromocionDeDescuentoPorPrecioEspecial.Value.ToString());


            var listaPromo = new List <DescuentosPorPrecioEspecial>();

            switch (opcion)
            {
            case "ObtenerDatosDePromoSelecionada":
                UsuarioDeseaObtenerSkusAsociadosAPromo?.Invoke(sender, new PromoArgumento {
                    Promo = new Promo {
                        PROMO_ID = int.Parse(UiTxtCodigoDePromocionDeDescuentoPorPrecioEspecial.Value.ToString())
                    }
                });
                break;

            case "EliminarTodosLosSkusAsociadosAPrecioEspecialPorEscala":
                if (idPromocion > 0)
                {
                    UsuarioDeseaEliminarTodosLosSkusDeLaPromo?.Invoke(sender,
                                                                      new PromoArgumento
                    {
                        Promo = new Promo
                        {
                            PROMO_ID = idPromocion
                        }
                    });
                }
                else
                {
                    EstablecerError(Enums.GetStringValue(ErrorEnPreciosEspeciales.SinPromoParaEliminar), sender);
                }
                break;

            case "ExpandirVistaDeSkusPrecioEspecial":
                UiVistaSkusAsociadosPromoPorPrecioEspecial.ExpandAll();
                break;

            case "ContraerVistaDeSkusPrecioEspecial":
                UiVistaSkusAsociadosPromoPorPrecioEspecial.CollapseAll();
                break;
            }
        }