- get a vendor by vendor's id
- accept id of the vendor
- method: GET
- return an object of vendor
getvendor/:vendor_id
http://servername:port/getvendor/1
obj : Observable<any>
http : HttpClient
obj = http.get<any>('http://servername:port/getvendor/1')
obj.subscribe(
data=>{},
err=>{}
)
- get a list of all active vendors
- no parameters accepted
- method: GET
- return a list of vendor object
getvendors
http://servername:port/getvendors
obj : Observable<any[]>
http : HttpClient
obj = http.get<any[]>('http://servername:port/getvendors')
obj.subscribe(
data=>{},
err=>{}
)
- get a list of vendor with limit
- accept index of the vendor list and vendor amount
- method: GET
- return an array of vendor object
getvendorpage/:vendor_index/:vendor_amount
http://servername:port/getvendorpage/0/10
will return a list of vendor from index 0 to index 9 (if exists)
obj : Observable<any[]>
http : HttpClient
obj = http.get<any[]>('http://servername:port/getvendorpage/0/10')
obj.subscribe(
data=>{},
err=>{}
)
- set a vendor status to active ('0') or non active ('0')
- accept id of the vendor and status value ('1', or '0')
- method: GET
- return transaction information
setvendoractive/:vendor_index/:vendor_status
http://servername:port/setvendoractive/1/1
will set vendor with id 1 to active (status='1')
obj : Observable<any>
http : HttpClient
obj = http.get<any>('http://servername:port/setvendoractive/1/1')
obj.subscribe(
data=>{},
err=>{}
)
- insert a vendor into database
- accept an object of vendor, which consist of (name,address,phone,bankaccount,namecard,offeringsample,invoicesample,receiptsample,createuser)
- the default value of status is '1' (active)
- method: POST
- return transaction information
savevendor
curl -d "name=padinet&address=mayjen sungkono 83&phone=031-123456&bankaccount=9988776655&namecard=&offeringsample=&invoicesample=&receiptsample=&createuser=anonymous" -X POST http://servername:port/savevendor
will set vendor with id 1 to active (status='1')
obj : Observable<any>
http : HttpClient
vendor = {
name:'padinet',
address:'mayjen sungkono 83',
phone:'031-123456',
bankaccount:'9988776655',
namecard:'',
offeringsample:'',
invoicesample:'',
receiptsample:'',
createuser:'anonymous'
}
obj = http.post<any>('http://servername:port/savevendor',vendor)
obj.subscribe(
data=>{},
err=>{}
)
- update a vendor
- accept an object of vendor, which consist of (id,name,address,phone,bankaccount,namecard,offeringsample,invoicesample,receiptsample,createuser)
- method: POST
- return transaction information
updatevendor
curl -d "id=1&name=padinet&address=mayjen sungkono 83&phone=031-123456&bankaccount=9988776655&namecard=&offeringsample=&invoicesample=&receiptsample=&createuser=anonymous" -X POST http://servername:port/updatevendor
will set update the vendor with id 1
obj : Observable<any>
http : HttpClient
vendor = {
id:1,
name:'padinet',
address:'mayjen sungkono 83',
phone:'031-123456',
bankaccount:'9988776655',
namecard:'',
offeringsample:'',
invoicesample:'',
receiptsample:'',
createuser:'anonymous'
}
obj = http.post<any>('http://servername:port/updatevendor',vendor)
obj.subscribe(
data=>{},
err=>{}
)
- get amount of vendors
- method: GET
- return amount of vendor
getvendorcount
http://servername:port/getvendorcount
obj : Observable<any>
http : HttpClient
obj = http.get<any>('http://servername:port/getvendorcount')
obj.subscribe(
data=>{},
err=>{}
)
- search vendors with parameter : searchData,pageIndex,and pageSize
- method : POST
- return :list of vendors
searchvendor
curl -d "searchData=&pageIndex=0&pageSize=10" -X POST http://servername:port/searchvendor
obj : Observable<any[]>
http : HttpClient
vendor = {
searchData:'lintas buwana',
pageIndex:1,
pageSize:10
}
obj = http.post<any[]>('http://servername:port/searchvendor',vendor)
obj.subscribe(
data=>{},
err=>{}
)
- search vendors with parameters : searchData
- method : POST
- return :list of vendors
searchvendor
curl -d "searchData=" -X POST http://servername:port/searchvendorcount
obj : Observable<any[]>
http : HttpClient
vendor = {
searchData:'lintas buwana'
}
obj = http.post<any[]>('http://servername:port/searchvendorcount',vendor)
obj.subscribe(
data=>{},
err=>{}
)