protected void BtnLogin_Click(object sender, EventArgs e) { DataSet ds = Pef_Pessoa_FisicaBD.SelectLogin(LoginID.Text, Pef_Pessoa_FisicaBD.PWD(SenhaID.Text)); int qtd = ds.Tables[0].Rows.Count; if (qtd == 1) { Pef_Pessoa_Fisica pef = new Pef_Pessoa_Fisica(); pef.Pef_codigo = Convert.ToInt32(ds.Tables[0].Rows[0]["pef_codigo"].ToString()); pef.Pef_cpf = Convert.ToInt64(ds.Tables[0].Rows[0]["pef_cpf"].ToString()); pef.Pef_nome = ds.Tables[0].Rows[0]["pef_nome"].ToString(); pef.Pef_email = ds.Tables[0].Rows[0]["pef_email"].ToString(); pef.Pef_genero = ds.Tables[0].Rows[0]["pef_genero"].ToString(); pef.Pef_data_nascimento = ds.Tables[0].Rows[0]["pef_data_nascimento"].ToString(); End_Endereco end = new End_Endereco(); end.End_cep = Convert.ToInt32(ds.Tables[0].Rows[0]["end_cep"].ToString()); pef.End_cep = end; Session["usuario"] = pef; Response.Redirect("Perfil/EsportistaPerfil.aspx"); } else { Response.Redirect("Principal.aspx"); } }
protected void BtnSalvar_Click(object sender, EventArgs e) { Pef_Pessoa_Fisica pef = (Pef_Pessoa_Fisica)Session["usuario"]; pef.Pef_nome = txtNome.Text; pef.Pef_senha = Pef_Pessoa_FisicaBD.PWD(txtSenha.Text); pef.Pef_email = txtEmail.Text; pef.Pef_cpf = Convert.ToInt64(txtCPF.Text); pef.Pef_data_nascimento = txtDataNascimento.Text; pef.Pef_genero = ddlGenero.SelectedValue; End_Endereco end = new End_Endereco(); end.End_cep = pef.End_cep.End_cep; pef.End_cep = end; switch (Pef_Pessoa_FisicaBD.Update(pef)) { case 0: Page.Response.Redirect("EsportistaPerfil.aspx"); break; case -2: Response.Redirect("QuemSomos.aspx"); break; } }
protected void BtnCadastrar_Click(object sender, EventArgs e) { Pef_Pessoa_Fisica pef = new Pef_Pessoa_Fisica(); pef.Pef_cpf = Convert.ToInt64(txtCPF.Text); pef.Pef_nome = txtNome.Text; pef.Pef_email = txtEmail.Text; pef.Pef_senha = Pef_Pessoa_FisicaBD.PWD(txtSenha.Text); pef.Pef_data_nascimento = txtDataNascimento.Text; pef.Pef_genero = ddlGenero.SelectedValue; End_Endereco end = new End_Endereco(); end.End_cep = Convert.ToInt32(cep.Text); pef.End_cep = end; switch (Pef_Pessoa_FisicaBD.Insert(pef)) { case 0: Response.Redirect("LoginEsportista.aspx"); break; case -2: break; } }
protected void BtnSalvar_Click(object sender, EventArgs e) { Pej_Pessoa_Juridica pej = (Pej_Pessoa_Juridica)Session["usuario"]; pej.Pej_razao_social = txtNomeEmpresa.Text; pej.Pej_nome_ficticio = txtNomeFantasia.Text; pej.Pej_cnpj = Convert.ToInt64(txtCNPJ.Text); pej.Pej_email = txtEmail.Text; pej.Pej_senha = Pef_Pessoa_FisicaBD.PWD(txtSenha.Text); End_Endereco end = new End_Endereco(); end.End_cep = pej.End_cep.End_cep; pej.End_cep = end; switch (Pej_Pessoa_JuridicaBD.Update(pej)) { case 0: Page.Response.Redirect("EspacoPerfil.aspx"); break; case -2: Response.Redirect("QuemSomos.aspx"); break; } }