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.Map("/admin", adminApp => | |
{ | |
adminApp.Use(async (context, next) => | |
{ | |
context.Request.Path = new PathString($"/admin/{context.Request.Path.Value}"); | |
await next(); | |
}); | |
adminApp.UseSpa(c => | |
{ | |
c.UseProxyToSpaDevelopmentServer(new Uri("http://localhost:3001/admin/")); |
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.Map("/admin", adminApp => { | |
adminApp.UseSpa(c => { | |
c.UseProxyToSpaDevelopmentServer(new Uri("http://localhost:3001/admin/")); | |
}); | |
}); | |
app.UseSpa(c => { | |
c.UseProxyToSpaDevelopmentServer("http://localhost:3000"); | |
}); |
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 class ProductDetailsViewModel | |
{ | |
public string ProductName { get; set; } | |
public decimal UnitPrice { get; set; } | |
public decimal UnitsInStock { get; set; } | |
public bool Discontinued { get; set; } |
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
<div class="form-group col-md-3"> | |
<label for="range">Price range:</label> | |
<input type="text" id="range" readonly style="border: 0px font-weight:bold" /> | |
</div> | |
<div class="form-group col-md-7"> | |
<div id="slider-range"></div> | |
</div> |
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
@using (Ajax.BeginForm("ListProductInRangeAjax", "Product", ajaxOptions, new { @class = "form-inline", style = "margin-bottom: 20px", id = "filter-form" })) | |
{ | |
@*<div class="form-group col-md-5"> | |
<label for="minPrice">Min price:</label> | |
<input type="number" step="0.01" name="minPrice" class="form-control" id="minPrice" /> | |
</div> | |
<div class="form-group col-md-5"> | |
<label for="maxPrice">Max price:</label> | |
<input type="number" step="0.01" name="maxPrice" class="form-control" id="maxPrice" /> |
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
@model Web.ViewModels.EditProductViewModel | |
@{ | |
ViewBag.Title = "Edit"; | |
} | |
<h2>Edit</h2> | |
@using (Html.BeginForm()) | |
{ |
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
@model Web.ViewModels.ProductDetailsViewModel | |
@{ | |
ViewBag.Title = "Details"; | |
} | |
<h2>Details</h2> | |
<div> | |
<h4>ProductDetailsViewModel</h4> |
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 ActionResult MasterDetail() | |
{ | |
return View(productService.ListAllProducts()); | |
} | |
public ActionResult ProductDetails(int productId) | |
{ | |
return Json(productService.GetProduct(productId), JsonRequestBehavior.AllowGet); | |
} |
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
using MVCTanf.Dal; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace MVCTanf.Bll | |
{ | |
public class UserService |
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 bool HasProductWithName(int? productId, string name) | |
{ | |
var items = uow.ProductRepository.List().Where(p => p.ProductName == name); | |
if (productId.HasValue) | |
{ | |
items = items.Where(p => p.ProductId == productId.Value); | |
} | |
return items.Any(); | |
} |
NewerOlder