// TODO: Create in API an Object TermTypeLanguages protected void Page_Load(object sender, System.EventArgs e) { lbMessage.Text = string.Empty; #region Check Capabilities //if ((SessionState.User.IsReadOnly) || (!SessionState.User.HasCapability(CapabilitiesEnum.MANAGE_TERM_BASE))) //{ //uwToolbar.Items.FromKeyButton("Add").Enabled = false; //uwToolbar.Items.FromKeyButton("Delete").Enabled = false; //} #endregion //DDL_RegionList.AutoPostBack = false; if (!Page.IsPostBack) { try { #region Load TermType list using (TermTypeList TermTypes = TermType.GetAll()) { DDL_TermTypeList.DataSource = TermTypes; DDL_TermTypeList.DataBind(); } #endregion LoadRegionList(); ShowTermTypeLanguage(); } catch { UITools.DenyAccess(DenyMode.Standard); } } }
/// <summary> /// Show Term /// </summary> private void ShowTerm() { #region Load TermType list using (TermTypeList TermTypes = TermType.GetAll()) { DDL_TermTypeList.DataSource = TermTypes; DDL_TermTypeList.DataBind(); } #endregion if (t != null) { #region Retrieve information about the current container txtTermValue.Text = t.Value.ToString(); using (ContainerList clist = HyperCatalog.Business.Container.GetAll("LabelId=" + termId)) { if (clist.Count != 0) { txtTermValue.Enabled = false; } else { txtTermValue.Enabled = true; } txtComment.Text = t.Comment.ToString(); //ACQ8.20 Ends if (t.TermTypeCode.ToString() == "S") { IsTranslatable.Enabled = false; } IsTranslatable.Checked = t.IsTranslatable; //ACQ8.20 Ends lUsage.Text = "Used " + t.UsageCount.ToString() + " time(s)"; DDL_TermTypeList.SelectedValue = t.TermTypeCode.ToString(); DDL_TermTypeList.Enabled = false; hlCreator.Text = UITools.GetDisplayName(t.User.FullName); hlCreator.NavigateUrl = "mailto:" + UITools.GetDisplayEmail(t.User.Email) + Server.HtmlEncode("?subject=Term[#" + t.Id.ToString() + "]");; lbOrganization.Text = t.User.OrgName; lbOrganization.Visible = hlCreator.Text == t.User.FullName; lbCreatedOn.Text = SessionState.User.FormatUtcDate(t.ModifyDate.Value, true, SessionState.User.FormatDate + ' ' + SessionState.User.FormatTime); UITools.ShowToolBarButton(uwToolbar, "Delete"); UITools.ShowToolBarSeparator(uwToolbar, "SepDelete"); } using (Database dbObj = Utils.GetMainDB()) { using (DataSet ds = dbObj.RunSQLReturnDataSet("dbo.[_Term_GetAssociatedInputForms] " + t.Id.ToString())) { dbObj.CloseConnection(); if (ds.Tables[0].Rows.Count > 0) { dg.DataSource = ds; dg.DataBind(); fUsage.Visible = true; } else { fUsage.Visible = false; } } } #endregion } else { #region New Term DDL_TermTypeList.Enabled = true; hlCreator.Text = SessionState.User.FullName; hlCreator.NavigateUrl = "mailto:" + UITools.GetDisplayEmail(SessionState.User.Email) + Server.HtmlEncode("?subject=TMExpression");; lbOrganization.Text = SessionState.User.OrgName; lbCreatedOn.Text = SessionState.User.FormatUtcDate(DateTime.Now, true, SessionState.User.FormatDate + ' ' + SessionState.User.FormatTime); fUsage.Visible = false; UITools.HideToolBarButton(uwToolbar, "Delete"); UITools.HideToolBarSeparator(uwToolbar, "SepDelete"); #endregion } }