C# Class BAL.Manager.CarManager

Inheritance: BAL.Manager.BaseManager, ICarManager
Datei anzeigen Open project: CH033dotNET/Taxi Class Usage Examples

Public Methods

Method Description
CarManager ( IUnitOfWork uOW ) : System
ChangeCarToMain ( int carId, int userId ) : string

Manager method that is used to change car`s isUsed property.

EditCar ( CarDTO car ) : CarDTO

Finds a car entry in repository which id is equal to input object id

EndAllCurrentUserShifts ( int id, string timeStop ) : string

Finishes current driver`s workshift, plus ends all user`s unfinished shifts

EndWorkShiftEvent ( int id ) : void

Ends workshift entry which driver`s id is matching input parameters value

FindMainCar ( int id ) : bool
GetCarByCarID ( int id ) : CarDTO

Gets a car which id is matching the value of input parameter

GetWorkShiftsByWorkerId ( int WorkerId ) : bool

Searches for uncompleted WorkShifts for driver with specific Id. If they are avialable, returns true, if not - false.

GetWorkingDrivers ( ) : IEnumerable

Gets list of workers from a pero by specific criteria. If criteria is not matching returns null

GiveAwayCar ( int CarId, int NewCarUserId ) : string

Manager method that is used to set specific car objects UserId property, used to determine who is currently using specific car.

StartWorkEvent ( int id, string TimeStart ) : void

Starting workshift for a driver which id is matching input parameter`s value

addCar ( CarDTO car ) : void

Adds new Car to repository

deleteCarByID ( int id ) : string

Finds car by it`s id and deletes it

getCars ( ) : IEnumerable

Gets all car entries from repository

getCarsByUserID ( int id ) : IEnumerable

Gets list of cars which user`s id is equal to the value of input parameter

getCarsByUserID ( int id, string parameter ) : IEnumerable

Private Methods

Method Description
MakeACarMain ( Car carToChange ) : string

Private manager method taht is used to change isMain property of a specific car object`s property.

MakeACarMain ( int carId, int userId ) : string

Private manager method taht is used to change isMain property of a specific car object`s property.

NewWorkerShift ( int id ) : void

Creates new workshift entry. WorkEnded property is null

SetCarStateModified ( Car newCarObj, CarDTO inputCarObj ) : CarDTO

Edits car object using values from second input object and maps edited object to another type

Method Details

CarManager() public method

public CarManager ( IUnitOfWork uOW ) : System
uOW IUnitOfWork
return System

ChangeCarToMain() public method

Manager method that is used to change car`s isUsed property.
public ChangeCarToMain ( int carId, int userId ) : string
carId int Input parameter that represents specific car object`s id.
userId int Input parameter that represents id of a current user.
return string

EditCar() public method

Finds a car entry in repository which id is equal to input object id
public EditCar ( CarDTO car ) : CarDTO
car Model.DTO.CarDTO input object
return Model.DTO.CarDTO

EndAllCurrentUserShifts() public method

Finishes current driver`s workshift, plus ends all user`s unfinished shifts
public EndAllCurrentUserShifts ( int id, string timeStop ) : string
id int user`s id
timeStop string
return string

EndWorkShiftEvent() public method

Ends workshift entry which driver`s id is matching input parameters value
public EndWorkShiftEvent ( int id ) : void
id int input parameter
return void

FindMainCar() public method

public FindMainCar ( int id ) : bool
id int
return bool

GetCarByCarID() public method

Gets a car which id is matching the value of input parameter
public GetCarByCarID ( int id ) : CarDTO
id int input parameter
return Model.DTO.CarDTO

GetWorkShiftsByWorkerId() public method

Searches for uncompleted WorkShifts for driver with specific Id. If they are avialable, returns true, if not - false.
public GetWorkShiftsByWorkerId ( int WorkerId ) : bool
WorkerId int drivers id
return bool

GetWorkingDrivers() public method

Gets list of workers from a pero by specific criteria. If criteria is not matching returns null
public GetWorkingDrivers ( ) : IEnumerable
return IEnumerable

GiveAwayCar() public method

Manager method that is used to set specific car objects UserId property, used to determine who is currently using specific car.
public GiveAwayCar ( int CarId, int NewCarUserId ) : string
CarId int Input parameter that represents car object`s id.
NewCarUserId int Input paramenter that represents new car object`s id.
return string

StartWorkEvent() public method

Starting workshift for a driver which id is matching input parameter`s value
public StartWorkEvent ( int id, string TimeStart ) : void
id int input parameter
TimeStart string
return void

addCar() public method

Adds new Car to repository
public addCar ( CarDTO car ) : void
car Model.DTO.CarDTO input object
return void

deleteCarByID() public method

Finds car by it`s id and deletes it
public deleteCarByID ( int id ) : string
id int value that represents car id
return string

getCars() public method

Gets all car entries from repository
public getCars ( ) : IEnumerable
return IEnumerable

getCarsByUserID() public method

Gets list of cars which user`s id is equal to the value of input parameter
public getCarsByUserID ( int id ) : IEnumerable
id int
return IEnumerable

getCarsByUserID() public method

public getCarsByUserID ( int id, string parameter ) : IEnumerable
id int
parameter string
return IEnumerable