set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo]. [Up_AddCashItem]
(
@ ItemID int, - Item ID
@ Cash int, - Price
@ ItemName nvarchar (200), - item name
@ ItemCount int, - number of items
@ Description nvarchar (200), - item description
@ IconPath nvarchar (200), - Item Image Path "../Data/6_UI/icon/ICONCASH_B_10.tga"
@ Index int - Item Photo ranking (17) left to right, top to bottom, which in the first months
)
AS
SET NOCOUNT ON
BEGIN
DECLARE @ Idx int
DECLARE @ DisplayRank int
SET @ DisplayRank = (SELECT ISNULL (Max (DisplayRank), 0) +1 FROM [DR2_Local]. [Dbo]. [TB_Common_CashItem])
INSERT INTO [DR2_Local]. [Dbo]. [TB_Common_CashItem]
([CashItemCategoryIdx]
, [CashItemDisplayTypeIdx]
, [DisplayRank]
, [ItemName]
, [Status]
, [Description]
, [SaleType]
, [SaleStartDate]
, [SaleEndDate]
, [Mileage]
, [IconPath]
, [U]
, [V]
, [UVIndex]
, [RegDate]
, [RegIP])
VALUES
(9,0, @ DisplayRank, @ ItemName, 0, @ Description, 2, NULL, NULL, 0, @ IconPath, 7,7, @ Index, GETDATE (), '1 .0.0.0 ');
SET @ Idx = @ @ IDENTITY
INSERT [DR2_Local]. [Dbo]. [TB_Common_CashItemPrice]
(CashItemIdx
, TimeType
, ItemUseTime
, Cash
, IsDiscount
, DiscountCash
, ExtendCash
, IsExtendDiscount
, DiscountExtendCash)
VALUES (@ Idx, 2, 0, @ Cash, 'False', 0, 0, 'False', 0)
INSERT [DR2_Local]. [Dbo]. [TB_Common_CashItemRef]
(CashItemIdx, ItemNo, ItemCount)
VALUES (@ Idx, @ itemID, @ ItemCount)
END
|