﻿USE [FabApprovalSystem]
GO
	/****** Object:  StoredProcedure [dbo].[CCUpdateChangeControl]    Script Date: 11/21/2024 11:29:04 AM ******/
SET
	ANSI_NULLS ON
GO
SET
	QUOTED_IDENTIFIER ON
GO
	-- =============================================
	-- Author:		<Author,,Name>
	-- Create date: <Create Date,,>
	-- Description:	<Description,,>
	-- =============================================
	CREATE PROCEDURE [dbo].[CCUpdateChangeControl] @PlanNumber INT,
	@ChangeLevel INT,
	@IsITAR INT,
	@IsMedical INT,
	@IsRadHard INT,
	@Notes VARCHAR(1000),
	--@PartNumbers VARCHAR(100),
	--@ToolTypes VARCHAR(500),
	@IsAutomotive INT,
	@Title VARCHAR(100),
	@ReasonForChange VARCHAR(2000),
	@ChangeDescription VARCHAR(2000) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
SET
	NOCOUNT ON;

-- Insert statements for procedure here
UPDATE
	CCChangeControl
SET
	ChangeLevel = CASE
		WHEN @ChangeLevel = -1 THEN NULL
		ELSE @ChangeLevel
	END,
	IsITAR = @IsITAR,
	IsMedical = @IsMedical,
	IsRadHard = @IsRadHard,
	IsAutoMotive = @IsAutomotive,
	Notes = @Notes,
	--PartNumbers = @PartNumbers,
	--ToolTypes = @ToolTypes,
	Title = @Title,
	ReasonForChange = @ReasonForChange,
	ChangeDescription = @ChangeDescription
WHERE
	PlanNumber = @PlanNumber
END
GO