nitro-react/src/api/catalog/RequestedPage.ts

64 lines
1.5 KiB
TypeScript
Raw Normal View History

2022-01-16 05:56:31 +01:00
export class RequestedPage
{
public static REQUEST_TYPE_NONE: number = 0;
public static REQUEST_TYPE_ID: number = 1;
2022-01-20 09:03:21 +01:00
public static REQUEST_TYPE_OFFER: number = 2;
public static REQUEST_TYPE_NAME: number = 3;
2022-01-16 05:56:31 +01:00
private _requestType: number;
2022-01-19 08:22:30 +01:00
private _requestById: number;
2022-01-20 09:03:21 +01:00
private _requestedByOfferId: number;
2022-01-19 08:22:30 +01:00
private _requestByName: string;
2022-01-16 05:56:31 +01:00
constructor()
{
this._requestType = RequestedPage.REQUEST_TYPE_NONE;
}
2022-01-19 08:22:30 +01:00
public resetRequest():void
2022-01-16 05:56:31 +01:00
{
2022-01-19 08:22:30 +01:00
this._requestType = RequestedPage.REQUEST_TYPE_NONE;
2022-01-20 09:03:21 +01:00
this._requestById = -1;
this._requestedByOfferId = -1;
this._requestByName = null;
2022-01-16 05:56:31 +01:00
}
2022-01-19 08:22:30 +01:00
public get requestType(): number
2022-01-16 05:56:31 +01:00
{
2022-01-19 08:22:30 +01:00
return this._requestType;
2022-01-16 05:56:31 +01:00
}
2022-01-19 08:22:30 +01:00
public get requestById(): number
2022-01-16 05:56:31 +01:00
{
2022-01-19 08:22:30 +01:00
return this._requestById;
2022-01-16 05:56:31 +01:00
}
2022-01-19 08:22:30 +01:00
public set requestById(id: number)
2022-01-16 05:56:31 +01:00
{
2022-01-19 08:22:30 +01:00
this._requestType = RequestedPage.REQUEST_TYPE_ID;
this._requestById = id;
}
2022-01-20 09:03:21 +01:00
public get requestedByOfferId(): number
2022-01-19 08:22:30 +01:00
{
2022-01-20 09:03:21 +01:00
return this._requestedByOfferId;
2022-01-16 05:56:31 +01:00
}
2022-01-20 09:03:21 +01:00
public set requestedByOfferId(offerId: number)
2022-01-16 05:56:31 +01:00
{
2022-01-20 09:03:21 +01:00
this._requestType = RequestedPage.REQUEST_TYPE_OFFER;
this._requestedByOfferId = offerId;
2022-01-16 05:56:31 +01:00
}
2022-01-20 09:03:21 +01:00
public get requestByName(): string
2022-01-16 05:56:31 +01:00
{
2022-01-20 09:03:21 +01:00
return this._requestByName;
2022-01-16 05:56:31 +01:00
}
2022-01-20 09:03:21 +01:00
public set requestByName(name: string)
2022-01-16 05:56:31 +01:00
{
2022-01-20 09:03:21 +01:00
this._requestType = RequestedPage.REQUEST_TYPE_NAME;
this._requestByName = name;
2022-01-16 05:56:31 +01:00
}
}