This file contains hidden or 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
| var transaction = new sql.Transaction(connection); | |
| transaction.begin(function(err) { | |
| if(err){ | |
| console.log(1); | |
| console.log(err); | |
| transaction.rollback(function(err){ | |
| res.end("\n"); | |
| }); | |
| return; | |
| } |
This file contains hidden or 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
| DELIMITER $$ | |
| CREATE PROCEDURE CountOrderByStatus( | |
| IN orderStatus VARCHAR(25), | |
| OUT total INT) | |
| BEGIN | |
| SELECT count(orderNumber) | |
| INTO total | |
| FROM orders | |
| WHERE status = orderStatus; | |
| END; |
This file contains hidden or 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
| DELIMITER $$ | |
| CREATE PROCEDURE spGetAll_User() | |
| BEGIN | |
| SELECT * FROM user; | |
| END; | |
| DELIMITER ; | |
| CALL spGetAll_User(); |
This file contains hidden or 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
| <%=typeof(mr)!='undefined'&&typeof(mr.A)!='undefined'&&mr.A!=null?mr.A:''%> |
This file contains hidden or 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
| <% if(typeof(lstComp)!='undefined'){ lstComp.forEach(function(ml){ %> | |
| <option value="<%=ml.cId?ml.cId:''%>" <%=ml.cId&&typeof(mr)!='undefined'&&ml.cId==mr.cId?'selected="selected"':''%>><%=ml.cCode?ml.cCode:''%></option> | |
| <% });}//lstComp %> |
This file contains hidden or 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
| global.encrypt = function(text){ | |
| var cipher = require('crypto').createCipher('aes-256-cbc','sint') | |
| var crypted = cipher.update(text,'utf8','hex') | |
| crypted += cipher.final('hex'); | |
| return crypted; | |
| } | |
| global.decrypt = function(text){ | |
| var decipher = require('crypto').createDecipher('aes-256-cbc','sint') | |
| var decrypted = decipher.update(text,'hex','utf8') |
This file contains hidden or 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
| var pass = require('crypto').createHash('sha256').update(req.body.txtPass).digest("hex"); |
This file contains hidden or 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
| var uData = {FName: req.body.txtFName, ..} | |
| var set = { | |
| uData: JSON.stringify(uData), | |
| } |
This file contains hidden or 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
| <%=typeof(mr)!='undefined'?JSON.parse(mr.uData).Avatar:''%> |
This file contains hidden or 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
| var connection = new sql.Connection(cfg.msdbB, function(err) { | |
| if(err){ console.log(err);} | |
| var request = new sql.Request(connection); | |
| var queryStr = ""; | |
| request.query(queryStr, function(err, row) { | |
| if(err) console.log(err); | |
| //Code here | |
| }); | |
| }); |