(function () {
    'use strict';

    angular
        .module('app')
        .factory('ComandoPaineis', ComandoPaineis);

    ComandoPaineis.$inject = ['Server'];

    function ComandoPaineis(Server) {
        function ComandoPaineis(obj, successCallback, errorCallback) {
            var action = ''
            Server.get(action, obj, successCallback, errorCallback);
        };

        function SalvarPainel(obj, sucess, error) {
            var action = '/Paineis/SalvarPainel';
            Server.post(action, obj, sucess, error);
        }

        function ExcluirPainel(codigoPainel, successCallback, errorCallback) {
            var action = '/Paineis/ExcluirPainel';
            Server.post(action, codigoPainel, successCallback, errorCallback);
        }

        function DesativarDispositivo(codigo, successCallback, errorCallback) {
            var action = '/Paineis/DesativarDispositivo';
            Server.post(action, codigo, successCallback, errorCallback);
        }

        function AplicarFiltroPaineis(obj, successCallback, errorCallback) {
            var action = '/Paineis/AplicarFiltro';
            Server.post(action, obj, successCallback, errorCallback);
        };

        return {
            ComandoPaineis: ComandoPaineis,
            SalvarPainel: SalvarPainel,
            ExcluirPainel: ExcluirPainel,
            DesativarDispositivo: DesativarDispositivo,
            AplicarFiltroPaineis: AplicarFiltroPaineis
        }
    }
})();