Esempio n. 1
0
        /// <summary>
        /// Metodo com nome errado (repetido se renomear)
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="context"></param>
        /// <param name="columnsView"></param>
        /// <param name="tipo"></param>
        /// <param name="title"></param>
        /// <returns></returns>
        public static dynamic ShowDiaglogFindEntity <T>(DbContextIts context,
                                                        string[] columnsView, T tipo, string title = "Localizar:") where T : class
        {
            XFrmFindEntity xFrmFindEntity = initListaDinamica <T>(context, columnsView, title, tipo);

            xFrmFindEntity.ShowDialog();

            return(xFrmFindEntity.TEntity);
        }
Esempio n. 2
0
        public static dynamic ShowDiaglogFindEntity <T>(DbContextIts context,
                                                        string[] columnsView, T tipo, string xmlFile, string title = "Localizar:") where T : class
        {
            XFrmFindEntity xFrmFindEntity = initListaDinamica <T>(context, columnsView, title, tipo);

            if (xmlFile != null)
            {
                xFrmFindEntity.gridViewResults.RestoreLayoutFromXml(xmlFile, OptionsLayoutBase.FullLayout);
            }

            xFrmFindEntity.ShowDialog();

            return(xFrmFindEntity.TEntity);
        }
Esempio n. 3
0
        public static List <dynamic> ShowDialogFindListEntity <T>(DbContextIts context, string[] columnsView, T tipo,
                                                                  Stream layoutStream, string title = "Localizar:") where T : class
        {
            XFrmFindEntity xFrmFindEntity = initListaDinamica <T>(context, columnsView, title, tipo);

            xFrmFindEntity.gridViewResults.OptionsSelection.MultiSelect = true;

            if (layoutStream != null)
            {
                xFrmFindEntity.gridViewResults.RestoreLayoutFromStream(layoutStream, OptionsLayoutBase.FullLayout);
            }

            xFrmFindEntity.ShowDialog();

            return(xFrmFindEntity.gridViewResults.GetSelectedItens <dynamic>());
        }
Esempio n. 4
0
        /// <summary>
        /// Passar uma array de string com as colunas que deseja exibir
        /// </summary>
        /// <typeparam name="T">Entidade</typeparam>
        /// <param name="context">Contexto</param>
        /// <param name="columnsView">Array de colunas</param>
        /// <param name="title">Titulo da janela</param>
        /// <returns></returns>
        public static dynamic ShowDiaglogFindEntity <T>(DbContextIts context,
                                                        string[] columnsView, T tipo, Stream layoutStream, string title = "Localizar:", Delegate action = null) where T : class
        {
            XFrmFindEntity xFrmFindEntity = initListaDinamica <T>(context, columnsView, title, tipo);

            if (layoutStream != null)
            {
                xFrmFindEntity.gridViewResults.RestoreLayoutFromStream(layoutStream, OptionsLayoutBase.FullLayout);
            }

            xFrmFindEntity.ShowDialog();

            xFrmFindEntity.setDelegateActionPerfomed(action);

            return(xFrmFindEntity.TEntity);
        }
Esempio n. 5
0
        public static List <dynamic> ShowDialogFindListEntity <T>(List <T> lista, string xmlFile, string title = "Localizar:") where T : class
        {
            XFrmFindEntity xFrmFindEntity = new XFrmFindEntity();

            xFrmFindEntity.Text = title;
            xFrmFindEntity.gridControlResults.DataSource = lista;
            xFrmFindEntity.gridViewResults.OptionsSelection.MultiSelect = true;

            if (xmlFile != null)
            {
                xFrmFindEntity.gridViewResults.RestoreLayoutFromXml(xmlFile, OptionsLayoutBase.FullLayout);
            }

            xFrmFindEntity.ShowDialog();

            return(xFrmFindEntity.gridViewResults.GetSelectedItens <dynamic>());
        }
Esempio n. 6
0
        public static T ShowDialogFindTEntity <T>(DbContextIts ctx, Stream layoutStream) where T : class
        {
            XFrmFindEntity xFrmFindEntity = new XFrmFindEntity();
            var            x = new GenericContextIts <T>(ctx.NameOrConnectionString);

            xFrmFindEntity.gridControlResults.DataSource = x.Dao.FindAll();
            xFrmFindEntity.TEntity = xFrmFindEntity.gridViewResults.GetFocusedRow() as T;

            if (layoutStream != null)
            {
                xFrmFindEntity.gridViewResults.RestoreLayoutFromStream(layoutStream, OptionsLayoutBase.FullLayout);
            }

            xFrmFindEntity.ShowDialog();

            return(xFrmFindEntity.gridViewResults.GetFocusedRow <T>());
        }
Esempio n. 7
0
        //REVISADO EM 31/07/2017 - Gercy Campos, task 140
        /// <summary>
        /// Chama a tela de pesquisa de objetos. Montar os parametros através da classe ParamsFindEntity
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public static dynamic ShowDialogFindEntity <T>(ParamsFindEntity parameters) where T : class
        {
            XFrmFindEntity xFrmFindEntity = initListaDinamica <T>(
                context: parameters.Context,
                columnsView: parameters.Columns,
                orderBy: parameters.Order,
                whereConditions: parameters.WhereCondition,
                title: parameters.Title,
                tipo: parameters.DynamicObject);

            if (parameters.Layout != null)
            {
                xFrmFindEntity.gridViewResults.RestoreLayoutFromStream(parameters.Layout, OptionsLayoutBase.FullLayout);
            }


            xFrmFindEntity.ShowDialog();

            return(xFrmFindEntity.TEntity);
        }
Esempio n. 8
0
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="lista"></param>A lista a ser exibida no grid
        /// <param name="layoutStream"></param>Layout
        /// <param name="title"></param>Titulo
        /// <param name="action"></param>Ação a ser disparada pelo botão extra
        /// <returns></returns>A entidade selecionada no grid
        public static T ShowDiaglogFindEntityFromList <T>(List <T> lista, Stream layoutStream, string title = "Localizar:",
                                                          Delegate action = null) where T : class
        {
            XFrmFindEntity xFrmFindEntity = new XFrmFindEntity();

            xFrmFindEntity.gridControlResults.DataSource = lista;
            if (layoutStream != null)
            {
                xFrmFindEntity.gridViewResults.RestoreLayoutFromStream(layoutStream, OptionsLayoutBase.FullLayout);
            }

            xFrmFindEntity.ShowDialog();

            xFrmFindEntity.setDelegateActionPerfomed(action);

            if (xFrmFindEntity.IsCancel)
            {
                return(null);
            }

            return(xFrmFindEntity.gridViewResults.GetFocusedRow <T>());
        }