void UpdateDataView() { string filter = string.Empty; filter += " FeatureContainerId=" + featureContainerId; // filter if (txtFilter.Text.Length > 0) { string cleanFilter = txtFilter.Text.Replace("'", "''").ToLower(); cleanFilter = cleanFilter.Replace("[", "[[]"); cleanFilter = cleanFilter.Replace("_", "[_]"); cleanFilter = cleanFilter.Replace("%", "[%]"); filter += " AND (LOWER(TC.Tag) like '%" + cleanFilter + "%'"; filter += " OR LOWER(TC.ContainerName) like '%" + cleanFilter + "%'"; filter += " OR LOWER(TC.Definition) like '%" + cleanFilter + "%')"; } // Get all container dependencies using (ContainerDependencyList dependencies = ContainerDependency.GetAll(filter)) { if (dependencies != null) { if (dependencies.Count > 0) { dg.DataSource = dependencies; Utils.InitGridSort(ref dg); dg.DataBind(); UITools.RefreshTab(this.Page, "ContainerDependencies", dg.Rows.Count); if (SessionState.User.HasCapability(CapabilitiesEnum.MANAGE_DICTIONARY)) { UITools.ShowToolBarSeparator(uwToolbar, "DeleteSep"); UITools.ShowToolBarButton(uwToolbar, "Delete"); uwToolbar.Items.FromKeyButton("Delete").DefaultStyle.Width = Unit.Pixel(120); } dg.Visible = true; lbNoresults.Visible = false; } else { if (txtFilter.Text.Length > 0) { lbNoresults.Text = "No record match your search (" + txtFilter.Text + ")"; } dg.Visible = false; lbNoresults.Visible = true; } // refresh tab count UITools.RefreshTab(Page, "ContainerDependencies", dependencies.Count); } } }
private void CheckDependency() { InputForm inputForm = InputForm.GetByKey(InputFormId); if (inputForm != null) { if (refContainer.ContainerTypeCode == 'F') // feature container { // Retrieve all container dependencies for this feature container string filter = " FeatureContainerId=" + refContainer.Id; using (ContainerDependencyList dependencies = ContainerDependency.GetAll(filter)) { if ((dependencies != null) && (dependencies.Count > 0)) { // Create list of tech spec containers (in container dependencies) string techSpecsList = string.Empty; foreach (HyperCatalog.Business.ContainerDependency d in dependencies) { // Current tech spec container HyperCatalog.Business.Container techSpecContainer = d.TechspecContainer; // tech spec container is or not attached to this input form int i = 0; using (InputFormContainerList ifcList = InputFormContainer.GetAll("InputFormId=" + InputFormId + " AND ContainerId=" + techSpecContainer.Id)) { if ((ifcList == null) || (ifcList.Count == 0)) { i++; if (techSpecsList.Length > 0) { techSpecsList += "\\n"; } techSpecsList += " " + i.ToString() + " - " + techSpecContainer.Name + " [" + techSpecContainer.Tag + "]"; } } } // Tech specs (in container dependencies) are not attached to this input form if (techSpecsList.Length > 0) { string msg = "REMINDER - are the following tech spec containers in your tech specs input forms?\\n"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "warning", "<script>alert('" + msg + techSpecsList + "');</script>"); } } } } } }