Beispiel #1
0
        private void UiListaVistaBodegas_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
        {
            if (e.ControllerRow >= 0)
            {
                var documento = (Bodega)UiListaVistaBodegas.GetRow(e.ControllerRow);
                documento.IS_SELECTED = (e.Action == CollectionChangeAction.Add);
            }
            else
            {
                if (UsuarioSeleccionoListaBodegasCompleta)
                {
                    for (var i = 0; i < UiListaVistaBodegas.RowCount; i++)
                    {
                        var documento = (Bodega)UiListaVistaBodegas.GetRow(i);
                        if (documento == null)
                        {
                            continue;
                        }
                        documento.IS_SELECTED = (UiListaVistaBodegas.SelectedRowsCount != 0);
                    }
                    UsuarioSeleccionoListaBodegasCompleta = false;
                }
            }

            var edit = ActiveControl as DevExpress.XtraEditors.SearchLookUpEdit;

            if (edit == null)
            {
                return;
            }
            edit.Text = ObtenerTextoAMostrarListaBodegas();
        }
 private void UiListaVistaBodegas_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiListaVistaBodegas.RowCount; i++)
     {
         var documento = (Bodega)UiListaVistaBodegas.GetRow(i);
         if (documento == null)
         {
             continue;
         }
         if (documento.IS_SELECTED)
         {
             UiListaVistaBodegas.SelectRow(i);
         }
     }
 }
        private void UiListaVistaBodegas_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
        {
            if (e.ControllerRow >= 0)
            {
                var documento = (Bodega)UiListaVistaBodegas.GetRow(e.ControllerRow);
                documento.IS_SELECTED = (e.Action == CollectionChangeAction.Add);
            }
            else
            {
                if (UsuarioSeleccionoListaBodegasCompleta)
                {
                    for (var i = 0; i < UiListaVistaBodegas.RowCount; i++)
                    {
                        var documento = (Bodega)UiListaVistaBodegas.GetRow(i);
                        if (documento == null)
                        {
                            continue;
                        }
                        documento.IS_SELECTED = (UiListaVistaBodegas.SelectedRowsCount != 0);
                    }
                    UsuarioSeleccionoListaBodegasCompleta = false;
                }
            }

            var edit = ActiveControl as DevExpress.XtraEditors.SearchLookUpEdit;

            if (edit == null)
            {
                return;
            }
            edit.Text = ObtenerTextoAMostrarListaBodegas();

            //List<Usuario> usuarios = new List<Usuario>();
            //foreach (var bodega in Bodegas.Where(x => x.IS_SELECTED))
            //{
            //    usuarios.AddRange(Usuarios.Where(x => x.LOGIN_ID == bodega.ASSIGNED_TO).ToList());
            //}
            //Usuarios = usuarios;
        }