/// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        protected void UiVistaDeInformacionDeOrdenesDeVenta_OnCommandButtonInitialize(object sender, ASPxGridViewCommandButtonEventArgs e)
        {
            try
            {
                if (Session["UiVistaDeInformacionDeOrdenesDeVenta"] == null)
                {
                    return;
                }

                if (e.VisibleIndex < 0 || ((IList <OrdenDeVentaConDetalle>)Session["UiVistaDeInformacionDeOrdenesDeVenta"]).Count == 0)
                {
                    return;
                }
                if (e.ButtonType != ColumnCommandButtonType.SelectCheckbox)
                {
                    return;
                }
                if (UiVistaDeInformacionDeOrdenesDeVenta.GetRowValues(e.VisibleIndex, "IS_POSTED").ToString() != Enums.GetStringValue(OrdenDeVenta.Posteada))
                {
                    return;
                }
                e.Visible = false;
                e.Enabled = false;
            }
            catch (Exception ex)
            {
                EstablecerError(ex.Message, sender);
            }
        }
        /// <summary>
        /// UiVistaDeInformacionDeOrdenesDeVenta_OnCustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UiVistaDeInformacionDeOrdenesDeVenta_OnCustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            try
            {
                switch (e.Parameters.Split('|')[0])
                {
                case "ObtenerOrdenesDeVentaDeRutaSolicitada":
                    UsuarioDeseaObtenerOrdenesDeVentaConDetalle?.Invoke(sender, new OrdenDeVentaArgumento
                    {
                        Ruta = e.Parameters.Split('|')[1]
                    });
                    break;

                case "ExpandirGruposDeUiVistaDeInformacionDeOrdenesDeVenta":
                    UiVistaDeInformacionDeOrdenesDeVenta.ExpandAll();
                    break;

                case "ContraerGruposDeUiVistaDeInformacionDeOrdenesDeVenta":
                    UiVistaDeInformacionDeOrdenesDeVenta.CollapseAll();
                    break;

                case "MarcarRegistrosSeleccionadosComoPosteadosYValidados":
                    var listaDeOrdenesAActualizar = UiVistaDeInformacionDeOrdenesDeVenta.GetSelectedFieldValues("ORDER_ID", "DOC_SERIE", "DOC_NUM");
                    var listaFiltrada             = (from object[] item in listaDeOrdenesAActualizar
                                                     select new OrdenDeVentaConDetalle
                    {
                        DOC_SERIE = item[1].ToString(),
                        DOC_NUM = int.Parse(item[2].ToString())
                    }).GroupBy(orden => new { orden.DOC_SERIE, orden.DOC_NUM })
                                                    .Select(ordenFiltrada => ordenFiltrada.FirstOrDefault())
                                                    .ToList();
                    if (listaFiltrada.Count == 0)
                    {
                        return;
                    }
                    TerminoProceso("cpMarcarOrdenesDeVentaComoPosteadasYValidadasEnBo", listaFiltrada, UiVistaDeInformacionDeOrdenesDeVenta);
                    break;
                }
            }
            catch (Exception exception)
            {
                EstablecerError(exception.Message, sender);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["connectionString"] == null || Session["USER"] == null)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Logoff", "LogOff();", true);
                return;
            }

            if (Session["UiVistaDeInformacionDeOrdenesDeVenta"] != null)
            {
                UiVistaDeInformacionDeOrdenesDeVenta.DataSource = Session["UiVistaDeInformacionDeOrdenesDeVenta"];
                UiVistaDeInformacionDeOrdenesDeVenta.DataBind();
            }

            if (Session["UiListaDeRutas"] != null)
            {
                UiListaDeRutas.DataSource = Session["UiListaDeRutas"];
                UiListaDeRutas.DataBind();
            }
        }