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
<head> | |
<!-- include Dropzone css. This is optional, but provides some styling --> | |
<link href="~/Content/dropzone.css" rel="stylesheet"> | |
</head> | |
<body> | |
<!-- include reference to dropzone.js --> | |
<script src="~/scripts/dropzone.js"></script> | |
</body> |
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
<script type="text/javascript"> | |
Dropzone.autoDiscover = false; | |
$(function() { | |
// Now that the DOM is fully loaded, create the dropzone & configuration options | |
var myDropzone = new Dropzone('#my-dropzone', { | |
maxFilesize: 3.0, | |
maxFiles: 10, | |
parallelUploads: 1, |
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
<div id="my-dropzone" action="~/images/upload" class="dropzone"></div> | |
<input type="hidden" value="" id="Files" name="Files" /> |
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
[Route("/images/upload")] | |
public class UploadImage : IReturn<UploadImageResponse> | |
{ | |
} | |
public class UploadImageResponse | |
{ | |
public string Url { get; set; } | |
} |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Threading.Tasks; | |
using ServiceStack; | |
using System.Drawing; | |
using System.Drawing.Drawing2D; |
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
[Route("/listings", "GET")] | |
public class GetListings : IReturn<GetListingsResponse> | |
{ | |
public int? CategoryId { get; set; } | |
public int? PriceFrom { get; set; } | |
public int? PriceTo { get; set; } | |
} | |
public class GetListingsResponse |
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
<form class="form-inline mini" action="~/@(new GetListings().ToGetUrl())" method="GET" style="margin-bottom: 0px;"> | |
<fieldset> | |
<input type="hidden" name="CategoryId" value="@Model.CategoryId"> | |
<div class="row filter-row"> | |
<div class="col-sm-12"> | |
<label>Price range</label> | |
</div> | |
<div class="col-sm-12"> | |
<div class="input-group"> | |
<span class="input-group-addon">N$</span> |
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
[Route("/listings", "GET")] | |
public class GetListings : IReturn<GetListingsResponse> | |
{ | |
// this parameter is used for requesting a specific page | |
public int? PageNr { get; set; } | |
// other default request parameters, not needed for paging but included for illustrative purposes | |
public int? CategoryId { get; set; } | |
public int? PriceFrom { get; set; } | |
public int? PriceTo { get; set; } | |
} |
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
public object GetListings(int? pageNr, int? categoryId, int? priceFrom, int? priceTo) | |
{ | |
} |
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
<script src="~/scripts/jquery.twbsPagination.min.js"></script> | |
<script type="text/javascript"> | |
var requestParameters = document.URL.split('?'); | |
var params = ''; | |
if (requestParameters[1] != null) { | |
var parLines = requestParameters[1].split('&'); | |
var count = 0; | |
while (parLines[count] != null) { | |
var t = parLines[count]; | |
if (t.indexOf('PageNr') === -1) { |
OlderNewer