Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[fm_human_saveItem]
- @username nvarchar(256),
- @itemID int,
- @parameters ExtendedDictionaryParameter readonly
- AS
- BEGIN
- if (@itemID>0) begin
- -- извлекаем параметры формы из коллекции
- declare @pfio nvarchar(max)
- select @pfio = value from @parameters where [Key]='fio'
- declare @pphone nvarchar(max)
- select @pphone = value from @parameters where [Key]='phone'
- declare @pdepID int
- select @pdepID = try_cast(value as int) from @parameters where [Key]='depID'
- declare @pfreelancer bit
- select @pfreelancer = try_cast(value as bit) from @parameters where [Key]='freelancer'
- -- обновляем сотрудника
- update hr_humans
- set fio = @pfio,
- phone = @pphone,
- depID = @pdepID,
- freelancer = @pfreelancer
- where id = @itemID
- --SELECT 1 выдаем результат
- select 1 Result, 'Сохранено' Msg
- return
- end
- select 0 Result, 'Неверные параметры' Msg
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement