Esempio n. 1
0
        public static ItemValidationBase CreateNewIssue(RepositoryItem rItem)
        {
            ItemValidationBase ITB = new ItemValidationBase();

            ITB.UsageItem = rItem;
            ITB.ItemName  = rItem.ItemName;
            ITB.ItemClass = RepositoryItem.GetShortType(rItem.GetType());
            return(ITB);
        }
Esempio n. 2
0
        public static ItemValidationBase CreateNewIssue(RepositoryItemBase rItem)
        {
            ItemValidationBase ITB = new ItemValidationBase();

            ITB.UsageItem = rItem;
            ITB.ItemName  = rItem.ItemName;
            // TODO: remove me and use RepositoryItemBase
            //ITB.ItemClass = RepositoryItem.GetShortType(rItem.GetType());
            ITB.ItemClass = rItem.GetItemType();

            return(ITB);
        }
Esempio n. 3
0
        public static void Validate(Activity activity)
        {
            if (activity == null)
            {
                return;
            }

            List <string> missingVariables = CheckMissingVariables(activity);

            if (missingVariables.Count > 0)
            {
                ItemValidationBase VA = CreateNewIssue(activity);
                VA.IssueDescription     = GingerDicser.GetTermResValue(eTermResKey.BusinessFlow) + " " + GingerDicser.GetTermResValue(eTermResKey.Variables) + ":" + GetListNameString(missingVariables) + "  is/are missing";
                VA.mIssueType           = eIssueType.MissingVariables;
                VA.missingVariablesList = missingVariables;
                VA.IssueResolution      = "Missing " + GingerDicser.GetTermResValue(eTermResKey.Variables) + " will be auto added to " + GingerDicser.GetTermResValue(eTermResKey.Activity);
                VA.Selected             = true;
                mIssuesList.Add(VA);
            }
        }
Esempio n. 4
0
        public static void Validate(UploadItemSelection selectedItem)
        {
            bool isDuplicateFound = CheckForItemWithDuplicateName(selectedItem);

            if (isDuplicateFound)
            {
                ItemValidationBase VA = CreateNewIssue((RepositoryItemBase)selectedItem.UsageItem);
                VA.IssueDescription = "Item with same name already exists";
                VA.mIssueType       = eIssueType.DuplicateName;
                VA.ItemNewName      = GetUniqueItemName(selectedItem);
                VA.IssueResolution  = "Item will be uploaded with new name: " + VA.ItemNewName;
                VA.Selected         = true;
                mIssuesList.Add(VA);
            }
            switch (selectedItem.UsageItem.GetType().Name)
            {
            case "Activity":
                ValidateActivity.Validate((Activity)selectedItem.UsageItem);
                break;
            }
        }
Esempio n. 5
0
        public void WizardEvent(WizardEventArgs WizardEventArgs)
        {
            switch (WizardEventArgs.EventType)
            {
            case EventType.Init:
                UploadItemToRepositoryWizard = ((UploadItemToRepositoryWizard)WizardEventArgs.Wizard);
                break;

            case EventType.Active:

                ItemValidationBase.mIssuesList.Clear();
                int issuesCount = 0;
                foreach (UploadItemSelection item in UploadItemSelection.mSelectedItems)
                {
                    if (item.Selected)
                    {
                        issuesCount = ItemValidationBase.mIssuesList.Count;
                        ItemValidationBase.Validate(item);
                    }
                }

                if (ItemValidationBase.mIssuesList.Count > 0)
                {
                    itemValidationGrid.DataSourceList = ItemValidationBase.mIssuesList;
                    itemValidationGrid.Visibility     = Visibility.Visible;
                    xLabelMessage.Visibility          = Visibility.Collapsed;
                }
                else
                {
                    itemValidationGrid.Visibility = Visibility.Collapsed;
                    xLabelMessage.Visibility      = Visibility.Visible;

                    xLabelMessage.Content = "No Validation Issues Found. Proceed with Item/s Upload";
                }
                break;
            }
        }