UNPKG

prg-class

Version:

Clases genéricas utilizadas por microservicios Programamos SPA.

95 lines (94 loc) 3.82 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UploadSave = exports.DeleteSave = exports.CompanySave = exports.QueryOne = exports.QueryAll = void 0; const generic_delete_save_1 = require("./base-class/generic-delete-save"); const query_sp_all_1 = require("./base-class/query-sp-all"); const query_sp_one_1 = require("./base-class/query-sp-one"); const save_sp_1 = require("./base-class/save-sp"); const upload_excel_file_1 = require("./base-class/upload-excel-file"); class QueryAll extends query_sp_all_1.QuerySPAll { constructor() { super(); this.msTitle = 'Informe de...'; this.msSPName = 'database.spNameQueryAll'; } getSPParams(aoParam) { return [ aoParam && aoParam.fieldOne ? aoParam.fieldOne : '', aoParam && aoParam.fieldTwo ? aoParam.fieldTwo : '', aoParam && aoParam.fieldThree ? aoParam.fieldThree : '', ]; } xlsDefExtraField() { const loCol = [ this.fnRowXls('fieldString', 'Caption String', this.miSM, ' ', 'L', 101), // C.jDTT.xText this.fnRowXls('fieldNumber', 'Caption Number', this.miSL, this.msFN0, 'R', 102), // C.jDTT.xNumb this.fnRowXls('fieldDate ', 'Caption Date ', this.miSM, ' ', 'C', 103), // C.jDTT.xDate ]; return loCol; // xText: 101, // Texto hasta 255 caracteres. // xNumb: 102, // Número Entero. // xDate: 103, // Fecha. // xBool: 104, // Boolean (true, false, 1, 0). // xBoTx: 105, // Boolean texto. (Si, No) // xTxEn: 106, // Texto (incluye enter). // xList: 107, // Campo del tipo Select. // xRut: 108, // Campo del tipo rut. // xEmail: 109, // Campo del tipo Email. // xFloat: 110, // Campo del tipo coma flotante. DECIMAL(18,6). // xImg: 111, // Campo de texto con nombre de imagen. // xDateTime: 112, // Fecha Hora. } } exports.QueryAll = QueryAll; class QueryOne extends query_sp_one_1.QuerySPOne { constructor() { super(); this.msSPName = 'database.spNameQueryOne'; } } exports.QueryOne = QueryOne; class CompanySave extends save_sp_1.SaveSP { constructor() { super(); this.msSPName = 'database.spNameSave'; } getSPParams(aoParam) { const loPrm = [ aoParam && aoParam.fieldOne ? aoParam.fieldOne : '', aoParam && aoParam.fieldTwo ? aoParam.fieldTwo : '', aoParam && aoParam.fieldThree ? aoParam.fieldThree : '', ]; return loPrm; } } exports.CompanySave = CompanySave; class DeleteSave extends generic_delete_save_1.GenericDeleteSave { constructor() { super(); this.msSPName = 'database.spNameDelete'; } } exports.DeleteSave = DeleteSave; class UploadSave extends upload_excel_file_1.UploadExcelDataSave { constructor() { super(); this.msSpNameTemp = 'spNameTemporalSave'; this.msSpNameProc = 'spNameProcessSave'; this.msSPName = this.getSpName('database', this.msSpNameTemp); // this.mbHasCompany = false; this.mbHasCompanyUpload = true; this.mlRowStartData = 10; // Fila donde comienza la lista de datos. Generalmente es "10". this.setFldName(); } setFldName() { this.moFields = []; this.setField('NombreCampoStringOpcionalEnExcel'); this.setField('NombreCampoStringObligatorioEnExcel', '', '', true); this.setField('NombreCampoFechaOpcionalEnExcel', '', 'DATE'); this.setField('NombreCampoEnteroOpcionalEnExcel', '', 'INT'); this.setField('NombreCampoDecimalOpcionalEnExcel', '', 'DECIMAL'); this.setField('NombreCampoMonedaOpcionalEnExcel', '', 'MONEY'); } } exports.UploadSave = UploadSave;