Пример #1
0
 public int GetCounts(string folder, string name)
 {
     return(PageTemplate.GetItemCount(name));
 }
Пример #2
0
        private void ValidateExistingControl(Control ctrl, string Caption, ref bool IsErrorPresent, StringBuilder errors)
        {
            int count = 0;

            switch (ItemType.ToLower())
            {
            case "dataconnection":
                count = GetDataConnectionCountByName();
                break;

            case "dataconnectiontype":
                count = GetDataConnectionTypeCountByName();
                break;

            case "documentrepository":
                count = GetDocumentRepositoryCountByName();
                break;

            case "documentrepositorytype":
                count = GetDocumentRepositoryTypeCountByName();
                break;

            case "emailconnection":
                count = GetEmailConnectionCountByName();
                break;

            case "emailconnectiontype":
                count = GetEmailConnectionTypeCountByName();
                break;

            case "lookup":
                count = GetLookupCountByName();
                break;

            case "pagetemplate":
                count = PageTemplate.GetItemCount(ItemName.Text);
                break;

            case "picker":
                count = GetPickerCountByName();
                break;

            case "restservice":
                count = GetRestServiceCountByName();
                break;

            case "screentype":
                count = GetScreenTypeCountByName();
                break;

            case "sectiontype":
                count = GetSectionTypeCountByName();
                break;

            case "sectionzonelayout":
                count = GetSectionZoneLayoutCountByName();
                break;

            case "sequence":
                count = GetSequenceCountByName();
                break;

            case "template":
                count = Template.GetItemCount(ItemName.Text);
                break;

            case "workflow":
                count = GetWorkflowCountByName();
                break;

            case "workflowtype":
                count = GetWorkflowTypeCountByName();
                break;
            }

            if (count > 0)
            {
                IsErrorPresent = true;
                string errorMessage = String.Format("{0} {1} already exists.", ItemDisplayName, Caption);
                errorProvider.SetError(ctrl, errorMessage);
                errors.AppendLine(errorMessage);
            }
            else
            {
                errorProvider.SetError(ctrl, String.Empty);
            }
        }