protected void SaveData() //luu du lieu { try { if (id > 0) { AbountInfo info = new AbountInfo(); info.AbountContent = txtDetailText.Value; info.AbountID = id; AbountManager.Update(info); } else { //this is a new object. AbountInfo info = new AbountInfo(); info.AbountContent = txtDetailText.Value; AbountManager.Insert(info); } this.lblError.Text = "Đã lưu dữ liệu thành công"; } catch (Exception ex) { this.lblError.Text = ex.Message; } }
private void BindObject(int objID) { AbountInfo obj = AbountManager.Select(objID); if (obj != null) { txtDetailText.Value = obj.AbountContent; } }