private void updateData() { Boolean Result = false; int Id = 0; try { Id = Convert.ToInt32(lblValueId.Text); this.objCntrlDepartamento = new cntrlDepartamento(); rowDepartamento = this.objCntrlDepartamento.Select(Id); rowDepartamento.Nome = txtNome.Text; Result = this.objCntrlDepartamento.Save(rowDepartamento); } catch (Exception ex) { throw ex; } finally { this.rowDepartamento = null; this.objCntrlDepartamento = null; } this.getData(); }
private void insertData() { Boolean Result = false; try { this.rowDepartamento = this.tblDepartamento.NewtblDepartamentosRow(); this.objCntrlDepartamento = new cntrlDepartamento(); rowDepartamento.Nome = txtNome.Text; Result = this.objCntrlDepartamento.Save(rowDepartamento); } catch (Exception ex) { throw ex; } finally { this.rowDepartamento = null; this.objCntrlDepartamento = null; } this.getData(); }