protected void btnSalvar_Click(object sender, EventArgs e) { try { Interesse esc = new Interesse(); esc.DesInteresse = txtInteresse.Text; if (Sequencial.Value != "") { esc.Sequencial = Convert.ToInt32(Sequencial.Value); if (InteresseDAO.getInstance().update(esc)) { sucess(); } } else { if (InteresseDAO.getInstance().create(esc)) { sucess(); } } } catch (Exception) { Server.Transfer("~/Config/Erro.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.Params["id"] != null) { String idS = Request.Params["id"]; Interesse intersse = InteresseDAO.getInstance().findById(Convert.ToInt32(idS)); txtInteresse.Text = intersse.DesInteresse; Sequencial.Value = idS; } } }
protected void Button2_Click(object sender, EventArgs e) { try { dgInteresse.DataSource = InteresseDAO.getInstance().findByParameters( new Interesse() { DesInteresse = "%" + txtInteresse.Text + "%" }); dgInteresse.DataBind(); } catch (Exception) { Server.Transfer("~/Config/Erro.aspx"); } }