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; } }
protected string getTipoDocumento(Int32 _IdTipoDocumento) { try { TipoDocumentoDAL tdDAL = new TipoDocumentoDAL(); return(tdDAL.CarregarDadosPorIdTipoDocumento(_IdTipoDocumento).Nome); } catch (Exception) { throw; } }
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; } }
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; } }
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; } }
protected void Cadastrar(object sender, EventArgs e) { try { Documento d = new Documento(); 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); } 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; } }
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; } }