﻿Type.registerNamespace("ITICClients");

ITICClients.DocumentClient = function() {
}

ITICClients.DocumentClient.prototype = {
    getHighlights: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetHighlightsDocuments(callback, errorCallback);
    },

    getAnnualReport: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetAnnualReportForHome(callback, errorCallback);
    },

    getAnnualReportPublic: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetAnnualReport(callback, errorCallback);
    },

    getBulletins: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetBulletinDocuments(callback, errorCallback);
    },

    getBulletinsForHome: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetBulletinDocumentsForHome(callback, errorCallback);
    },

    getPublications: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetPublicationDocuments(callback, errorCallback);
    },
    getOtherPublications: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetOtherPublicationDocuments(callback, errorCallback);
    },

    getFinancialDocuments: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetLegalAndFinancialDocuments(callback, errorCallback);
    },

    getNews: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetNews(callback, errorCallback);
    },

    getAllDocuments: function(pageIndex, pageSize, language, description, fulltextKeyWord, callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetAllDocuments(pageIndex, pageSize, language, description, fulltextKeyWord, null, callback, errorCallback);
    },

    getSearchResult: function(pageIndex, pageSize, year, date, language, description, fulltextKeyWord, viewPorts, callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetAdvanceSearchResult(pageIndex, pageSize, year, date, language, description, fulltextKeyWord, viewPorts, callback, errorCallback);
    },

    getAllDocumentsFullTextSearch: function(pageIndex, pageSize, searchKey, callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetAllDocumentFullTextOnly(pageIndex, pageSize, searchKey, callback, errorCallback);
    },

    getCorporateDocuments: function(callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetCorporateDocuments(callback, errorCallback);
    },

    getViewPortDocumentYear: function(viewPortID, callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.GetViewPortDocumentsYearList(viewPortID, callback, errorCallback);
    },
    removeDocumentFromTree: function(baseDocID, docID, callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.RemoveDocumentFromTree(baseDocID, docID, callback, errorCallback);
    },
    removeDocumentFromAllTree: function(docID, callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.RemoveDocumentFromAllTree(docID, callback, errorCallback);
    },
    dispose: function() {
        //disposed
    },
    downloadDocument: function(docID, callback, errorCallback, showwaitscreen, controlid) {
        //showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.CanDownloadDocument(docID, callback, errorCallback);
    },
    searchDocuments: function(pageIndex, searchKey, callback, errorCallback, showwaitscreen, controlid) {
        showwaitscreen(controlid);
        ITIC.SERVICES.IDocumentService.SearchDocuments(pageIndex, searchKey, callback, errorCallback);
    }
}

ITICClients.DocumentClient.registerClass('ITICClients.DocumentClient', null, Sys.IDisposable)

// Notify ScriptManager that this is the end of the script.
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();