Ejemplo n.º 1
0
    private List <msEventCategory> _getCategoryListFor(List <string> distinctCategories)
    {
        if (distinctCategories == null)
        {
            throw new ArgumentNullException("distinctCategories");
        }
        List <msEventCategory> categories = new List <msEventCategory>();

        foreach (var dc in distinctCategories)
        {
            if (dc == "")
            {
                msEventCategory c2 = new msEventCategory();
                c2.Name        = "All Other Events";
                c2.Description = " - These are events that have not been assigned a category.";
                c2.ID          = "null";
                categories.Add(c2);
                continue;
            }

            categories.Add(LoadObjectFromAPI <msEventCategory>(dc)); // just get it from the db
        }

        return(categories);
    }
Ejemplo n.º 2
0
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        if (ContextID == "null")
        {
            targetCategory      = new msEventCategory();
            targetCategory.Name = "All Other Events";
            targetCategory.ID   = "null";
        }
        else
        {
            targetCategory = LoadObjectFromAPI <msEventCategory>(ContextID);
        }
    }