private void CarregaDadosPartic() { ParticipanteBLL bll_p = new ParticipanteBLL(); PARTICIPANTE part = bll_p.GetParticipanteBy(Util.String2Short(txtCodEmpresa.Text) ?? 0, Util.String2Int32(txtMatricula.Text) ?? 0, Util.String2Int32(hidNUM_IDNTF_RPTANT.Value) ?? 0, true); if (part != null) { if (String.IsNullOrEmpty(txtDigito.Text)) { txtDigito.Text = part.NUM_DIGVR_EMPRG.ToString(); } if (String.IsNullOrEmpty(txtCpf.Text)) { txtCpf.Text = part.NUM_CPF_EMPRG.ToString(); } if (String.IsNullOrEmpty(txtNome.Text)) { txtNome.Text = part.NOM_EMPRG.ToUpper(); } if (String.IsNullOrEmpty(lblEnd1.Text) || String.IsNullOrEmpty(lblEnd2.Text)) { lblEnd1.Text = part.DCR_ENDER_EMPRG.Trim() + ", " + part.NUM_ENDER_EMPRG; lblEnd2.Text = part.COD_CEP_EMPRG + " " + part.NOM_BAIRRO_EMPRG.Trim() + " " + part.NOM_CIDRS_EMPRG + "-" + part.COD_UNDFD_EMPRG; } //if (String.IsNullOrEmpty(lblEnd2.Text)) //{ // lblEnd2.Text = part.COD_CEP_EMPRG + " " + part.NOM_BAIRRO_EMPRG + " " + part.NOM_CIDRS_EMPRG + "-" + part.COD_UNDFD_EMPRG; //} } }
protected void cancelarLinkButton_Click(object sender, EventArgs e) { var eventoID = ((LinkButton)sender).CommandArgument; Usuario usuario = (Usuario)Session["Usuario"]; ParticipanteBLL.CancelarParticipacao(int.Parse(eventoID), usuario.Usuario_ID); CarregarRepeaters(); }
protected void participarLinkButton_Click(object sender, EventArgs e) { var eventoID = ((LinkButton)sender).CommandArgument; Usuario usuario = (Usuario)Session["Usuario"]; Participante participante = new Participante(); participante.mEvento = int.Parse(eventoID); participante.mUsuario = usuario.Usuario_ID; participante.DataParticipacao = DateTime.Now; ParticipanteBLL.InserirParticipante(participante); CarregarRepeaters(); }
private void CarregarEventosParticipando(int usuario_id) { IEnumerable <Participante> participantes = ParticipanteBLL.ListarParticipacoes(usuario_id); if (participantes.Count() > 0) { eventosParticipandoRepeater.DataSource = EventoBLL.ListarEventosParticipando(participantes); eventosParticipandoRepeater.DataBind(); } else { eventosParticipandoRepeater.DataSource = null; eventosParticipandoRepeater.DataBind(); } }
//Inicio do código fonte excluir participante private void menuClienteExcluir_Click(object sender, EventArgs e) { var result = MessageBox.Show("Deseja realmente excluir o registro? ", "Excluir Participante", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == System.Windows.Forms.DialogResult.Yes) { ParticipanteModelo modParticipante = new ParticipanteModelo(); ParticipanteBLL bllParticipante = new ParticipanteBLL(); modParticipante.idParticipante = Convert.ToInt32(textBoxCodigo.Text); bllParticipante.excluir(modParticipante); botaoClicado = "EXCLUIR"; inativaAtivaCamposBotoes(); } }
protected void Page_Load(object sender, EventArgs e) { string COD_EMPRS = Request.QueryString["nEmpr"]; string NUM_RGTRO_EMPRG = Request.QueryString["nReg"]; string NUM_DIVR_EMPRG = Request.QueryString["nDigReg"]; string NUM_IDNTF_RPTANT = Request.QueryString["nrepr"]; //string NUM_DEPEND = Request.QueryString["ndep"]; string NOM_EMPR = Request.QueryString["cPart"]; string End1 = Request.QueryString["cEnd1"]; string End2 = Request.QueryString["cEnd2"]; string COD_TIPO_BOLETO = Request.QueryString["nIdBol"]; string PARTICIPANTEEMAIL = Request.QueryString["ParticipanteEmail"]; ScriptManager.RegisterStartupScript(UpdatePanel, UpdatePanel.GetType(), "script", "_client_side_script()", true); Page.Form.DefaultButton = btnPesquisar.UniqueID; lblMensagem.Visible = false; lblMensagemNovo.Visible = false; if (!IsPostBack) { grdBoleto.Sort("DT_PROCESSAMENTO", SortDirection.Ascending); CarregarDropDown(); if (!String.IsNullOrEmpty(COD_EMPRS) && !String.IsNullOrEmpty(NUM_RGTRO_EMPRG)) { ParticipanteBLL bll_p = new ParticipanteBLL(); PARTICIPANTE part = bll_p.GetParticipanteBy(Util.String2Short(COD_EMPRS) ?? 0, Util.String2Int32(NUM_RGTRO_EMPRG) ?? 0, Util.String2Int32(NUM_IDNTF_RPTANT) ?? 0, true); txtPesqCodEmpresa.Text = COD_EMPRS; txtPesqMatricula.Text = NUM_RGTRO_EMPRG; txtPesqNome.Text = NOM_EMPR; hidPesqNUM_IDNTF_RPTANT.Value = NUM_IDNTF_RPTANT; ddlPesqTipoBoleto.SelectedValue = COD_TIPO_BOLETO; if (part != null) { txtPesqDigito.Text = part.NUM_DIGVR_EMPRG.ToString(); txtPesqCpf.Text = part.NUM_CPF_EMPRG.ToString(); txtEMail.Text = part.COD_EMAIL_EMPRG; lblPesqEnd1.Text = part.DCR_ENDER_EMPRG + ", " + part.NUM_ENDER_EMPRG; lblPesqEnd2.Text = part.COD_CEP_EMPRG + " " + part.NOM_BAIRRO_EMPRG + " " + part.NOM_CIDRS_EMPRG + "-" + part.COD_UNDFD_EMPRG; } if (!String.IsNullOrEmpty(PARTICIPANTEEMAIL) && PARTICIPANTEEMAIL != "undefined") { txtEMail.Text = PARTICIPANTEEMAIL; } if (!String.IsNullOrEmpty(NUM_DIVR_EMPRG) && End2 != "undefined") { txtPesqDigito.Text = NUM_DIVR_EMPRG; } if (!String.IsNullOrEmpty(End1) && End1 != "undefined") { lblPesqEnd1.Text = End1; } if (!String.IsNullOrEmpty(End2) && End2 != "undefined") { lblPesqEnd2.Text = End2; } BoletoBLL bll = new BoletoBLL(); AAT_TBL_BOLETO_TIPO BOLETO_TIPO = bll.GetBoletoTipo(Util.String2Short(COD_TIPO_BOLETO) ?? 0); if (BOLETO_TIPO != null) { txtInstrucoes.Text = BOLETO_TIPO.DCR_OBSERVACAO; } //ReportCrystal.Visible = false; //txtCodEmpresa.Text = COD_EMPRS; //txtMatricula.Text = NUM_RGTRO_EMPRG; //txtDigito.Text = NUM_DIVR_EMPRG; //txtCpf.Text = part.NUM_CPF_EMPRG.ToString(); //txtNome.Text = NOM_EMPR; //ddlTipoBoleto.SelectedValue = COD_TIPO_BOLETO; //lblEnd1.Text = End1; //lblEnd2.Text = End2; //if (ValidarCampos()) //{ //txtEMail.Enabled = true; //btnEmail.Enabled = true; //} } } }
public void buscarParticipantePorCodigo() { ParticipanteModelo modParticipante = new ParticipanteModelo(); ParticipanteBLL bllParticipante = new ParticipanteBLL(); try { modParticipante.idParticipante = Convert.ToInt32(textBoxCodigo.Text); bllParticipante.buscarParticipantePorID(modParticipante); if (modParticipante.nomeParticipante == null) { MessageBox.Show("Participante não encontrado!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); botaoClicado = "CANCELAR"; inativaAtivaCamposBotoes(); } string nomeFantasia = modParticipante.nomeParticipante; string cpfCnpj = modParticipante.cpfcnpjParticipante; string rg = modParticipante.rgieParticipante; string endereco = modParticipante.enderecoParticipante; string numero = modParticipante.numeroEnderecoParticipante; string bairro = modParticipante.bairoParticipante; string cidade = modParticipante.cidadeParticipante; string uf = modParticipante.ufParticipante; string cep = modParticipante.cepParticipante; string telefone = modParticipante.telefoneParticipante; string celular = modParticipante.celularParticipante; string email = modParticipante.emailParticipante; string razaoapelido = modParticipante.razaosocialapelidoParticipante; string datacad = modParticipante.dataCadastroParticipante; string dataalt = modParticipante.dataAlteracaoParticipante; string usuariocad = modParticipante.usuarioCadastroParticipante; string usuarioalt = modParticipante.usuarioAlteracaoParticipante; bool ativo = modParticipante.ativoParticipante; bool cli = modParticipante.tipoclienteParticipante; bool forne = modParticipante.tipofornecedorParticipante; bool funci = modParticipante.tipofuncionarioParticipante; textBoxNome.Text = nomeFantasia; textBoxCpfCnpj.Text = cpfCnpj; textBoxRgIe.Text = rg; textBoxEndereco.Text = endereco; textBoxNumero.Text = numero; textBoxBairro.Text = bairro; textBoxCidade.Text = cidade; comboBoxUF.SelectedIndex = comboBoxUF.FindStringExact(uf); textBoxCep.Text = cep; textBoxTelefone.Text = telefone; textBoxCelular.Text = celular; textBoxEmail.Text = email; textBoxRazaoSocialApelido.Text = razaoapelido; textBoxDataCadastro.Text = datacad; textBoxDataAlteracao.Text = dataalt; textBoxUsuarioCadastro.Text = usuariocad; textBoxUsuarioAlteracao.Text = usuarioalt; if (ativo == true) { checkBoxAtivo.Checked = true; } else { checkBoxAtivo.Checked = false; } if (cli == true) { checkBoxCliente.Checked = true; } else { checkBoxCliente.Checked = false; } if (forne == true) { checkBoxFornecedor.Checked = true; } else { checkBoxFornecedor.Checked = false; } if (funci == true) { checkBoxFuncionario.Checked = true; } else { checkBoxFuncionario.Checked = false; } } catch (Exception erro) { throw new Exception("Erro ao buscar o participante pelo código, form participante! " + erro.Message); } }
private void salvar(ParticipanteModelo modParticipante) { if (flag == 0) { ParticipanteBLL participanteBLL = new ParticipanteBLL(); modParticipante.nomeParticipante = textBoxNome.Text; modParticipante.cpfcnpjParticipante = textBoxCpfCnpj.Text; modParticipante.rgieParticipante = textBoxRgIe.Text; modParticipante.enderecoParticipante = textBoxEndereco.Text; modParticipante.numeroEnderecoParticipante = textBoxNumero.Text; modParticipante.bairoParticipante = textBoxBairro.Text; modParticipante.cidadeParticipante = textBoxCidade.Text; modParticipante.ufParticipante = comboBoxUF.Text;//validar modParticipante.cepParticipante = textBoxCep.Text; modParticipante.telefoneParticipante = textBoxTelefone.Text; modParticipante.celularParticipante = textBoxCelular.Text; modParticipante.emailParticipante = textBoxEmail.Text; modParticipante.razaosocialapelidoParticipante = textBoxRazaoSocialApelido.Text; modParticipante.dataCadastroParticipante = textBoxDataCadastro.Text; modParticipante.usuarioCadastroParticipante = textBoxUsuarioCadastro.Text; if (checkBoxCliente.Checked) { modParticipante.tipoclienteParticipante = true; } else { modParticipante.tipoclienteParticipante = false; } if (checkBoxFornecedor.Checked) { modParticipante.tipofornecedorParticipante = true; } else { modParticipante.tipofornecedorParticipante = false; } if (checkBoxFuncionario.Checked) { modParticipante.tipofuncionarioParticipante = true; } else { modParticipante.tipofuncionarioParticipante = false; } if (checkBoxAtivo.Checked) { modParticipante.ativoParticipante = true; } else { modParticipante.ativoParticipante = false; } participanteBLL.salvar(modParticipante); MessageBox.Show("Participante incluido com sucesso!!!", "Cadastro", MessageBoxButtons.OK, MessageBoxIcon.Information); botaoClicado = "SALVAR"; inativaAtivaCamposBotoes(); //Método chama o ultimo registro participanteBLL.buscarUltimoRegistro(modParticipante); int idReturn = modParticipante.idParticipante; textBoxCodigo.Text = Convert.ToString(idReturn); } else if (flag == 1) { ParticipanteBLL participanteBLL = new ParticipanteBLL(); modParticipante.nomeParticipante = textBoxNome.Text; modParticipante.cpfcnpjParticipante = textBoxCpfCnpj.Text; modParticipante.rgieParticipante = textBoxRgIe.Text; modParticipante.enderecoParticipante = textBoxEndereco.Text; modParticipante.numeroEnderecoParticipante = textBoxNumero.Text; modParticipante.bairoParticipante = textBoxBairro.Text; modParticipante.cidadeParticipante = textBoxCidade.Text; modParticipante.ufParticipante = comboBoxUF.Text;//validar modParticipante.cepParticipante = textBoxCep.Text; modParticipante.telefoneParticipante = textBoxTelefone.Text; modParticipante.celularParticipante = textBoxCelular.Text; modParticipante.emailParticipante = textBoxEmail.Text; modParticipante.razaosocialapelidoParticipante = textBoxRazaoSocialApelido.Text; modParticipante.dataAlteracaoParticipante = textBoxDataAlteracao.Text; modParticipante.usuarioAlteracaoParticipante = textBoxUsuarioAlteracao.Text; int id = Convert.ToInt32(textBoxCodigo.Text); modParticipante.idParticipante = id; if (checkBoxCliente.Checked) { modParticipante.tipoclienteParticipante = true; } else { modParticipante.tipoclienteParticipante = false; } if (checkBoxFornecedor.Checked) { modParticipante.tipofornecedorParticipante = true; } else { modParticipante.tipofornecedorParticipante = false; } if (checkBoxFuncionario.Checked) { modParticipante.tipofuncionarioParticipante = true; } else { modParticipante.tipofuncionarioParticipante = false; } if (checkBoxAtivo.Checked) { modParticipante.ativoParticipante = true; } else { modParticipante.ativoParticipante = false; } participanteBLL.alterar(modParticipante); MessageBox.Show("Participante alterado com sucesso!!!", "Alteração", MessageBoxButtons.OK, MessageBoxIcon.Information); botaoClicado = "SALVAR"; inativaAtivaCamposBotoes(); } }