USE [prince]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author     :سولماز مهذبیه
-- Create date:2015/12/17 | 1394/09/26 | 10:42:15
-- Description:    Inserting Data Into « FactorScale » Table
-- =============================================
ALTER PROCEDURE [Orginal].[FCS_Insert] 
(
    @FCS_ID					[Common].[_INT_] OUT,
    @FCS_RegMode			[Common].[_INT_],
    @FCS_FactorBarcode		[Common].[_BIG_],     
    @FCS_FactorSerialNumber [Common].[_BIGINT_],
    @FCS_FCT_ID				[Common].[_INT_],
    @FCS_BOT_ID  			[Common].[_INT_],
    @FCS_SCL_ID  			[Common].[_INT_],
    @FCS_SCL_IP  			[Common].[_SMALL_],
    @FCS_Person  			[Common].[_BIG_],    
    @FCS_RegDate 			[Common].[_DATE_],     
    @FCS_RegTime 			[Common].[_TIME_],
    @FCS_UserID  			[Common].[_INT_]
    
)
AS
BEGIN
       SET NOCOUNT ON;
       SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
       
       
        DECLARE @FCS_RegDate_Int [Common].[_INT_] = Common.SYS_CastDateToNum(@FCS_RegDate)
        DECLARE @FCS_LastEditedTime [Common].[_BIGINT_] = [Common].[GetIntDate]()  
       ------------------------------------------------
       INSERT INTO [Orginal].[FactorScale]
       (
              FCS_RegMode,
              FCS_FactorSerialNumber,
              FCS_FactorBarcode,
              FCS_FCT_ID,
              FCS_BOT_ID,
              FCS_SCL_ID,
              FCS_SCL_IP,
              FCS_Person,
              FCS_IsDeleted,
              FCS_RegDate,
              FCS_RegDate_Int,
              FCS_RegTime,
              FCS_UserID,
              FCS_LastEditedTime
       )
       VALUES
       (
              @FCS_RegMode,
              @FCS_FactorSerialNumber,
              @FCS_FactorBarcode,
              @FCS_FCT_ID,
              @FCS_BOT_ID,
              @FCS_SCL_ID,
              @FCS_SCL_IP,
              @FCS_Person,
              0,
              @FCS_RegDate,
              @FCS_RegDate_Int,
              @FCS_RegTime,
              @FCS_UserID,
              @FCS_LastEditedTime
       )
       SET @FCS_ID = SCOPE_IDENTITY();
       ------------------------------------------------
       SET TRANSACTION ISOLATION LEVEL READ COMMITTED
       SET NOCOUNT OFF;
END