Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();

                switch (Request.QueryString["act"])
                {
                case "exc":
                    TipoDocumento td = tdDAL.CarregarDadosPorIdTipoDocumento(Convert.ToInt32(Request.QueryString["idTpd"]));
                    tdDAL.Excluir(td);
                    Response.Write("<script language='JavaScript'>alert('O Tipo de Documento foi excluído com sucesso');location='ListarTiposDocumentos.aspx';</script>");
                    break;

                default:
                    break;
                }

                // LISTA OS TIPOS DE DOCUMENTOS //
                TiposDocumentos.DataSource = tdDAL.Listar();
                TiposDocumentos.DataBind();
                // FIM //
            }
            catch (Exception)
            { throw; }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    // PREENCHE OS PROCESSOS //
                    ProcessoDAL pDAL = new ProcessoDAL();
                    ddlProcesso.DataSource = pDAL.Listar();
                    ddlProcesso.DataBind();
                    ddlProcesso.Items.Insert(0, (new ListItem("", "0")));
                    // FIM //

                    // PREENCHE OS TIPOS DE DOCUMENTOS //
                    TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();
                    ddlTipoDocumento.DataSource = tdDAL.Listar();
                    ddlTipoDocumento.DataBind();
                    ddlTipoDocumento.Items.Insert(0, (new ListItem("", "0")));
                    // FIM //

                    divResultadoBusca.Visible = false;
                }
            }
            catch (Exception)
            { throw; }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    DocumentoDAL dDAL = new DocumentoDAL();
                    Documento    d    = dDAL.CarregarDadosPorIdDocumento(Convert.ToInt32(Request.QueryString["idDoc"]));

                    // PREENCHE OS TIPOS DE DOCUMENTOS //
                    TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();
                    ddlTipoDocumento.DataSource = tdDAL.Listar();
                    ddlTipoDocumento.DataBind();
                    ddlTipoDocumento.SelectedValue = d.TipoDocumento.IdTipoDocumento.ToString();
                    // FIM //

                    txtDescricao.Text    = d.Descricao;
                    txtNomePortador.Text = d.NomePortador;
                    txtRg.Text           = d.RG;
                    txtNumeroInss.Text   = d.NumeroINSS;
                    txtCpfCnpj.Text      = d.CPFCNPJ;
                    txtVigencia.Text     = d.Vigencia.ToString();

                    DateTime dtNula = new DateTime(0001, 1, 1);

                    if (d.VencimentoVigencia != dtNula)
                    {
                        txtVencimentoVigencia.Text = d.VencimentoVigencia.ToShortDateString();
                    }

                    if (d.DataEmissao != dtNula)
                    {
                        txtDataEmissao.Text = d.DataEmissao.ToShortDateString();
                    }

                    if (d.DataAssinatura != dtNula)
                    {
                        txtDataAssinatura.Text = d.DataAssinatura.ToShortDateString();
                    }

                    if (d.DataPagamentoRecebimento != dtNula)
                    {
                        txtDataPagamentoRecebimento.Text = d.DataPagamentoRecebimento.ToShortDateString();
                    }

                    txtNumeroParcelas.Text       = d.NumeroParcelas;
                    txtValorPrevistoParcela.Text = d.ValorPrevistoParcela;

                    if (d.Descarte != dtNula)
                    {
                        txtDescarte.Text = d.Descarte.ToShortDateString();
                    }
                }
            }
            catch (Exception)
            { throw; }
        }
Beispiel #4
0
        protected string getTipoDocumento(Int32 _IdTipoDocumento)
        {
            try
            {
                TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();

                return(tdDAL.CarregarDadosPorIdTipoDocumento(_IdTipoDocumento).Nome);
            }
            catch (Exception)
            { throw; }
        }
Beispiel #5
0
        protected string getTipoDocumento(Int32 _IdTipoDocumento)
        {
            try
            {
                TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();

                return(tdDAL.ObterDadosPorId(_IdTipoDocumento).DSTipoDocumento);
            }
            catch (Exception)
            { throw; }
        }
        public void PreencheDependencias(DocumentoAnexado anx)
        {
            using (var tipoDocBLL = new TipoDocumentoDAL())
            {
                var tipos = tipoDocBLL.ListarTodos();

                foreach (var t in tipos)
                {
                    var codTipo = Convert.ToInt32(t.CodTipoDocumento);
                    anx.TiposDocumento.Add(codTipo, t.NomTipo);
                }
            }
        }
Beispiel #7
0
        public DataTable sp_updt_tipoDocBLL(TipoDocumentoBO tipo)
        {
            DataTable dt = new DataTable();

            try
            {
                dt = new TipoDocumentoDAL().sp_updt_tipoDocDAL(tipo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Beispiel #8
0
        public string sp_sel_tipoDocIDBLL(int cod_tipo)
        {
            DataTable dt = new DataTable();

            try
            {
                dt = new TipoDocumentoDAL().sp_sel_tipoDocIDDAL(cod_tipo);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(dt.Rows[0].ItemArray[1].ToString());
        }
Beispiel #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!Page.IsPostBack)
         {
             // PREENCHE OS TIPOS DE DOCUMENTOS //
             TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();
             ddlTipoDocumento.DataSource = tdDAL.Listar();
             ddlTipoDocumento.DataBind();
             // FIM //
         }
     }
     catch (Exception)
     { throw; }
 }
Beispiel #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();
                    TipoDocumento    td    = tdDAL.CarregarDadosPorIdTipoDocumento(Convert.ToInt32(Request.QueryString["idTpd"]));

                    txtNome.Text          = td.Nome;
                    txtGuardaInterna.Text = td.GuardaInterna;
                    txtGuardaExterna.Text = td.GuardaExterna;
                }
            }
            catch (Exception)
            { throw; }
        }
Beispiel #11
0
        protected void Alterar(object sender, EventArgs e)
        {
            try
            {
                TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();
                TipoDocumento    td    = tdDAL.CarregarDadosPorIdTipoDocumento(Convert.ToInt32(Request.QueryString["idTpd"]));

                td.Nome          = txtNome.Text;
                td.GuardaInterna = txtGuardaInterna.Text;
                td.GuardaExterna = txtGuardaExterna.Text;

                tdDAL.Alterar(td);

                Response.Write("<script language='JavaScript'>alert('Tipo de Documento alterado com sucesso');window.parent.location='ListarTiposDocumentos.aspx';</script>");
            }
            catch (Exception)
            { throw; }
        }
Beispiel #12
0
        protected void Cadastrar(object sender, EventArgs e)
        {
            try
            {
                TipoDocumento td = new TipoDocumento();

                td.Nome          = txtNome.Text;
                td.GuardaInterna = txtGuardaInterna.Text;
                td.GuardaExterna = txtGuardaExterna.Text;

                TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();
                tdDAL.Cadastrar(td);

                Response.Write("<script language='JavaScript'>alert('Tipo de Documento cadastrado com sucesso');window.parent.location='ListarTiposDocumentos.aspx';</script>");
            }
            catch (Exception)
            { throw; }
        }
Beispiel #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                DocumentoDAL dDAL = new DocumentoDAL();

                switch (Request.QueryString["act"])
                {
                case "exc":
                    Documento d = dDAL.CarregarDadosPorIdDocumento(Convert.ToInt32(Request.QueryString["idDoc"]));
                    dDAL.Excluir(d);
                    Response.Write("<script language='JavaScript'>alert('O Documento foi excluído com sucesso');location='ListarDocumentos.aspx';</script>");
                    break;

                case "rcv":
                    dDAL.Receber(Convert.ToInt32(Request.QueryString["idDoc"]));
                    Response.Write("<script language='JavaScript'>alert('O Documento foi recebido com sucesso');location='ListarDocumentos.aspx';</script>");
                    break;

                default:
                    break;
                }

                if (!Page.IsPostBack)
                {
                    // PREENCHE OS TIPOS DE DOCUMENTOS //
                    TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();
                    ddlTipoDocumento.DataSource = tdDAL.Listar();
                    ddlTipoDocumento.DataBind();
                    if (Request.QueryString["idTpd"] == null)
                    {
                        ddlTipoDocumento.Items.Insert(0, (new ListItem("Selecione o tipo de documento", "")));
                    }
                    else
                    {
                        ddlTipoDocumento.SelectedValue = Request.QueryString["idTpd"];
                    }
                    // FIM //
                }
            }
            catch (Exception)
            { throw; }
        }
Beispiel #14
0
        protected string getTipoDocumentoLocalizacao(Int32 _IdDocumento, Int32 _IdTipoDocumento)
        {
            try
            {
                ArquivamentoInternoDAL aiDAL = new ArquivamentoInternoDAL();
                ArquivamentoInterno    ai    = aiDAL.CarregarDadosPorIdDocumento(_IdDocumento);

                TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();

                String strTipoDocumentoLocalizacao;

                strTipoDocumentoLocalizacao  = tdDAL.CarregarDadosPorIdTipoDocumento(_IdTipoDocumento).Nome + "<br />";
                strTipoDocumentoLocalizacao += "(Arquivo: <span class=\\\"text-red\\\"><b>" + ai.Arquivo + "</b></span> | Gaveta: <span class=\\\"text-red\\\"><b>" + ai.Gaveta + "</b></span> | Pasta: <span class=\\\"text-red\\\"><b>" + ai.Pasta + "</b></span>)";

                return(strTipoDocumentoLocalizacao);
            }
            catch (Exception)
            { throw; }
        }
 public TipoDocumentoBL()
 {
     this.tipoDocumentoDAL = new TipoDocumentoDAL();
 }
Beispiel #16
0
        protected void Alterar(object sender, EventArgs e)
        {
            try
            {
                DocumentoDAL dDAL = new DocumentoDAL();
                Documento    d    = dDAL.CarregarDadosPorIdDocumento(Convert.ToInt32(Request.QueryString["idDoc"]));

                TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();
                d.TipoDocumento = tdDAL.CarregarDadosPorIdTipoDocumento(Convert.ToInt32(ddlTipoDocumento.SelectedValue));

                d.Descricao    = txtDescricao.Text;
                d.NomePortador = txtNomePortador.Text;
                d.RG           = txtRg.Text;
                d.NumeroINSS   = txtNumeroInss.Text;
                d.CPFCNPJ      = txtCpfCnpj.Text;

                if (txtVigencia.Text == "")
                {
                    d.Vigencia = 0;
                }
                else
                {
                    d.Vigencia = Convert.ToInt32(txtVigencia.Text);
                }

                if (txtVencimentoVigencia.Text == "")
                {
                    d.VencimentoVigencia = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.VencimentoVigencia = Convert.ToDateTime(txtVencimentoVigencia.Text);
                }

                if (txtDataEmissao.Text == "")
                {
                    d.DataEmissao = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.DataEmissao = Convert.ToDateTime(txtDataEmissao.Text);
                }

                if (txtDataAssinatura.Text == "")
                {
                    d.DataAssinatura = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.DataAssinatura = Convert.ToDateTime(txtDataAssinatura.Text);
                }

                if (txtDataPagamentoRecebimento.Text == "")
                {
                    d.DataPagamentoRecebimento = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.DataPagamentoRecebimento = Convert.ToDateTime(txtDataPagamentoRecebimento.Text);
                }

                d.NumeroParcelas       = txtNumeroParcelas.Text;
                d.ValorPrevistoParcela = txtValorPrevistoParcela.Text;

                if (txtDescarte.Text == "")
                {
                    d.Descarte = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.Descarte = Convert.ToDateTime(txtDescarte.Text);
                }

                dDAL.Alterar(d);

                Response.Write("<script language='JavaScript'>alert('Documento alterado com sucesso');window.parent.location='ListarDocumentos.aspx';</script>");
            }
            catch (Exception)
            { throw; }
        }
Beispiel #17
0
        protected void Cadastrar(object sender, EventArgs e)
        {
            try
            {
                Documento d = new Documento();

                TipoDocumentoDAL tdDAL = new TipoDocumentoDAL();
                d.TipoDocumento = tdDAL.ObterDadosPorId(Convert.ToInt32(ddlTipoDocumento.SelectedValue));

                d.Descricao    = txtDescricao.Text;
                d.NomePortador = txtNomePortador.Text;
                d.RG           = txtRg.Text;
                d.NumeroINSS   = txtNumeroInss.Text;
                d.CPFCNPJ      = txtCpfCnpj.Text;

                if (txtVigencia.Text == "")
                {
                    d.Vigencia = 0;
                }
                else
                {
                    d.Vigencia = Convert.ToInt32(txtVigencia.Text);
                }

                if (txtVencimentoVigencia.Text == "")
                {
                    d.VencimentoVigencia = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.VencimentoVigencia = Convert.ToDateTime(txtVencimentoVigencia.Text);
                }

                if (txtDataEmissao.Text == "")
                {
                    d.DataEmissao = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.DataEmissao = Convert.ToDateTime(txtDataEmissao.Text);
                }

                if (txtDataAssinatura.Text == "")
                {
                    d.DataAssinatura = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.DataAssinatura = Convert.ToDateTime(txtDataAssinatura.Text);
                }

                d.DataCadastro = DateTime.Now;

                if (txtDescarte.Text == "")
                {
                    d.Descarte = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.Descarte = Convert.ToDateTime(txtDescarte.Text);
                }

                d.SetorAtual = Convert.ToInt32(Session["sesIdProcesso"]);
                d.Arquivado  = "0";
                d.AlertaVencimentoVigencia = "Não";

                if (txtDataPagamentoRecebimento.Text == "")
                {
                    d.DataPagamentoRecebimento = new DateTime(1900, 1, 1);
                }
                else
                {
                    d.DataPagamentoRecebimento = Convert.ToDateTime(txtDataPagamentoRecebimento.Text);
                }

                d.NumeroParcelas       = txtNumeroParcelas.Text;
                d.ValorPrevistoParcela = txtValorPrevistoParcela.Text;
                d.Arquivo = "-";
                d.Ativo   = "S";

                DocumentoDAL dDAL = new DocumentoDAL();
                dDAL.Cadastrar(d);

                //Documento dUltimo = dDAL.CarregarDadosUltimoCadastrado();

                Response.Write("<script language='JavaScript'>alert('Documento cadastrado com sucesso');window.parent.location='ListarDocumentos.aspx';</script>");
            }
            catch (Exception)
            { throw; }
        }