﻿// Questo file contiene le funzioni di CallBack che vengono richiamate dal
// controllo BarraCategorie. Definiscono il comportamento del sistema in 
// base a questi eventi.


// Segnala il click sul pulsante Indice sottogruppi
function BarraCategorie_CallBack_btnAlbero(SearchType, HandleValue) {
    //CARLOLEVI:NetSellGui_CleanDiv_OpenPage(NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/Show5TDList.aspx?SearchType=' + SearchType + '&HandleValue=' + HandleValue + '&ColType=FORNITORI&handlerPage=' + NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/showFornitore.aspx');

    // Invoca IdleService per far mostrare l'attesa
    var _param = new Array();
    _param['serviceType'] = 'IdleService';
    invoke(NetSell_XalpServiceUrl + '/CommonService/CommonRequest.aspx', _param, '', 10000);
    NetSellGui_CleanDiv_OpenPage(NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/ExploreHasTree.aspx?HandleGmv=93');
    return 0;


}
 
// Segnala il click sul pulsante Indice sottogruppi
function BarraCategorie_CallBack_btnFuoriTutto(SearchType, HandleValue) {
    BarraCategorie_CallBack_SelectedGmv(80);
}

// Segnala il click sul pulsante Indice sottogruppi
function BarraCategorie_CallBack_btnIndiceSottoGruppi(SearchType, HandleValue) {

    /** 
        ancora una modifica al core forzata da aurelio di biasi
    **/
    BarraCategorie_CallBack_SelectedGmv(95);
}



// Segnala il click sul pulsante Indice sottogruppi
function BarraCategorie_CallBack_btnMacroAree(SearchType, HandleValue) {
    BarraCategorie_CallBack_SelectedGmv(94);
}


// Segnala il click sul pulsante Indice Fornitori
function BarraCategorie_CallBack_btnIndiceFornitori(SearchType, HandleValue) {

//    BarraCategorie_CallBack_SelectedGmv(92);
    // Invoca IdleService per mostrare l'attesa
   var _param = new Array();
   _param['serviceType'] = 'IdleService';
   invoke(NetSell_XalpServiceUrl + '/CommonService/CommonRequest.aspx', _param, '', 10000);

    if (SearchType == null) SearchType = '';
    if (HandleValue == null) HandleValue = '';
    
    //PROMETHEUS:NetSellGui_CleanDiv_OpenPage(NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/Show3ColList.aspx?SearchType=' + SearchType + '&HandleValue=' + HandleValue + '&ColType=FORNITORI&handlerPage=' + NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/showFornitore.aspx');
    NetSellGui_CleanDiv_OpenPage(NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/Show5TDList.aspx?SearchType=' + SearchType + '&HandleValue=' + HandleValue + '&ColType=FORNITORI&handlerPage=' + NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/showFornitore.aspx');
}


// Segnala il click sul pulsante Indice Fornitori
function BarraCategorie_CallBack_btnIndiceMacroAree(SearchType, HandleValue) {

    // Prometheus: Mostra i gmv di classe 0 (len2) tramite exploregmv00
    BarraCategorie_CallBack_SelectedGmv(-1);

    // Invoca IdleService per mostrare l'attesa
    //   var _param = new Array();
    //  _param['serviceType'] = 'IdleService';
    // invoke(NetSell_XalpServiceUrl + '/CommonService/CommonRequest.aspx', _param, '', 10000);

    //    if (SearchType == null) SearchType = '';
    //   if (HandleValue == null) HandleValue = '';
    //  NetSellGui_CleanDiv_OpenPage(NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/Show3ColList.aspx?SearchType=' + SearchType + '&HandleValue=' + HandleValue + '&ColType=FORNITORI&handlerPage=' + NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/showFornitore.aspx');
}






// Segnala il click sul pulsante Indice Gruppi
function BarraCategorie_CallBack_btnIndiceGruppi(SearchType, HandleValue) {
    //PROMETHEUS: NetSellGui_CleanDiv_OpenPage(NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/Show3ColList.aspx?SearchType=' + SearchType + '&HandleValue=' + HandleValue + '&ColType=GRUPPI&handlerPage=' + NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/showGruppi.aspx');
    NetSellGui_CleanDiv_OpenPage(NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/Show5TDList.aspx?SearchType=' + SearchType + '&HandleValue=' + HandleValue + '&ColType=GRUPPI&handlerPage=' + NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/showGruppi.aspx');
}

// Segnala il click sul pulsante Schemi e Cataloghi
function BarraCategorie_CallBack_btnScheme() {
    NetSellGui_OpenDialogWindow(NetSell_XalpServiceUrl + '/ExternalObj/Browsing/BrowseDirectory.aspx', 'Cataloghi e Schemi');
}





// Segnala il click su una categoria. 
function BarraCategorie_CallBack_SelectedGmv(gmvCode) {

    // Invoca IdleService per far mostrare l'attesa
    var _param = new Array();
    _param['serviceType'] = 'IdleService';
    invoke(NetSell_XalpServiceUrl + '/CommonService/CommonRequest.aspx', _param, '', 10000);

    NetSellGui_CleanDiv_OpenPage(NetSell_XalpServiceUrl + '/NetSellGui_CatalogEngine/Simple/ExploreGmv.aspx?HandleGmv=' + gmvCode);
    return 0;    
    
}



