Ejemplo n.º 1
0
        private async Task ListarArquivosAsync(Arquivo diretorio)
        {
            SinalizarDiretorioCorrente(diretorio);

            IEnumerable <Arquivo> arquivosNoDiretorio = await _arquivoRepository.FindWhereParentEqualsAsync(diretorio.IdArquivo);

            MontarTabela(arquivosNoDiretorio);
        }
Ejemplo n.º 2
0
        public async static Task DeleteAsync(long id)
        {
            IArquivoRepository arquivoRepository = ArquivoRepositoryFactory.Create();

            if (!(await arquivoRepository.FindWhereParentEqualsAsync(id)).Any())
            {
                IFileManager fileManager = FileManagerFactory.Create();

                await fileManager.DeleteAsync(await arquivoRepository.FindByIdAsync(id));

                await arquivoRepository.DeleteAsync(id);
            }
            else
            {
                throw new ArgumentException("Diretório não pode ser excluído pois possui dependentes");
            }
        }
Ejemplo n.º 3
0
        protected async void Page_Load(object sender, EventArgs e)
        {
            long?idParent =
                !String.IsNullOrWhiteSpace(Request.Params["fkParent"])
                    ? Convert.ToInt64(Request.Params["fkParent"])
                    : (long?)null;

            IArquivoRepository arquivoRepository = ArquivoRepositoryFactory.Create();

            IEnumerable <Arquivo> arquivos = await arquivoRepository.FindWhereParentEqualsAsync(idParent);

            Response.Clear();
            Response.Write(new JavaScriptSerializer().Serialize(new
            {
                result = arquivos
            }));
            Response.End();
        }