protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { try { if (Session[Su_CoQuanLuuTruLogic.SESSION_SEC_ID] != null) { btAddApprover.Text = "Cập nhật"; sec = um.getCoQuanLuuTru(Int32.Parse(Session[Su_CoQuanLuuTruLogic.SESSION_SEC_ID].ToString())); if (sec != null) { tbxName.Text = sec.Name; tbxCode.Text = sec.Code; } } else { sec = new CoQuanLuuTru(); } listAllSec(); } catch (Exception ex) { Logger.logmessage(classobject, "Page_Load", ex.Message + ex.StackTrace); Response.Redirect("~/ThongBaoLoi.aspx", false); } } else { string tId = ""; if (Session[Su_CoQuanLuuTruLogic.SESSION_SEC_ID] != null) { tId = Session[Su_CoQuanLuuTruLogic.SESSION_SEC_ID].ToString(); sec = new CoQuanLuuTru(); int iId = 0; Int32.TryParse(tId, out iId); sec.ID = iId; sec.Name = tbxName.Text; sec.Code = tbxCode.Text; } } }