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
HttpFileCollection uploadFiles = Request.Files; | |
// Build HTML listing the files received. | |
string summary = "<p>Files Uploaded:</p><ol>"; | |
// Loop over the uploaded files and save to disk. | |
int i; | |
for (i = 0; i < uploadFiles.Count; i++) | |
{ | |
HttpPostedFile postedFile = uploadFiles[i]; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
@model ViewModels.IProjectViewModel | |
@{ | |
var projects = Model.GetProjects(Model.ProjectModel.Id); | |
ViewBag.Title = "All Projects View"; | |
} | |
@section scripts { | |
<script> | |
$(function () { |
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
ALTER PROCEDURE [dbo].[usp_SaveSearch] | |
@userId INT, | |
@searchId INT = 0, | |
@searchName VARCHAR(250) = '', | |
@searchCriteria dbo.TvpItem readonly | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
IF (@searchID = 0) |
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 TABLE #codes ( code VARCHAR(10)) | |
INSERT INTO #codes( code ) | |
SELECT distinct c.someCode FROM dbo.tbl_Sample c WITH(NOLOCK) WHERE c.isDeleted=0 AND NOT ISNULL(c.parts,'')='C' | |
AND c.someDate1 >= @anotherDate AND c.someDate1 <= @endDate | |
AND c.providerID IN (SELECT userId from #tmpTable) | |
ORDER by c.someCode | |
-- Temp table for output | |
CREATE TABLE #tbl_Sample2 (userid INT, employee VARCHAR(200), type VARCHAR(150), results INT null) |
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
-- Calculate paging | |
DECLARE @topRecord VARCHAR(20) = CAST(((@pageSize+@offset)+1) AS VARCHAR) | |
DECLARE @cte_query NVARCHAR(MAX) | |
SET @cte_query = WITH cte_res | |
AS ( SELECT ROW_NUMBER() OVER(ORDER BY ['+@sortBy+'] '+@sortDir+') AS rowid, count(*) over() as TotalRecords,* from (SELECT * FROM #someTable WITH(NOLOCK)) as table1) | |
select rowID, TotalRecords, id, someField from cte_res with(nolock) where rowid>'+ CAST(@offset AS VARCHAR) +' and rowid< ' + @topRecord | |
EXECUTE sp_executesql @cte_query |
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
(function(app) { | |
app.controller('Ctrl', Ctrl); | |
app.controller('CtrlModal', CtrlModal); | |
//Ctrl.$inject = ['$scope', '$modal', 'dataservice']; | |
function Ctrl($scope, $modal, dataservice) { | |
var vm = this; |
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
angular.module("exampleApp", []).service('exampleService', ["$http", "$q" ,function ($http, $q) { | |
var service = { | |
returnedData: [], | |
dataLoaded:{}, | |
getData = function(forceRefresh) | |
{ | |
var deferred = $q.defer(); | |
if(!service.dataLoaded.genericData || forceRefresh) | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script data-require="angular.js@*" data-semver="1.3.5" src="https://code.angularjs.org/1.3.5/angular.js"></script> | |
<script src="https://code.angularjs.org/1.3.5/angular-route.js" data-semver="1.3.5" data-require="angular-route@*"></script> | |
<script data-require="angular-resource@1.3.5" data-semver="1.3.5" src="https://code.angularjs.org/1.3.5/angular-resource.js"></script> | |
<link href="style.css" rel="stylesheet" /> | |
<script src="script.js"></script> | |
</head> |
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
scoreInput.$inject = []; | |
function scoreInput() { | |
return <ng.IDirective>{ | |
restrict: 'E', | |
replace: true, | |
scope: { | |
model: '=ngModel', | |
isRequired: '=', | |
isReadonly: '=', |
OlderNewer