protected void btnSalvar_Click(object sender, EventArgs e) { var TipoTabelaColuna = new TipoTabelaColuna(); try { if (txtId.Text != "") { TipoTabelaColuna.IDTipoTabelaColuna = int.Parse(txtId.Text); TipoTabelaColuna.Get(); } TipoTabelaColuna.Tabela = txtTabela.Text; TipoTabelaColuna.Coluna = txtColuna.Text; TipoTabelaColuna.Save(); GetTipoTabelaColuna((int)TipoTabelaColuna.IDTipoTabelaColuna); Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('Registro salvo.')</script>"); } catch (Exception err) { Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>"); } }
protected void DeleteTipoTabelaColuna(int idTipoTabelaColuna) { try { var TipoTabelaColuna = new TipoTabelaColuna(); TipoTabelaColuna.IDTipoTabelaColuna = idTipoTabelaColuna; TipoTabelaColuna.Delete(); GetTipoTabelaColunas(); } catch (Exception err) { Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>"); } }
private void GetTipoTabelaColuna(int idTipoTabelaColuna) { dvSalvarTipoTabelaColuna.Visible = true; dvListarTipoTabelaColunas.Visible = false; var TipoTabelaColuna = new TipoTabelaColuna(); TipoTabelaColuna.IDTipoTabelaColuna = idTipoTabelaColuna; TipoTabelaColuna.Get(); txtId.Text = TipoTabelaColuna.IDTipoTabelaColuna.ToString(); txtTabela.Text = TipoTabelaColuna.Tabela.ToString(); txtColuna.Text = TipoTabelaColuna.Coluna.ToString(); }