C# Класс BAL.Manager.CarManager

Наследование: BAL.Manager.BaseManager, ICarManager
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

CarManager() публичный Метод

public CarManager ( IUnitOfWork uOW ) : System
uOW IUnitOfWork
Результат System

ChangeCarToMain() публичный Метод

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.
Результат string

EditCar() публичный Метод

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
Результат Model.DTO.CarDTO

EndAllCurrentUserShifts() публичный Метод

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
Результат string

EndWorkShiftEvent() публичный Метод

Ends workshift entry which driver`s id is matching input parameters value
public EndWorkShiftEvent ( int id ) : void
id int input parameter
Результат void

FindMainCar() публичный Метод

public FindMainCar ( int id ) : bool
id int
Результат bool

GetCarByCarID() публичный Метод

Gets a car which id is matching the value of input parameter
public GetCarByCarID ( int id ) : CarDTO
id int input parameter
Результат Model.DTO.CarDTO

GetWorkShiftsByWorkerId() публичный Метод

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
Результат bool

GetWorkingDrivers() публичный Метод

Gets list of workers from a pero by specific criteria. If criteria is not matching returns null
public GetWorkingDrivers ( ) : IEnumerable
Результат IEnumerable

GiveAwayCar() публичный Метод

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.
Результат string

StartWorkEvent() публичный Метод

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
Результат void

addCar() публичный Метод

Adds new Car to repository
public addCar ( CarDTO car ) : void
car Model.DTO.CarDTO input object
Результат void

deleteCarByID() публичный Метод

Finds car by it`s id and deletes it
public deleteCarByID ( int id ) : string
id int value that represents car id
Результат string

getCars() публичный Метод

Gets all car entries from repository
public getCars ( ) : IEnumerable
Результат IEnumerable

getCarsByUserID() публичный Метод

Gets list of cars which user`s id is equal to the value of input parameter
public getCarsByUserID ( int id ) : IEnumerable
id int
Результат IEnumerable

getCarsByUserID() публичный Метод

public getCarsByUserID ( int id, string parameter ) : IEnumerable
id int
parameter string
Результат IEnumerable