Example #1
0
        public int InsertarOactualizarReporteEmpresaServicio(MODPermisoReporte prmReporteEmpresaServicio)
        {
            IModuloDatos moduloDatos = FabricaDatos.CrearModuloDatos;

            var idModuloEmpresaServicio = moduloDatos.InsertarOactualizarReporteEmpresaServicio(prmReporteEmpresaServicio);

            return(idModuloEmpresaServicio);
        }
Example #2
0
        public int InsertarOactualizarReporteEmpresaServicio(MODPermisoReporte prmReporteEmpresaServicio)
        {
            int IdModuloEmpresaServicio = 0;

            using (var conn = ObtenerConexionPrincipal())
            {
                var parametros = new DynamicParameters();
                parametros.Add("@prmIdServicio", prmReporteEmpresaServicio.IdServicio, DbType.Int32);
                parametros.Add("@prmIdEmpresa", prmReporteEmpresaServicio.IdEmpresa, DbType.Int32);
                parametros.Add("@prmIdReporte", prmReporteEmpresaServicio.IdReporte, DbType.Int32);
                parametros.Add("@prmActivo", prmReporteEmpresaServicio.Activo, DbType.Boolean);
                parametros.Add("@prmIdModuloEmpresaServicio", null, DbType.Int32, ParameterDirection.Output);

                conn.QueryMultiple("StpActualizaInsertaReporteEmpresaServicio", parametros, null, commandTimeout: int.MaxValue, System.Data.CommandType.StoredProcedure);

                conn.Close();
            }
            return(IdModuloEmpresaServicio);
        }
Example #3
0
        public MODRespuestaAPI <int> InsertarOactualizarReporteEmpresaServicio([FromBody] MODPermisoReporte prmReporteEmpresaServicio)
        {
            MODRespuestaAPI <int> respuesta = null;
            string         codigoMensaje    = "COMUNES.ERRORSERVICIO";
            IModuloNegocio moduloNegocio    = FabricaNegocio.CrearModuloNegocio;

            try
            {
                int idModuloEmpresaServicio = moduloNegocio.InsertarOactualizarReporteEmpresaServicio(prmReporteEmpresaServicio);

                respuesta = new MODRespuestaAPI <int>(idModuloEmpresaServicio);
            }
            catch (Exception ex)
            {
                Log.WriteLog(ex, "ModuloController.InsertarOactualizarModuloEmpresaServicio", JsonSerializer.Serialize(prmReporteEmpresaServicio), ErrorType.Error);
                respuesta = new MODRespuestaAPI <int>(HttpStatusCode.InternalServerError, codigoMensaje);
            }
            finally
            {
            }

            return(respuesta);
        }