- 爱易网页
-
ASP.NET教程
- 大家对一上代码作上评价(1个快10年开发经验的高手)
日期:2014-05-17 浏览次数:20608 次
大家对一下代码作下评价(1个快10年开发经验的高手)
--==========================AgSerItem存储过程:INSERT=========================
alter PROCEDURE p_AgSerItem_INSERT
(
@AgreeID int,
@SerID int,
@AirPortID int,
@AirClass int,
@RhumbID int,
@UnitID int,
@MUnitID int,
@CoinID int,
@UserID int,
@SP money,
@MUP money,
@UP money,
@CDate datetime,
@UDate datetime,
@FC float,
@SC float,
@IsValid bit,
@AirNo varchar(25),
@AirType varchar(25)
)
AS
BEGIN
SET XACT_ABORT ON
BEGIN TRANSACTION
DECLARE @PRIMARYKEYID INT
SET @PRIMARYKEYID=0
INSERT AgSerItem([AgreeID],[SerID],[AirPortID],[AirClass],[RhumbID],[UnitID],[MUnitID],[CoinID],[UserID],[SP],[MUP],[UP],[CDate],[UDate],[FC],[SC],[IsValid],[AirNo],[AirType]) VALUES (@AgreeID,@SerID,@AirPortID,@AirClass,@RhumbID,@UnitID,@MUnitID,@CoinID,@UserID,@SP,@MUP,@UP,@CDate,@UDate,@FC,@SC,@IsValid,@AirNo,@AirType) SELECT @PRIMARYKEYID=@@IDENTITY
IF @@ERROR <> 0
BEGIN
Rollback TRANSACTION--回滚
Return 0--操作失败
END
COMMIT TRANSACTION
Return @PRIMARYKEYID
End
go
--==========================AgSerItem存储过程:UPDATE=========================
alter PROCEDURE p_AgSerItem_UPDATE
(
@AgSerID int,
@AgreeID int,
@SerID int,
@AirPortID int,
@AirClass int,
@RhumbID int,
@UnitID int,
@MUnitID int,
@CoinID int,
@UserID int,
@SP money,
@MUP money,
@UP money,
@CDate datetime,
@UDate datetime,
@FC float,
@SC float,
@IsValid bit,
@AirNo varchar(25),
@AirType varchar(25)
)
AS
BEGIN
SET XACT_ABORT ON
BEGIN TRANSACTION
UPDATE AgSerItem SET [AgreeID]=@AgreeID,[SerID]=@SerID,[AirPortID]=@AirPortID,[AirClass]=@AirClass,[RhumbID]=@RhumbID,[UnitID]=@UnitID,[MUnitID]=@MUnitID,[CoinID]=@CoinID,[UserID]=@UserID,[SP]=@SP,[MUP]=@MUP,[UP]=@UP,[CDate]=@CDate,[UDate]=@UDate,[FC]=@FC,[SC]=@SC,[IsValid]=@IsValid,[AirNo]=@AirNo,[AirType]=@AirType WHERE [AgSerID]=@AgSerID
IF @@ERROR <> 0
BEGIN
Rollback TRANSACTION--回滚
Return 0--操作失败
END
COMMIT TRANSACTION