This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.autoGroup = function (selector) { | |
var elem = $(this); | |
let a = []; | |
selector = selector || "data-group"; | |
elem.find("option").appendTo(elem); //remove options dentro de optgroups e coloca no select | |
elem.find("optgroup").remove(); // remove optgroups | |
elem.find("[" + selector + "]").each(function (index) { | |
a.push($(this).attr(selector)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ============================================= | |
-- Author: Zonaro | |
-- Create date: 26/01/2022 | |
-- Description: Retorna o primeiro ou o ultimo dia do mes a partir da MesAno especificada (4 digitos) | |
-- ============================================= | |
CREATE OR ALTER FUNCTION [dbo].[DataMesAno] | |
( | |
@MesAno varchar(4), -- Exemplo '0123' => Janeiro/2023 | |
@FimDoMes bit = 0 -- 1 para 31-01-2023 | 0 para 01-01-2023 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE or ALTER PROC [dbo].[CreateInsertUpdateProcedure] | |
@TableName sysname, | |
@AutoCreate bit = 0 | |
as | |
if((select count(TABLE_NAME) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = @TableName)>1) | |
begin | |
declare @variables as varchar(max) = 'create or alter proc piu'+@TableName+CHAR(13) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or ALTER procedure [dbo].[GenerateClass] (@TableName sysname = null, @GenerateProperties bit = 1, @PlainTextClass bit = 0) | |
as | |
BEGIN | |
declare @Result varchar(max) = 'namespace ' + replace(replace(replace(DB_NAME(),' ','_'),'.','_'),'~','_') + ' | |
{' | |
DECLARE the_cursor CURSOR FAST_FORWARD | |
FOR SELECT TABLE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.oldAlert = window.alert | |
window.alert = function (message) { | |
var __notification = null; | |
if (!("Notification" in window)) { | |
window.oldAlert(message); | |
} else if (Notification.permission === "granted") { | |
__notification = new Notification(message); | |
} else if (Notification.permission !== 'denied') { | |
Notification.requestPermission(function (permission) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ============================================= | |
-- Author: Zonaro | |
-- Create date: 30/03/2023 | |
-- Description: Return a replacement value if expression is null or contains only whitespace | |
-- ============================================= | |
CREATE FUNCTION IfBlank | |
( | |
@expression varchar(max), | |
@replacement varchar(max) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Data; | |
using System.Globalization; | |
using System.Text.RegularExpressions; | |
/* | |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
* This file add overloads for each Dapper.SQLMapper method, allowing the use of FormattableString * | |
* for building parametrized queries. Each parameter of string will be converted into a SQL parameter. * | |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR ALTER PROCEDURE [dbo].[GenerateDartClass] (@TableName sysname = null) | |
AS | |
BEGIN | |
DECLARE @Result VARCHAR(MAX) = '' | |
DECLARE the_cursor CURSOR FAST_FORWARD | |
FOR | |
SELECT TABLE_NAME | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE (TABLE_TYPE = 'BASE TABLE' OR TABLE_TYPE = 'VIEW') AND ISNULL(@TableName, TABLE_NAME) = TABLE_NAME |