USP_DATAFORMTEMPLATE_EDIT_PROGRAMSALESMETHOD_2
The save procedure used by the edit dataform template "Program Sales Method Edit Data Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter indicating the ID of the record being edited. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@SALESMETHODID | uniqueidentifier | IN | Sales method |
@ONSALETYPECODE | tinyint | IN | On-sale period begins |
@ONSALEDATE | datetime | IN | Date |
@ONSALETIME | char(4) | IN | Time |
@ONSALETIMEBEFORE | int | IN | Time before |
@ONSALEENDTYPECODE | tinyint | IN | On-sale period ends |
@ONSALEENDINTERVAL | int | IN | Number of minutes |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_PROGRAMSALESMETHOD_2 (
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@SALESMETHODID uniqueidentifier,
@ONSALETYPECODE tinyint,
@ONSALEDATE datetime,
@ONSALETIME char(4),
@ONSALETIMEBEFORE int,
@ONSALEENDTYPECODE tinyint,
@ONSALEENDINTERVAL int
)
as
set nocount on;
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output
declare @CURRENTDATE datetime
set @CURRENTDATE = getdate()
begin try
update dbo.PROGRAMSALESMETHOD
set
SALESMETHODID = @SALESMETHODID,
ONSALETYPECODE = @ONSALETYPECODE,
ONSALEDATE = @ONSALEDATE,
ONSALETIME = @ONSALETIME,
ONSALETIMEBEFORE = @ONSALETIMEBEFORE,
ONSALEENDTYPECODE = @ONSALEENDTYPECODE,
ONSALEENDINTERVAL = @ONSALEENDINTERVAL,
CHANGEDBYID = @CHANGEAGENTID,
DATECHANGED = @CURRENTDATE
where
ID = @ID
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0;