protected void Page_Load(object sender, EventArgs e)
    {
        EventTaskCategoryMaint categoryMaint = PXGraph.CreateInstance <EventTaskCategoryMaint>();

        RegisterStyle("CssOverdue", null, "Red", false);
        RegisterStyle("CssOverdueBold", null, "Red", true);
        RegisterStyle("BaseBold", null, null, true);

        coloredCategories = new Set <int>(true);
        foreach (EPEventCategory rec in categoryMaint.ColoredCategories.Select())
        {
            PXFieldState color = categoryMaint.ColoredCategories.Cache.GetStateExt(rec, "Color") as PXFieldState;
            if (color != null)
            {
                coloredCategories.Add(rec.CategoryID ?? 0);
                string colorName = categoryMaint.ColoredCategories.Cache.GetValue(rec, "Color").ToString();

                string backColor = color.Value.ToString();
                RegisterStyle("Css" + rec.CategoryID, backColor, null, false);
                RegisterStyle("CssBold" + rec.CategoryID, backColor, null, true);
                RegisterStyle("CssOver" + rec.CategoryID, backColor, "Red", false);
                RegisterStyle("CssBoldOver" + rec.CategoryID, backColor, "Red", true);
            }
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        EventTaskCategoryMaint categoryMaint = PXGraph.CreateInstance <EventTaskCategoryMaint>();

        RegisterStyle("CssOverdue", null, "Red", false);
        RegisterStyle("CssOverdueBold", null, "Red", true);
        RegisterStyle("BaseBold", null, null, true);

        coloredCategories = new Set <int>(true);
        foreach (EPEventCategory rec in categoryMaint.ColoredCategories.Select())
        {
            PXIntState color = categoryMaint.ColoredCategories.Cache.GetStateExt(rec, "Color") as PXIntState;
            if (color != null)
            {
                coloredCategories.Add(rec.CategoryID ?? 0);
                int colorIndex = color.AllowedValues != null?Array.IndexOf(color.AllowedValues, (int)color.Value) : -1;

                string backColor = (colorIndex > 0)
                    ? color.AllowedLabels[colorIndex]
                    : color.Value.ToString();

                RegisterStyle("Css" + rec.CategoryID, backColor, null, false);
                RegisterStyle("CssBold" + rec.CategoryID, backColor, null, true);
                RegisterStyle("CssOver" + rec.CategoryID, backColor, "Red", false);
                RegisterStyle("CssBoldOver" + rec.CategoryID, backColor, "Red", true);
            }
        }
    }