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
| public List<foo> Get_Empty() | |
| { | |
| return new List<foo>(); | |
| } |
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
| store.DatabaseCommands.DeleteByIndex("Foos/QueryByBar", | |
| new IndexQuery | |
| { | |
| Query = "Id:*" | |
| }, allowStale: false); |
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
| public static class QueryableExtensions | |
| { | |
| public static IQueryable<T> Paging<T>(this IQueryable<T> query, int currentPage, int defaultPage, int pageSize) | |
| { | |
| return query | |
| .Skip((currentPage - defaultPage) * pageSize) | |
| .Take(pageSize); | |
| } | |
| } |
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
| '** Doubles up single quotes to stop breakouts from SQL strings ** | |
| Public Shared Function SQLSafe(ByVal strRawText As String) As String | |
| Dim strCleanedText As String = "" | |
| Dim iCharPos As Integer = 1 | |
| Do While iCharPos <= Len(strRawText) | |
| '** Double up single quotes, but only if they aren't already doubled ** | |
| If Mid(strRawText, iCharPos, 1) = "'" Then | |
| strCleanedText = strCleanedText & "''" |
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
| store.DatabaseCommands.DeleteByIndex("Enquiries/MyEnquiryIndexName", | |
| new IndexQuery | |
| { | |
| Query = "Id:*" | |
| }, allowStale: false); |
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
| store.DatabaseCommands.Delete("Raven/Hilo/enquiries", null); |
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
| <system.net> | |
| <mailSettings> | |
| <smtp deliveryMethod="SpecifiedPickupDirectory"> | |
| <specifiedPickupDirectory pickupDirectoryLocation="D:\Projects\temp" /> | |
| <network host="localhost" /> | |
| </smtp> | |
| </mailSettings> | |
| </system.net> |
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 app = angular.module('sample', ['ngSanitize'], function ($routeProvider) { | |
| var $base = "/admin/partial?path=Admin/PartialViews/"; | |
| $routeProvider | |
| .when("/offer", { | |
| templateUrl: $base + 'Offer/list.cshtml', controller: OfferListController, resolve: { | |
| model: function (offerService) { | |
| return offerService.list(); | |
| } | |
| } |
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
| // Route, notice reloadOnSearch is set to false | |
| .when('/enquiry', { | |
| templateUrl: $base + 'Enquiry/list.cshtml', controller: EnquiryListController, reloadOnSearch: false, resolve: { | |
| items: function ($route, enquiryService) { | |
| var page = $route.current.params.page; | |
| if (page == undefined) page = 1; | |
| return enquiryService.list(page); | |
| } |
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
| app.directive("pager", function ($compile) { | |
| function generate(currentPage, totalPages, click) { | |
| // How many adjacent pages should be shown on each side? | |
| var adjacents = 2; | |
| //previous page is page - 1 | |
| var prev = currentPage - 1; | |
| //next page is page + 1 | |
| var next = currentPage + 1; |
OlderNewer