C# Class openTill.Domain.Services.SaleService

A road map to perform the CRUD operations for a Sale object.
Inheritance: ISaleService
Mostra file Open project: CIT275DevGroup/openTill

Public Methods

Method Description
FinalizeSale ( SaleDTO sale ) : SaleDTO

Method calculates sale total and tax.

GetSalesByEmployee ( string userName ) : List

Method returns all sales based on employee username.

Insert ( SaleDTO sale ) : void

Method inserts a new sale into the database

SaleService ( ISaleRepository saleRepository ) : System

A constructor that requires a repository as a parameter.

Update ( SaleDTO sale ) : void

Method updates a sale that already exists in the database

Method Details

FinalizeSale() public method

Method calculates sale total and tax.
public FinalizeSale ( SaleDTO sale ) : SaleDTO
sale openTill.Domain.DTO.SaleDTO Method takes on SaleDTO as an argument.
return openTill.Domain.DTO.SaleDTO

GetSalesByEmployee() public method

Method returns all sales based on employee username.
public GetSalesByEmployee ( string userName ) : List
userName string Accepts a single username in the form of a string.
return List

Insert() public method

Method inserts a new sale into the database
public Insert ( SaleDTO sale ) : void
sale openTill.Domain.DTO.SaleDTO Takes a single SaleDTO as an argument.
return void

SaleService() public method

A constructor that requires a repository as a parameter.
public SaleService ( ISaleRepository saleRepository ) : System
saleRepository ISaleRepository Repository to be used.
return System

Update() public method

Method updates a sale that already exists in the database
public Update ( SaleDTO sale ) : void
sale openTill.Domain.DTO.SaleDTO Takes a single SaleDTO as an argument.
return void