コード例 #1
0
ファイル: Solicitacao.cs プロジェクト: gilmartmd/sicadv3
        public Solicitacao()
        {
            this.DadosPrincipaisSolicitacao = new List<DadoPrincipalSolicitacao>() { new DadoPrincipalSolicitacao() };
            this.Caracteristicas = new List<CaracteristicaClienteSolicitacao>();
            this.Definicoes = new List<DefinicoesClienteSolicitacao>() { new DefinicoesClienteSolicitacao() };
            this.Contatos = new List<ContatoClienteSolicitacao>();
            this.EnderecosCobranca = new List<EnderecoCobrancaClienteSolicitacao>();
            this.EnderecosEntrega = new List<EnderecoEntregaClienteSolicitacao>();
            this.Referencias = new List<ReferenciaClienteSolicitacao>();
            this.Socios = new List<SocioEmpresaSolicitacao>();
            this.Integracoes = new List<IntegracaoSolicitacao>();
            this.Historicos = new List<HistoricoSolicitacao>();
            this.DocumentosAnexados = new List<DocumentoAnexado>();
            this.TiposAlteracao = new List<TipoAlteracao>();
            try
            {
                var ajaxGridFactory = new AjaxGridFactory();

                this.GridCaracteristicas = ajaxGridFactory.CreateAjaxGrid(this.Caracteristicas.AsQueryable(), 1, false);
                this.GridEnderecosCobranca = ajaxGridFactory.CreateAjaxGrid(this.EnderecosCobranca.AsQueryable(), 1, false);
                this.GridEnderecosEntrega = ajaxGridFactory.CreateAjaxGrid(this.EnderecosEntrega.AsQueryable(), 1, false);
                this.GridReferencias = ajaxGridFactory.CreateAjaxGrid(this.Referencias.AsQueryable(), 1, false);
                this.GridContatos = ajaxGridFactory.CreateAjaxGrid(this.Contatos.AsQueryable(), 1, false);
                this.GridAnexos = ajaxGridFactory.CreateAjaxGrid(this.DocumentosAnexados.AsQueryable(), 1, false);
                this.GridSocios = ajaxGridFactory.CreateAjaxGrid(this.Socios.AsQueryable(), 1, false);
                this.GridIntegracoes = ajaxGridFactory.CreateAjaxGrid(this.Integracoes.OrderByDescending(i => i.DatLog.Value).ToList().AsQueryable(), 1, false);
                this.GridTiposAlteracao = ajaxGridFactory.CreateAjaxGrid(this.TiposAlteracao.AsQueryable(), 1, false);
            }
            catch (Exception)
            {

            }
        }
コード例 #2
0
        public JsonResult AjaxHistory()
        {
            var vm = GetHistory();

            var ajaxGridFactory = new AjaxGridFactory();
            var grid            = ajaxGridFactory.CreateAjaxGrid(vm, 1, false);

            return(Json(new { Html = grid.ToJson("Partial/History", this), grid.HasItems }, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public AjaxGrid <T> GetAjaxGrid <T>(IOrderedQueryable <T> items, int?page) where T : class
        {
            var ajaxGridFactory = new AjaxGridFactory();
            int pageValue       = page.HasValue ? page.Value : 1;
            var grid            = ajaxGridFactory.CreateAjaxGrid(items, pageValue, page.HasValue);
            var castGrid        = (AjaxGrid <T>)grid;

            return(castGrid);
        }
コード例 #4
0
        public ParecerSolicitacao()
        {
            this.CodParecer = 0;
            this.Codusuapr = 0;
            this.Datpar = DateTime.Now;
            this.Txtpar = "";
            this.Codsitpar = 0;
            this.Codperusu = 0;
            this.Codhistsol = 0;
            this.DadosPrincipaisAprovacao = new List<DadoPrincipalAprovacao>();
            this.CaracteristicasAprovacao = new List<CaracteristicaClienteAprovacao>();
            this.DefinicoesAprovacao = new List<DefinicoesClienteAprovacao>();
            this.EnderecosCobrancaAprovacao = new List<EnderecoCobrancaClienteAprovacao>();
            this.EnderecosEntregaAprovacao = new List<EnderecoEntregaClienteAprovacao>();
            this.ReferenciasAprovacao = new List<ReferenciaClienteAprovacao>();
            this.ContatosAprovacao = new List<ContatoClienteAprovacao>();
            this.DocumentosAnexadosAprovacao = new List<DocumentoAnexadoAprovacao>();
            this.SociosAprovacao = new List<SocioEmpresaAprovacao>();
            try
            {

                var ajaxGridFactory = new AjaxGridFactory();

                this.GridDadosPrincipaisAprovacao = ajaxGridFactory.CreateAjaxGrid(this.DadosPrincipaisAprovacao.AsQueryable(), 1, false);
                this.GridCaracteristicasAprovacao = ajaxGridFactory.CreateAjaxGrid(this.CaracteristicasAprovacao.AsQueryable(), 1, false);
                this.GridDefinicoesAprovacao = ajaxGridFactory.CreateAjaxGrid(this.DefinicoesAprovacao.AsQueryable(), 1, false);
                this.GridEnderecosCobrancaAprovacao = ajaxGridFactory.CreateAjaxGrid(this.EnderecosCobrancaAprovacao.AsQueryable(), 1, false);
                this.GridEnderecosEntregaAprovacao = ajaxGridFactory.CreateAjaxGrid(this.EnderecosEntregaAprovacao.AsQueryable(), 1, false);
                this.GridReferenciasAprovacao = ajaxGridFactory.CreateAjaxGrid(this.ReferenciasAprovacao.AsQueryable(), 1, false);
                this.GridContatosAprovacao = ajaxGridFactory.CreateAjaxGrid(this.ContatosAprovacao.AsQueryable(), 1, false);
                this.GridDocumentosAprovacao = ajaxGridFactory.CreateAjaxGrid(this.DocumentosAnexadosAprovacao.AsQueryable(), 1, false);
                this.GridSociosAprovacao = ajaxGridFactory.CreateAjaxGrid(this.SociosAprovacao.AsQueryable(), 1, false);

            }
            catch (Exception)
            {

            }
        }
コード例 #5
0
        public JsonResult GridSociosPaginado(int? page)
        {
            var s = Session["Solicitacao"] as Solicitacao;

            var vm = s.Socios.AsQueryable();
            var ajaxGridFactory = new AjaxGridFactory();
            var grid = ajaxGridFactory.CreateAjaxGrid(vm, page.HasValue ? page.Value : 1, false);

            return Json(new { Html = grid.ToJson("_GridSocios", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
        }
コード例 #6
0
        public JsonResult GridReferencias()
        {
            var s = Session["Solicitacao"] as Solicitacao;

            var vm = s.Referencias.AsQueryable();
            var ajaxGridFactory = new AjaxGridFactory();
            var grid = ajaxGridFactory.CreateAjaxGrid(vm, 1, false);

            return Json(new { Html = grid.ToJson("_GridRef", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
        }
コード例 #7
0
        public JsonResult GridCaracteristicasPaginado(int? page)
        {
            using (var bll = new CaracteristicaSapiensBLL())
            {
                var s = Session["Solicitacao"] as Solicitacao;

                foreach (var c in s.Caracteristicas)
                {
                    bll.ObterNomes(c);
                }
                var vm = s.Caracteristicas.AsQueryable();
                var ajaxGridFactory = new AjaxGridFactory();
                var grid = ajaxGridFactory.CreateAjaxGrid(vm, page.HasValue ? page.Value : 1, false);

                return Json(new { Html = grid.ToJson("_GridCaracteristicas", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
            }
        }
コード例 #8
0
ファイル: SabNzbdController.cs プロジェクト: NZBDash/NZBDash
        public JsonResult AjaxHistory()
        {
            var vm = GetHistory();

            var ajaxGridFactory = new AjaxGridFactory();
            var grid = ajaxGridFactory.CreateAjaxGrid(vm, 1, false);

            return Json(new { Html = grid.ToJson("Partial/History", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
        }
コード例 #9
0
ファイル: SolicitacaoBLL.cs プロジェクト: gilmartmd/sicadv3
        /// <summary>
        /// Busca as dependencias dos relacionamentos. EX: as caracteristicas da solicitacao e as caracteristicas para as dropdowns
        /// </summary>
        /// <param name="chavePrimaria"></param>
        /// <returns></returns>
        public override Solicitacao ObterPorCodigo(int chavePrimaria)
        {
            try
            {
                var sol = base.ObterPorCodigo(chavePrimaria);

                //sol.CodCliente = sol.DadosPrincipaisSolicitacao.Last().CodClienteDadoPrincipalSol;

                using (var dadoBLL = new DadoPrincipalSolicitacaoBLL())
                {
                    var dadoPrincipalBLL = new DadoPrincipalAprovacaoBLL();
                    var definicoesBLL = new DefinicoesClienteAprovacaoBLL();
                    var carBLL = new CaracteristicaSapiensBLL();

                    dadoBLL.PreencheDependencias(sol.DadosPrincipaisSolicitacao.Last());

                    foreach (var c  in sol.Caracteristicas)
                    {
                        carBLL.ObterNomes(c);
                    }
                }

                sol.Definicoes = sol.Definicoes.Count > 0 ? sol.Definicoes : new List<DefinicoesClienteSolicitacao>() { new DefinicoesClienteSolicitacao() };

                sol.EnderecosCobranca = sol.EnderecosCobranca.Count > 0 ? sol.EnderecosCobranca : new List<EnderecoCobrancaClienteSolicitacao>();
                sol.EnderecosEntrega = sol.EnderecosEntrega.Count > 0 ? sol.EnderecosEntrega : new List<EnderecoEntregaClienteSolicitacao>();
                sol.Referencias = sol.Referencias.Count > 0 ? sol.Referencias : new List<ReferenciaClienteSolicitacao>();
                sol.Contatos = sol.Contatos.Count > 0 ? sol.Contatos : new List<ContatoClienteSolicitacao>();
                sol.DocumentosAnexados = sol.DocumentosAnexados.OrderBy(c => c.CodTipoDocumento).ToList();

                //foreach (var d in sol.DocumentosAnexados)
                //{
                //    switch (d.CodTipoDocumento)
                //    {
                //        case 1: d.TipoDocumento = "Serasa"; break;
                //        case 2: d.TipoDocumento = "Contrato Social"; break;
                //        case 3: d.TipoDocumento = "Arquivos Limite/Prazo"; break;
                //        case 4: d.TipoDocumento = "Arquivos Ativação/Inativação"; break;
                //        case 5: d.TipoDocumento = "Contrato de Desconto"; break;
                //        case 6: d.TipoDocumento = "Comercial 4"; break;
                //    }
                //}

                sol.Socios = sol.Socios.Count > 0 ? sol.Socios : new List<SocioEmpresaSolicitacao>() { /*new SocioEmpresaSolicitacao()*/ };

                var ajaxGridFactory = new AjaxGridFactory();

                sol.GridCaracteristicas = ajaxGridFactory.CreateAjaxGrid(sol.Caracteristicas.AsQueryable(), 1, false);
                sol.GridEnderecosCobranca = ajaxGridFactory.CreateAjaxGrid(sol.EnderecosCobranca.AsQueryable(), 1, false);
                sol.GridEnderecosEntrega = ajaxGridFactory.CreateAjaxGrid(sol.EnderecosEntrega.AsQueryable(), 1, false);
                sol.GridReferencias = ajaxGridFactory.CreateAjaxGrid(sol.Referencias.AsQueryable(), 1, false);
                sol.GridContatos = ajaxGridFactory.CreateAjaxGrid(sol.Contatos.AsQueryable(), 1, false);
                sol.GridAnexos = ajaxGridFactory.CreateAjaxGrid(sol.DocumentosAnexados.AsQueryable(), 1, false);
                sol.GridSocios = ajaxGridFactory.CreateAjaxGrid(sol.Socios.AsQueryable(), 1, false);
                sol.GridIntegracoes = ajaxGridFactory.CreateAjaxGrid(sol.Integracoes.AsQueryable(), 1, false);

                return sol;
            }
            catch (Exception ex)
            {
               throw ex;
            }
        }
コード例 #10
0
        public JsonResult GridSociosPaginado(int? page)
        {
            var p = Session["Parecer"] as ParecerSolicitacao;
            if (p == null)
            {
                var s = Session["Solicitacao"] as Solicitacao;
                p = s.PareceresSolicitacao.Last();
            }
            var vm = p.SociosAprovacao.Count == 0 ? new List<SocioEmpresaAprovacao>().AsQueryable() : p.SociosAprovacao.AsQueryable();
            var ajaxGridFactory = new AjaxGridFactory();
            var grid = ajaxGridFactory.CreateAjaxGrid(vm, page.HasValue ? page.Value : 1, false);

            return Json(new { Html = grid.ToJson("_GridSociosApr", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
        }
コード例 #11
0
        public JsonResult GridReferencias()
        {
            var p = Session["Parecer"] as ParecerSolicitacao;
            if (p == null)
            {
                var s = Session["Solicitacao"] as Solicitacao;
                p = s.PareceresSolicitacao.Last();
            }
            var vm = p.ReferenciasAprovacao.Count == 0 ? new List<ReferenciaClienteAprovacao>().AsQueryable() : p.ReferenciasAprovacao.AsQueryable();
            var ajaxGridFactory = new AjaxGridFactory();
            var grid = ajaxGridFactory.CreateAjaxGrid(vm, 1, false);

            return Json(new { Html = grid.ToJson("_GridReferenciasApr", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
        }
コード例 #12
0
        public JsonResult GridIntegracaoPaginado(int? page)
        {
            using (var bll = new IntegracaoSolicitacaoBLL())
            {
                var p = Session["Parecer"] as ParecerSolicitacao;
                var codSol = p.Solicitacao.Codigo;

                //var vm = bll.ListarTodos().Where(i => i.Solicitacao.Codigo == codSol).AsQueryable();
                var vm = p.Solicitacao.Integracoes.AsQueryable();

                foreach (var v in vm)
                {
                    if (v.CodSecao.HasValue)
                    {
                        v.Secao = v.CodSecao.Value == 1 ? "Dados Principais" :
                            v.CodSecao.Value == 2 ? "Características" :
                            v.CodSecao.Value == 3 ? "Definições" :
                            v.CodSecao.Value == 4 ? "Endereço de Cobrança" :
                            v.CodSecao.Value == 5 ? "Endereço de Entrega" :
                            v.CodSecao.Value == 6 ? "Referências" :
                            v.CodSecao.Value == 7 ? "Contatos" :
                            v.CodSecao.Value == 8 ? "Anexos" :
                            v.CodSecao.Value == 9 ? "Sócios" : "";
                    }

                    if (v.CodSituacaoIntegracao.HasValue)
                    {
                        v.SituacaoIntegracao = v.CodSituacaoIntegracao.Value == 1 ? "Comando Enviado" :
                            v.CodSituacaoIntegracao.Value == 2 ? "OK" :
                            v.CodSituacaoIntegracao.Value == 3 ? "Erro" : "";
                    }
                }

                var ajaxGridFactory = new AjaxGridFactory();
                var grid = ajaxGridFactory.CreateAjaxGrid(vm.OrderByDescending(v => v.DatLog.Value).ToList().AsQueryable(), page.HasValue ? page.Value : 1, false);

                return Json(new { Html = grid.ToJson("_GridIntegracao", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
            }
        }
コード例 #13
0
        public JsonResult GridCaracteristicasPaginado(int? page)
        {
            using (var bll = new CaracteristicaSapiensBLL())
            {
                var p = Session["Parecer"] as ParecerSolicitacao;

                if (p == null)
                {
                    var s = Session["Solicitacao"] as Solicitacao;
                    p = s.PareceresSolicitacao.Last();
                }

                foreach (var c in p.CaracteristicasAprovacao)
                {
                    bll.ObterNomes(c);
                }
                var vm = p.CaracteristicasAprovacao.Count == 0 ? new List<CaracteristicaClienteAprovacao>().AsQueryable() : p.CaracteristicasAprovacao.AsQueryable();
                var ajaxGridFactory = new AjaxGridFactory();
                var grid = ajaxGridFactory.CreateAjaxGrid(vm, page.HasValue ? page.Value : 1, false);

                return Json(new { Html = grid.ToJson("_GridCaracteristicasApr", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
            }
        }
コード例 #14
0
        public JsonResult GridAnexos()
        {
            var p = Session["Parecer"] as ParecerSolicitacao;
            if (p == null)
            {
                var s = Session["Solicitacao"] as Solicitacao;
                p = s.PareceresSolicitacao.Last();
            }

            var vm = p.DocumentosAnexadosAprovacao.AsQueryable();
            var ajaxGridFactory = new AjaxGridFactory();
            var grid = ajaxGridFactory.CreateAjaxGrid(vm, 1, false);

            return Json(new { Html = grid.ToJson("_gridAnexosApr", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
        }