private void GetObjectStatus() { tStatus.Text = ""; tUser.Text = ""; tStatusDate.Text = ""; tComment.Text = ""; AvailableForEdit = true; try { using (DataStuff sn = new DataStuff()) { DataTable dt = sn.GetObjectHistoryLast(ObjectName, ServerAliasID); if (dt.Rows.Count > 0) { tStatus.Text = dt.Rows[0]["Status"].ToString(); tUser.Text = dt.Rows[0]["User"].ToString(); tStatusDate.Text = dt.Rows[0]["Date"].ToString(); tComment.Text = dt.Rows[0]["Comment"].ToString(); if (dt.Rows[0]["AvailableForEdit"].ToString() == "N") { AvailableForEdit = false; } else { AvailableForEdit = true; } } } if (AvailableForEditChange != null) { AvailableForEditChange(this, null); } } catch { throw; } }