Click or drag to resize

ClientModuleConfigOnGetMenuItemOfClientByGroup Field

Event for menu item setting e.g. puts badges

Namespace:  SOWIApp.Administrator
Assembly:  SOWIApp.Administrator (in SOWIApp.Administrator.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public static EventHandler<EventArgData<ClientModuleConfig>> OnGetMenuItemOfClientByGroup

Field Value

Type: EventHandlerEventArgDataClientModuleConfig
Examples
This example puts menu badges for incoming tickets

Declaration the event e.g. into start code of application

protected void Application_Start()
{
    // ...

    //* badges for incoming ticket *
    SOWIApp.Administrator.ClientModuleConfig.OnGetMenuItemOfClientByGroup += OnGetMenuItemOfClientByGroup;

    // ...
}
Method puts badges value
/// <summary>
/// Sets Ticket badges
/// </summary>
/// <param name="sender">Is null</param>
/// <param name="e">Menu object</param>
private void OnGetMenuItemOfClientByGroup(object sender, SOWIData.EventArgData<SOWIData.Management.Models.ClientModuleConfig> e)
{
    if (e.Item != null)
    {
        for (int i = 0; i < e.Item.ClientModules.Count; i++)
        {
            if (e.Item.ClientModules[i].Active)
            {
                if (e.Item.ClientModules[i].Name == "Ticket")
                {
                    var lAppTicket = new ProTicApp.Ticket(SOWIWeb.Helper.Session.Token.ToGUID());
                    e.Item.ClientModules[i].Badges = lAppTicket.CountInComing();
                }
            }
        }
    }
}
See Also