API UpdateBranch: Porovnání verzí

Z Podpora.nextis.cz
Přejít na: navigace, hledání
(Založena nová stránka s textem „'''API_UpdateBranch''' ''Example:''“)
 
 
(Není zobrazeno 5 mezilehlých verzí od stejného uživatele.)
Řádka 1: Řádka 1:
'''API_UpdateBranch'''
+
==== Description ====
 +
Method allows You to update branch in system.
  
''Example:''
+
==== Exact name ====
 +
<code>API_UpdateBranch</code>
 +
 
 +
==== Type ====
 +
Standard executable stored procedure.
 +
 
 +
==== Specification ====
 +
{| class="wikitable"
 +
!Parameter
 +
!Data type
 +
!Value range
 +
!Description
 +
!Relation
 +
|-
 +
|@ID
 +
|int
 +
|
 +
|Internal system id
 +
|API_GetBranches.ID
 +
|-
 +
|@WorkshopID
 +
|int
 +
|
 +
|Workshops ID
 +
ID of workshops from workshops list (see relation)
 +
|API_GetWorkshops.ID
 +
|-
 +
|@Name
 +
|nvarchar(100)
 +
|
 +
|Branch name
 +
|
 +
|-
 +
|@Street
 +
|nvarchar(200)
 +
|
 +
|Street
 +
|
 +
|-
 +
|@City
 +
|nvarchar(120)
 +
|
 +
|City
 +
|
 +
|-
 +
|@ZIPCode
 +
|nvarchar(15)
 +
|
 +
|ZIP Code
 +
|
 +
|-
 +
|@Country
 +
|nvarchar(70)
 +
|
 +
|Country
 +
|
 +
|-
 +
|@Region
 +
|nvarchar(70)
 +
|
 +
|Region
 +
|
 +
|-
 +
|@State
 +
|nvarchar(80)
 +
|
 +
|State
 +
|
 +
|-
 +
|@StateID
 +
|int
 +
|
 +
|ID of country from country list (see relation)
 +
|API_GetCountry.ID
 +
|-
 +
|@Phone
 +
|nvarchar(50)
 +
|
 +
|Phone
 +
|
 +
|-
 +
|@Fax
 +
|nvarchar(50)
 +
|
 +
|Fax
 +
|
 +
|-
 +
|@MobilePhone
 +
|nvarchar(50)
 +
|
 +
|Mobile phone
 +
|
 +
|-
 +
|@Email
 +
|nvarchar(70)
 +
|
 +
|Email
 +
|
 +
|-
 +
|@Web
 +
|nvarchar(120)
 +
|
 +
|Web address
 +
|
 +
|}
 +
 
 +
==== Return ====
 +
0 : OK
 +
100 : Item could not be created
 +
 
 +
==== Example ====
 +
<syntaxhighlight lang="sql">
 +
DECLARE @return_value int
 +
DECLARE @ID INT
 +
DECLARE @WorkshopID INT
 +
DECLARE @Name NVARCHAR(100)
 +
DECLARE @Street NVARCHAR(200)
 +
DECLARE @City NVARCHAR(120)
 +
DECLARE @ZIPCode NVARCHAR(15)
 +
DECLARE @Country NVARCHAR(70)
 +
DECLARE @Region NVARCHAR(70)
 +
DECLARE @State NVARCHAR(80)
 +
DECLARE @StateID INT
 +
DECLARE @Phone NVARCHAR(50)
 +
DECLARE @Fax NVARCHAR(50)
 +
DECLARE @MobilePhone NVARCHAR(50)
 +
DECLARE @Email NVARCHAR(70)
 +
DECLARE @Web NVARCHAR(120)
 +
 +
SELECT @ID = id,
 +
      @WorkshopID = [workshopid],
 +
      @Name = 'Name2',
 +
      @Street = [street],
 +
      @City = [city],
 +
      @ZIPCode = [zipcode],
 +
      @Country = [country],
 +
      @Region = [region],
 +
      @State = [state],
 +
      @StateID = [stateid],
 +
      @Phone = [phone],
 +
      @Fax = [fax],
 +
      @MobilePhone = [mobilephone],
 +
      @Email = [email],
 +
      @Web = [web]
 +
FROM  [api_getbranches]
 +
WHERE  id = 3
 +
 +
EXECUTE @return_value = [Api_updatebranch]
 +
  @ID,
 +
  @WorkshopID,
 +
  @Name,
 +
  @Street,
 +
  @City,
 +
  @ZIPCode,
 +
  @Country,
 +
  @Region,
 +
  @State,
 +
  @StateID,
 +
  @Phone,
 +
  @Fax,
 +
  @MobilePhone,
 +
  @Email,
 +
  @Web
 +
</syntaxhighlight>
 +
 
 +
==== Notices ====
 +
None.

Aktuální verze z 20. 9. 2017, 14:54

Description

Method allows You to update branch in system.

Exact name

API_UpdateBranch

Type

Standard executable stored procedure.

Specification

Parameter Data type Value range Description Relation
@ID int Internal system id API_GetBranches.ID
@WorkshopID int Workshops ID

ID of workshops from workshops list (see relation)

API_GetWorkshops.ID
@Name nvarchar(100) Branch name
@Street nvarchar(200) Street
@City nvarchar(120) City
@ZIPCode nvarchar(15) ZIP Code
@Country nvarchar(70) Country
@Region nvarchar(70) Region
@State nvarchar(80) State
@StateID int ID of country from country list (see relation) API_GetCountry.ID
@Phone nvarchar(50) Phone
@Fax nvarchar(50) Fax
@MobilePhone nvarchar(50) Mobile phone
@Email nvarchar(70) Email
@Web nvarchar(120) Web address

Return

0 : OK
100 : Item could not be created

Example

 DECLARE @return_value int
 DECLARE @ID INT 
 DECLARE @WorkshopID INT 
 DECLARE @Name NVARCHAR(100) 
 DECLARE @Street NVARCHAR(200) 
 DECLARE @City NVARCHAR(120) 
 DECLARE @ZIPCode NVARCHAR(15) 
 DECLARE @Country NVARCHAR(70) 
 DECLARE @Region NVARCHAR(70) 
 DECLARE @State NVARCHAR(80) 
 DECLARE @StateID INT 
 DECLARE @Phone NVARCHAR(50) 
 DECLARE @Fax NVARCHAR(50) 
 DECLARE @MobilePhone NVARCHAR(50) 
 DECLARE @Email NVARCHAR(70) 
 DECLARE @Web NVARCHAR(120) 
 
 SELECT @ID = id, 
       @WorkshopID = [workshopid], 
       @Name = 'Name2', 
       @Street = [street], 
       @City = [city], 
       @ZIPCode = [zipcode], 
       @Country = [country], 
       @Region = [region], 
       @State = [state], 
       @StateID = [stateid], 
       @Phone = [phone], 
       @Fax = [fax], 
       @MobilePhone = [mobilephone], 
       @Email = [email], 
       @Web = [web] 
 FROM   [api_getbranches] 
 WHERE  id = 3
 
 EXECUTE @return_value = [Api_updatebranch] 
  @ID, 
  @WorkshopID, 
  @Name, 
  @Street, 
  @City, 
  @ZIPCode, 
  @Country, 
  @Region, 
  @State, 
  @StateID, 
  @Phone, 
  @Fax, 
  @MobilePhone, 
  @Email, 
  @Web

Notices

None.