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
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ItinnovDesign.SoC.WebUI._Default" %> | |
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server"> | |
<form id="form1" runat="server"> | |
<div> | |
<asp:DropDownList AutoPostBack="true" ID="ddlCustomerType" runat="server" > | |
<asp:ListItem Value="0">Standard</asp:ListItem> | |
<asp:ListItem Value="1">Trade</asp:ListItem> |
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.Linq; | |
using System.Web; | |
using System.Web.Optimization; | |
using System.Web.Routing; | |
using System.Web.Security; | |
using System.Web.SessionState; | |
using Autofac; | |
using Autofac.Core; |
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 class ProductListPresenter | |
{ | |
private IProductListView _productListView; | |
private Service.ProductService _productService; | |
public ProductListPresenter(IProductListView ProductListView, Service.ProductService ProductService) | |
{ | |
_productService = ProductService; | |
_productListView = ProductListView; | |
} |
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 interface IProductListView | |
{ | |
void Display(IList<Service.ProductViewModel> Products); | |
Model.CustomerType CustomerType { get; } | |
string ErrorMessage { 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 class ProductRepository : Model.IProductRepository | |
{ | |
public IList<Model.Product> FindAll() | |
{ | |
var products = from p in new ITInnovDesign.SoC.Repository.ProductContext().Products | |
select new Model.Product | |
{ | |
Id = p.ProductId, | |
Name = p.ProductName, | |
Price = new Model.Price(p.Rrp, p.SellingPrice) |
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 class ProductService | |
{ | |
private Model.ProductService _productService; | |
public ProductService(Model.ProductService ProductService) | |
{ | |
_productService = ProductService; | |
} | |
public ProductListResponse GetAllProductsFor(ProductListRequest productListRequest) |
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 static class ProductMapperExtensionMethods | |
{ | |
public static IList<ProductViewModel> ConvertToProductListViewModel(this IList<Model.Product> products) | |
{ | |
IList<ProductViewModel> productViewModels = new List<ProductViewModel>(); | |
foreach(Model.Product p in products) | |
{ | |
productViewModels.Add(p.ConvertToProductViewModel()); | |
} |
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 class ProductListResponse | |
{ | |
public bool Success { get; set; } | |
public string Message { get; set; } | |
public IList<ProductViewModel> Products { 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 class ProductListRequest | |
{ | |
public CustomerType CustomerType { 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 class ProductViewModel | |
{ | |
public int ProductId { get; set; } | |
public string Name { get; set; } | |
public string RRP { get; set; } | |
public string SellingPrice { get; set; } | |
public string Discount { get; set; } | |
public string Savings { get; set; } | |
} |
NewerOlder