vb Code:
Use MasterFile
GO
If EXISTS(SELECT name FROM sysobjects
WHERE name='StockIn')
DROP PROCEDURE StockIn
GO
CREATE PROCEDURE StockIn
@ProdID varchar(50),@ProdName varchar(50),
@EntryDate datetime,@ProdUnit varchar(50),
@ProdReorderPoint int,
@ProdPurchasePrice money, @ProdQTY int)
AS
DECLARE @ErrorCode int
/*
INSERT INTO tblStockMasterFile(ProductID,ProductName,Unit,ReOrderPoint)
VALUES(@ProdID,@ProdName,@ProdUnit,@ProdReOrderPoint)
DECLARE @MaxSEQ int
SET @MaxSEQ=(SELECT IsNull(Max(Sequence),0 )+ 1
FROM tblStockTransFile
WHERE ProductID= @ProdID AND EntryDate=@EntryDate)
INSERT INTO tblStockTransFile (ProductID, EntryDate, PurchasePrice,Quantity,Reason,Sequence)
VALUES(@ProdID,@EntryDate,@ProdPurchasePrice,@ProdQTY,'In',@MaxSEQ)
SET @ErrorCode=@@ERROR
IF (@ErrorCode=0)
RETURN (0)
ELSE
RETURN (@ErrorCode)
*/
SET @ERRORCODE=0
vb Code:
With CMD
.CommandText = "[StockIn]"
.ActiveConnection = oConn
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@ProdID", adVarChar, adParamInput, 50, txtProdID.Text)
'.Parameters.Append .CreateParameter("@ProdName", adVarChar, adParamInput, 50, txtProdName.Text)
'.Parameters.Append .CreateParameter("@EntryDate", adDate, adParamInput, , Format$(DTEntryDate.Value, "mm/dd/yy"))
'.Parameters.Append .CreateParameter("@ProdUnit", adVarChar, adParamInput, 50, txtProdUnit.Text)
'.Parameters.Append .CreateParameter("@ProdReorderPoint", adInteger, adParamInput, , txtProdReOrderPoint.Text)
'.Parameters.Append .CreateParameter("@ProdPurchasePrice", adCurrency, adParamInput, , txtProdUnit.Text)
'.Parameters.Append .CreateParameter("@ProdQTY", adInteger, adParamInput, , txtProdQTY.Text)
Set rsStock = .Execute()
End With