Pues bien, hace tiempo me cree este gestor de contraseñas, la verdad es muy basico pero aqui no busco que le den utilidad al mismo, mas bien busco que utilicen el codigo que les sirva.
No pienso explicar el codigo pues de por si es bastante y si lo explico va a quedar un reverendo chorizo de tema, espero me disculpen pero no tengo micro aun, quiza mas tarde haga un video para que los mas novatos lo comprendan. Por el momento solo posteare el codigo dentro de su area asignada:
Licencia:
Puedes utilizar todo el codigo excepto el nombre de referencia Padlock Master pues este nombre lo utilizo para crear mis gestores de contraseñas. Si estas de acuerdo, adelante
Requisitos:No pienso explicar el codigo pues de por si es bastante y si lo explico va a quedar un reverendo chorizo de tema, espero me disculpen pero no tengo micro aun, quiza mas tarde haga un video para que los mas novatos lo comprendan. Por el momento solo posteare el codigo dentro de su area asignada:
Licencia:
Puedes utilizar todo el codigo excepto el nombre de referencia Padlock Master pues este nombre lo utilizo para crear mis gestores de contraseñas. Si estas de acuerdo, adelante

Conocimientos basico-Medio del codigo empleado en ams, conocimientos medios en bases de datos sqlite, conocimientos basicos en objetos de ams.
Ams 8.x
1 Pagina con:
8 xButtons
1 Grid Object
1 DialogEx con:
1 xButton
2 Labels
Codigos:
Global Functions:
sGFolder = Shell.GetFolder(SHF_APPLICATIONDATA).."\\Padlock Master";
sIniPath = sGFolder.."\\Configuration.ini";
dbFile = sGFolder.."\\Database.db";
db = SQLite.Open(dbFile);
--
nError = Application.GetLastError();
--
Database = {}
function GET_DB_ERROR(nError)
if (nError ~= SQLite.OK) then
return Dialog.Message("Error", _tblErrorMessages[nError], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
else
return false;
end
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function Database.Create(dbFile, nError)
local i;
local v;
tbQ = {"CREATE TABLE Sites(id NUMERIC, Site TEXT, User TEXT, Email TEXT, Password TEXT)",
"CREATE TABLE Emails(id NUMERIC, Site TEXT, User TEXT, Email TEXT, Password TEXT)",
"CREATE TABLE Hostings(id NUMERIC, Site TEXT, User TEXT, Email TEXT, Password TEXT)"
}
for i, v in pairs(tbQ) do
SQLite.Query(db, v, nil);
GET_DB_ERROR(nError)
Application.Sleep(10);
end
--[[
for t=1, 25, 1 do
SQLite.QueryToTable(db, "INSERT INTO Sites VALUES('"..t.."', 'Mega Uploads', 'Metafunken Rules', '[email protected]', 'metametamsjsj')")
SQLite.QueryToTable(db, "INSERT INTO Emails VALUES('"..t.."', 'Mega Uploads', 'Metafunken Rules', '[email protected]', 'metametamsjsj')")
SQLite.QueryToTable(db, "INSERT INTO Hostings VALUES('"..t.."', 'Mega Uploads', 'Metafunken Rules', '[email protected]', 'metametamsjsj')")
end
]]
SQLite.Finalize(db);
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function Database.Update(bSite, bEmail, bHosting, nRows, nCols)
if (bSite == true) then-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
local ic;
local ir;
local iup;
local vup;
tbUp_Site = {}
for ic=0, nCols, 1 do
for ir=1, nRows, 1 do
tbUp_Site[ic] = Grid.GetCellText("Grid1", ir, ic);
for iup, vup in pairs(tbUp_Site) do
if (vup ~= "") then
if (iup == 1) then
SQLite.Query(db, "UPDATE Sites SET Site='"..vup.."' WHERE id ='"..ir.."'", nil);
end
if (iup == 2) then
SQLite.Query(db, "UPDATE Sites SET User='"..vup.."' WHERE id ='"..ir.."'", nil);
end
if (iup == 3) then
SQLite.Query(db, "UPDATE Sites SET Email='"..vup.."' WHERE id ='"..ir.."'", nil);
end
if (iup == 4) then
SQLite.Query(db, "UPDATE Sites SET Password='"..Crypto.BlowfishEncryptString(vup, "METAFUNKENrulesTheWorld1977AHUEVO", 0).."' WHERE id ='"..ir.."'", nil);
end
Application.Sleep(1);
end
end
end
end
GridSetSitesData()
end
if (bEmail == true) then-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
local ic;
local ir;
local iup;
local vup;
tbUp_Email = {}
for ic=0, nCols, 1 do
for ir=1, nRows, 1 do
tbUp_Email[ic] = Grid.GetCellText("Grid1", ir, ic);
for iup, vup in pairs(tbUp_Email) do
if (vup ~= "") then
if (iup == 1) then
SQLite.Query(db, "UPDATE Emails SET Site='"..vup.."' WHERE id ='"..ir.."'", nil);
end
if (iup == 2) then
SQLite.Query(db, "UPDATE Emails SET User='"..vup.."' WHERE id ='"..ir.."'", nil);
end
if (iup == 3) then
SQLite.Query(db, "UPDATE Emails SET Email='"..vup.."' WHERE id ='"..ir.."'", nil);
end
if (iup == 4) then
SQLite.Query(db, "UPDATE Emails SET Password='"..Crypto.BlowfishEncryptString(vup, "METAFUNKENrulesTheWorld1977AHUEVO", 0).."' WHERE id ='"..ir.."'", nil);
end
Application.Sleep(1);
end
end
end
end
GridSetEmailsData()
end
if (bHosting == true) then-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
local ic;
local ir;
local iup;
local vup;
tbUp_Hosting = {}
for ic=0, nCols, 1 do
for ir=1, nRows, 1 do
tbUp_Hosting[ic] = Grid.GetCellText("Grid1", ir, ic);
for iup, vup in pairs(tbUp_Hosting) do
if (vup ~= "") then
if (iup == 1) then
SQLite.Query(db, "UPDATE Hostings SET Site='"..vup.."' WHERE id ='"..ir.."'", nil);
end
if (iup == 2) then
SQLite.Query(db, "UPDATE Hostings SET User='"..vup.."' WHERE id ='"..ir.."'", nil);
end
if (iup == 3) then
SQLite.Query(db, "UPDATE Hostings SET Email='"..vup.."' WHERE id ='"..ir.."'", nil);
end
if (iup == 4) then
SQLite.Query(db, "UPDATE Hostings SET Password='"..Crypto.BlowfishEncryptString(vup, "METAFUNKENrulesTheWorld1977AHUEVO", 0).."' WHERE id ='"..ir.."'", nil);
end
Application.Sleep(1);
end
end
end
end
GridSetHostingsData()
end
GridSetColors()
GridAutosize()
Grid.AutoSizeColumn("Grid1", 0, GVS_BOTH, false, true);
SQLite.Finalize(db);
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function Database.Delete(bSite, bEmail, bHosting, nRows, nCols, nGridSelected)
if (bSite == true) then
--SQLite.Query(db, "DELETE FROM Sites WHERE id='"..nGridSelected.."'", nil)--DELETE
SQLite.Query(db, "UPDATE Sites SET Site='', User='', Email='', Password='' WHERE id ='"..String.ToNumber(nGridSelected).."'", nil);
--Grid.DeleteRow("Grid1", nGridSelected, true);
GridSetSitesData()
SQLite.Finalize(db);
end
if (bEmail == true) then
SQLite.Query(db, "UPDATE Emails SET Site='', User='', Email='', Password='' WHERE id ='"..String.ToNumber(nGridSelected).."'", nil);
GridSetEmailsData()
SQLite.Finalize(db);
end
if (bHosting == true) then
SQLite.Query(db, "UPDATE Hostings SET Site='', User='', Email='', Password='' WHERE id ='"..String.ToNumber(nGridSelected).."'", nil);
GridSetHostingsData()
SQLite.Finalize(db);
end
GridSetColors()
GridAutosize()
Grid.AutoSizeColumn("Grid1", 0, GVS_BOTH, false, true);
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function GridSetHeader()
tbText = {"ID", "Site", "User", "Email", "Password"}
for is, vs in pairs(tbText) do
is = is - 1;
Grid.SetCellText("Grid1", 0, is, vs, true)
end
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function GridAutosize()
Grid.AutoSizeColumns("Grid1", GVS_BOTH, true);
n_1_WG = Grid.GetColumnWidth("Grid1", 0);
n_2_WG = Grid.GetColumnWidth("Grid1", 1);
n_3_WG = Grid.GetColumnWidth("Grid1", 2);
n_4_WG = Grid.GetColumnWidth("Grid1", 3);
n_5_WG = Grid.GetColumnWidth("Grid1", 4);
nTotalGW = (n_1_WG + n_2_WG + n_3_WG + n_4_WG + n_5_WG);
if (nTotalGW >= 600) then
nTotalGW = 600;
end
if (nTotalGW < 600) then
nTotalGW = 600;
end
Grid.SetSize("Grid1", nTotalGW, Grid.GetSize("Grid1").Height);
Grid.ExpandColumnsToFit("Grid1", false, true);
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function GridSetColors()
nRows_G = Grid.GetRowCount("Grid1");
nCols_G = Grid.GetColumnCount("Grid1");
nColor1 = Grid.MakeColorRGB(200, 200, 200);--Dark
nColor2 = Grid.MakeColorRGB(230, 230, 230);--Light
for icC=1, nCols_G do
nColor = nColor1;
for irC=1, nRows_G do--ir=1
if (nColor == nColor1) then
nColor = nColor2;
else
nColor = nColor1;
end
Grid.SetCellColors("Grid1", irC, icC, {Background=nColor});
end
end
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function GridSetIniHeaders()
local INDEXI;
for INDEXI=1, 5 do
INDEXI = INDEXI;
Grid.InsertColumn("Grid1", INDEXI, true);
Grid.SetColumnCount("Grid1", INDEXI);
end
GridSetHeader()
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function GridSetSitesData()
local INDEXS;
local tbIni_Site = SQLite.QueryToTable(db, "SELECT * FROM Sites");
if (tbIni_Site.Rows > 0) then
for INDEXS=1, (tbIni_Site.Rows) do
Grid.InsertRow("Grid1", INDEXS+1, true);
Grid.SetRowCount("Grid1", tbIni_Site.Data[INDEXS]["id"]+1)
end
for INDEXS=1, (tbIni_Site.Columns) do
Grid.InsertColumn("Grid1", INDEXS, true);
Grid.SetColumnCount("Grid1", INDEXS)
end
end
Grid.SetFixedColumnCount("Grid1", 1)
Grid.SetFixedRowCount("Grid1", 1)
GridSetHeader()
local icS;
local irS;
--
Grid.SetRedraw("Grid1", false, false);
nRows_S = Grid.GetRowCount("Grid1");
nCols_S = Grid.GetColumnCount("Grid1");
tbInsert_Sites = {}
for icS=0, nCols_S, 1 do
for irS=1, nRows_S, 1 do
tbRSites = SQLite.QueryToTable(db, "SELECT * FROM Sites WHERE id = '"..irS.."'");
for inS=1, (tbRSites.Rows), 1 do
tbInsert_Sites[1] = string.format("%03d",tbRSites.Data[inS]["id"]);
tbInsert_Sites[2] = tbRSites.Data[inS]["Site"];
tbInsert_Sites[3] = tbRSites.Data[inS]["User"];
tbInsert_Sites[4] = tbRSites.Data[inS]["Email"];
tbInsert_Sites[5] = Crypto.BlowfishDecryptString(tbRSites.Data[inS]["Password"], "METAFUNKENrulesTheWorld1977AHUEVO");
for instS, vstS in pairs(tbInsert_Sites) do
instS = instS - 1;
if (instS == icS) then
Grid.SetCellText("Grid1", irS, instS, vstS, true);
end
end
end
Grid.SetCellText("Grid1", irS, 0, string.format("%03d", irS), true);
end
end
Grid.SetRedraw("Grid1", true, true);
--
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function GridSetEmailsData()
local INDEXE;
local tbIni_Emails = SQLite.QueryToTable(db, "SELECT * FROM Emails");
if (tbIni_Emails.Rows ~= 0) then
for INDEXE=1, (tbIni_Emails.Rows) do
Grid.InsertRow("Grid1", INDEXE+1, true);
Grid.SetRowCount("Grid1", tbIni_Emails.Data[INDEXE]["id"]+1)
end
for INDEXE=1, (tbIni_Emails.Columns) do
Grid.InsertColumn("Grid1", INDEXE, true);
Grid.SetColumnCount("Grid1", INDEXE)
end
end
Grid.SetFixedColumnCount("Grid1", 1)
Grid.SetFixedRowCount("Grid1", 1)
GridSetHeader()
local icS;
local irS;
--
Grid.SetRedraw("Grid1", false, false);
nRows_E = Grid.GetRowCount("Grid1");
nCols_E = Grid.GetColumnCount("Grid1");
tbInsert_Emails = {}
for icE=0, nCols_E, 1 do
for irE=1, nRows_E, 1 do
tbREmails = SQLite.QueryToTable(db, "SELECT * FROM Emails WHERE id = '"..irE.."'");
for inE=1, (tbREmails.Rows), 1 do
tbInsert_Emails[1] = string.format("%03d",tbREmails.Data[inE]["id"]);
tbInsert_Emails[2] = tbREmails.Data[inE]["Site"];
tbInsert_Emails[3] = tbREmails.Data[inE]["User"];
tbInsert_Emails[4] = tbREmails.Data[inE]["Email"];
tbInsert_Emails[5] = Crypto.BlowfishDecryptString(tbREmails.Data[inE]["Password"], "METAFUNKENrulesTheWorld1977AHUEVO");
for instE, vstE in pairs(tbInsert_Emails) do
instE = instE - 1;
if (instE == icE) then
Grid.SetCellText("Grid1", irE, instE, vstE, true);
end
end
Grid.SetCellText("Grid1", irE, 0, string.format("%03d", irE), true);
end
end
end
Grid.SetRedraw("Grid1", true, true);
--
end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function GridSetHostingsData()
local INDEXH;
local tbIni_Hostings = SQLite.QueryToTable(db, "SELECT * FROM Hostings");
if (tbIni_Hostings.Rows ~= 0) then
for INDEXH=1, (tbIni_Hostings.Rows) do
Grid.InsertRow("Grid1", INDEXH+1, true);
Grid.SetRowCount("Grid1", tbIni_Hostings.Data[INDEXH]["id"]+1)
end
for INDEXH=1, (tbIni_Hostings.Columns) do
Grid.InsertColumn("Grid1", INDEXH, true);
Grid.SetColumnCount("Grid1", INDEXH)
end
end
Grid.SetFixedColumnCount("Grid1", 1)
Grid.SetFixedRowCount("Grid1", 1)
GridSetHeader()
local icH;
local irH;
--
Grid.SetRedraw("Grid1", false, false);
nRows_H = Grid.GetRowCount("Grid1");
nCols_H = Grid.GetColumnCount("Grid1");
tbInsert_Hostings = {}
for icH=0, nCols_H, 1 do
for irH=1, nRows_H, 1 do
tbRHostings = SQLite.QueryToTable(db, "SELECT * FROM Hostings WHERE id = '"..irH.."'");
for inH=1, (tbRHostings.Rows), 1 do
tbInsert_Hostings[1] = string.format("%03d",tbRHostings.Data[inH]["id"]);
tbInsert_Hostings[2] = tbRHostings.Data[inH]["Site"];
tbInsert_Hostings[3] = tbRHostings.Data[inH]["User"];
tbInsert_Hostings[4] = tbRHostings.Data[inH]["Email"];
tbInsert_Hostings[5] = Crypto.BlowfishDecryptString(tbRHostings.Data[inH]["Password"], "METAFUNKENrulesTheWorld1977AHUEVO");
for instH, vstH in pairs(tbInsert_Hostings) do
instH = instH - 1;
if (instH == icH) then
Grid.SetCellText("Grid1", irH, instH, vstH, true);
end
end
Grid.SetCellText("Grid1", irH, 0, string.format("%03d", irH), true);
end
end
end
Grid.SetRedraw("Grid1", true, true);
--
end
if not (Folder.DoesExist(sGFolder)) then
Folder.Create(sGFolder);
end
Database.Create(dbFile, nError);
bSite = false;
bEmail = false;
bHosting = false;
local nPasswordMe = DialogEx.Show("Password", false);
if (nPasswordMe == 0) then
Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);
end
On Show:
GridSetHeader();
On Click
bSite = true;
bEmail = false;
bHosting = false;
Grid.DeleteAllItems("Grid1");
if (bSite == true) then
GridSetSitesData()
end
if (bEmail == true) then
GridSetEmailsData()
end
if (bHosting == true) then
GridSetHostingsData()
end
if (String.ToNumber(Grid.GetColumnCount("Grid1")) == 1) then
GridSetIniHeaders()
end
GridSetColors()
GridAutosize()
Grid.AutoSizeColumn("Grid1", 0, GVS_BOTH, false, true);
On Click
bSite = false;
bHosting = false;
bEmail = true;
Grid.DeleteAllItems("Grid1");
if (bSite == true) then
GridSetSitesData()
end
if (bEmail == true) then
GridSetEmailsData()
end
if (bHosting == true) then
GridSetHostingsData()
end
if (String.ToNumber(Grid.GetColumnCount("Grid1")) == 1) then
GridSetIniHeaders()
end
GridSetColors()
GridAutosize()
Grid.AutoSizeColumn("Grid1", 0, GVS_BOTH, false, true);
On Click
bHosting = true;
bEmail = false;
bSite = false;
Grid.DeleteAllItems("Grid1");
if (bSite == true) then
GridSetSitesData()
end
if (bEmail == true) then
GridSetEmailsData()
end
if (bHosting == true) then
GridSetHostingsData()
end
if (String.ToNumber(Grid.GetColumnCount("Grid1")) == 1) then
GridSetIniHeaders()
end
GridSetColors()
GridAutosize()
Grid.AutoSizeColumn("Grid1", 0, GVS_BOTH, false, true);
On Click
local nInsertPos = Dialog.Input("Escoja la posicion", "Seleccione una posicion valida", (Grid.GetRowCount("Grid1")), MB_ICONNONE);
if (nInsertPos ~= "CANCEL") and (nInsertPos ~= "") then
nInsertPos = String.ToNumber(nInsertPos);
local nTextPos = tostring(string.format("%03d", nInsertPos));
if (nInsertPos > Grid.GetRowCount("Grid1")-1) then
Grid.InsertRow("Grid1", -1, true);
else
Grid.InsertRow("Grid1", nInsertPos, true);
end
Grid.SetCellText("Grid1", nInsertPos, 0, nTextPos, true);
end
nGridSelected = nil;
On Click
if (nGridSelected ~= nil) then
if (String.ToNumber(nGridSelected) > 0) then
if (bSite == true) then
local tbCSites = SQLite.QueryToTable(db, "SELECT * FROM Sites");
nEndingSites = 0;
for icsi=1, (tbCSites.Rows) do
if (String.ToNumber(nGridSelected) == String.ToNumber(tbCSites.Data[icsi]["id"])) then
nEndingSites = nEndingSites + 1;
break;
end
end
if (nEndingSites == 1) then
Dialog.Message("Error", "Usted debe actualizar el numero "..nGridSelected.." que ha seleccionado!", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
nGridSelected = nil;
Application.ExitScript();
end
SQLite.QueryToTable(db, "INSERT INTO Sites VALUES('"..Grid.GetCellText("Grid1", String.ToNumber(nGridSelected), 0).."', '"..Grid.GetCellText("Grid1", nGridSelected, 1).."', '"..Grid.GetCellText("Grid1", nGridSelected, 2).."', '"..Grid.GetCellText("Grid1", nGridSelected, 3).."', '"..Crypto.BlowfishEncryptString(Grid.GetCellText("Grid1", nGridSelected, 4), "METAFUNKENrulesTheWorld1977AHUEVO", 0).."')")
GridSetSitesData()
end
if (bEmail == true) then
local tbCEmails = SQLite.QueryToTable(db, "SELECT * FROM Emails");
nEndingEmails = 0;
for icsi=1, (tbCEmails.Rows) do
if (String.ToNumber(nGridSelected) == String.ToNumber(tbCEmails.Data[icsi]["id"])) then
nEndingEmails = nEndingEmails + 1;
break;
end
end
if (nEndingEmails == 1) then
Dialog.Message("Error", "Usted debe actualizar el numero "..nGridSelected.." que ha seleccionado!", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
nGridSelected = nil;
Application.ExitScript();
end
SQLite.QueryToTable(db, "INSERT INTO Emails VALUES('"..Grid.GetCellText("Grid1", String.ToNumber(nGridSelected), 0).."', '"..Grid.GetCellText("Grid1", nGridSelected, 1).."', '"..Grid.GetCellText("Grid1", nGridSelected, 2).."', '"..Grid.GetCellText("Grid1", nGridSelected, 3).."', '"..Crypto.BlowfishEncryptString(Grid.GetCellText("Grid1", nGridSelected, 4), "METAFUNKENrulesTheWorld1977AHUEVO", 0).."')")
GridSetEmailsData()
end
if (bHosting == true) then
local tbCHostings = SQLite.QueryToTable(db, "SELECT * FROM Hostings");
nEndingHostings = 0;
for icsi=1, (tbCHostings.Rows) do
if (String.ToNumber(nGridSelected) == String.ToNumber(tbCHostings.Data[icsi]["id"])) then
nEndingHostings = nEndingHostings + 1;
break;
end
end
if (nEndingHostings == 1) then
Dialog.Message("Error", "Usted debe actualizar el numero "..nGridSelected.." que ha seleccionado!", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
nGridSelected = nil;
Application.ExitScript();
end
SQLite.QueryToTable(db, "INSERT INTO Hostings VALUES('"..Grid.GetCellText("Grid1", String.ToNumber(nGridSelected), 0).."', '"..Grid.GetCellText("Grid1", nGridSelected, 1).."', '"..Grid.GetCellText("Grid1", nGridSelected, 2).."', '"..Grid.GetCellText("Grid1", nGridSelected, 3).."', '"..Crypto.BlowfishEncryptString(Grid.GetCellText("Grid1", nGridSelected, 4), "METAFUNKENrulesTheWorld1977AHUEVO", 0).."')")
GridSetHostingsData()
end
end
else
Dialog.Message("Error", "Nothing selected.", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
Application.ExitScript();
end
if (bSite == true) then
Page.ClickObject("xSites");
end
if (bEmail == true) then
Page.ClickObject("xEmails");
end
if (bHosting == true) then
Page.ClickObject("xHostings");
end
nGridSelected = nil;
On Click
nRows = Grid.GetRowCount("Grid1");
nCols = Grid.GetColumnCount("Grid1");
Database.Update(bSite, bEmail, bHosting, nRows, nCols)
if (bSite == true) then
Page.ClickObject("xSites");
end
if (bEmail == true) then
Page.ClickObject("xEmails");
end
if (bHosting == true) then
Page.ClickObject("xHostings");
end
nGridSelected = nil;
On Click
if (nGridSelected == nil) then
Application.ExitScript();
end
local nDelQ = Dialog.Message("Confirmacion", "Esta seguro que desea limpiar todos los datos de los campos en la fila seleccionada?\r\nTome en cuenta que no se eliminara de la base de datos, solo seran limpiados todos los campos.", MB_OKCANCEL, MB_ICONQUESTION, MB_DEFBUTTON2)
if (nDelQ == IDCANCEL) then
Application.ExitScript();
end
if (nDelQ == IDOK) then
nRows = Grid.GetRowCount("Grid1");
nCols = Grid.GetColumnCount("Grid1");
if (String.ToNumber(nRows) > 0) then
Database.Delete(bSite, bEmail, bHosting, nRows, nCols, nGridSelected);
end
end
if (bSite == true) then
Page.ClickObject("xSites");
end
if (bEmail == true) then
Page.ClickObject("xEmails");
end
if (bHosting == true) then
Page.ClickObject("xHostings");
end
nGridSelected = nil;
On Click
if (nGridSelected == nil) then
Application.ExitScript();
end
if (String.Find(Grid.GetCellText("Grid1", nGridSelected, 1), "www.", 1, true) ~= -1) then
File.OpenURL(Grid.GetCellText("Grid1", nGridSelected, 1), SW_SHOWNORMAL);
else
Dialog.Message("Error", "It seems that this is not a valid URL, for example, should be something like: http://www.somesite.com\r\n\r\nModify it and try again.", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
end
nGridSelected = nil;
On Selection Changed
nGridSelected = e_Row;
Descarga: Mega
Si tienes dudas acerca de como funciona el codigo pues al area correspondiente, es un codigo muy basico pero aun asi podria haberlas. Si no respondo seguramente alguien mas lo hara

Que la disfrutes!
Nota:
La interface es una basofia, es uno de mis "test", por supuesto que tu puedes mejorarla y bastante asi como simplificar el codigo


Saludos
