Exemplo n.º 1
0
        public bool DeleteABTestByGuid(Guid testGuid)
        {
            string sql = @"UPDATE [Configuration].[dbo].[ABTestConfig]
                            SET    IsDelete = 1
                            WHERE  TestGuid = @TestGuid";
            var    cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@TestGuid", testGuid);

            return(db.ExecuteNonQuery(cmd) > 0);
        }
Exemplo n.º 2
0
        public static void DeteleDeatil(AsyncDbHelper db, string id)
        {
            string     sql = "DELETE FROM Configuration.dbo.SE_ActivityDeatilConfig WHERE FK_Activity=@FK_Activity";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@FK_Activity", id);
            db.ExecuteNonQuery(cmd);
        }
        private void InsertCouponInfo(AsyncDbHelper db, SE_GetPromotionActivityCouponInfoConfig item)
        {
            StringBuilder sql = new StringBuilder();

            sql = new StringBuilder(@"INSERT INTO Configuration.dbo.SE_GetPromotionActivityCouponInfoConfig
        ( FK_GetPromotionActivityID ,
          GetRuleID ,
          GetRuleGUID ,
          VerificationMode ,
          ValidDays ,
          ValidStartDateTime ,
          ValidEndDateTime ,
          UserType ,
          Description ,
          Discount ,
          MinMoney ,
          SingleQuantity ,
          Quantity,
          [Status],
            GetUserType
        )
VALUES  ( @FK_GetPromotionActivityID , -- FK_GetPromotionActivityID - uniqueidentifier
          @GetRuleID , -- GetRuleID - int
          @GetRuleGUID , -- GetRuleGUID - uniqueidentifier
          @VerificationMode , -- VerificationMode - int
          @ValidDays , -- ValidDays - int
          @ValidStartDateTime , -- ValidStartDateTime - datetime
          @ValidEndDateTime , -- ValidEndDateTime - datetime
          @UserType , -- UserType - int
          @Description , -- Description - nvarchar(50)
          @Discount , -- Discount - money
          @MinMoney , -- MinMoney - money
          @SingleQuantity , -- SingleQuantity - int
          @Quantity,  -- Quantity - int
          @Status,
          @GetUserType
        )");
            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.CommandText = sql.ToString();
                cmd.Parameters.AddWithValue("@FK_GetPromotionActivityID", item.FK_GetPromotionActivityID);
                cmd.Parameters.AddWithValue("@GetRuleID", item.GetRuleID);
                cmd.Parameters.AddWithValue("@GetRuleGUID", item.GetRuleGUID);
                cmd.Parameters.AddWithValue("@VerificationMode", item.VerificationMode);
                cmd.Parameters.AddWithValue("@ValidDays", item.ValidDays);
                cmd.Parameters.AddWithValue("@ValidStartDateTime", item.ValidStartDateTime);
                cmd.Parameters.AddWithValue("@ValidEndDateTime", item.ValidEndDateTime);
                cmd.Parameters.AddWithValue("@UserType", item.UserType);
                cmd.Parameters.AddWithValue("@Description", item.Description);
                cmd.Parameters.AddWithValue("@Discount", item.Discount);
                cmd.Parameters.AddWithValue("@MinMoney", item.MinMoney);
                cmd.Parameters.AddWithValue("@SingleQuantity", item.SingleQuantity);
                cmd.Parameters.AddWithValue("@Quantity", item.Quantity);
                cmd.Parameters.AddWithValue("@Status", item.Status);
                cmd.Parameters.AddWithValue("@GetUserType", item.GetUserType);
                db.ExecuteNonQuery(cmd);
            }
        }
 private void DeleteCouponInfo(AsyncDbHelper db, Guid ID)
 {
     //DELETE FROM Configuration.dbo.SE_GetPromotionActivityCouponInfoConfig WHERE FK_GetPromotionActivityID=@FK_GetPromotionActivityID
     using (SqlCommand cmd = new SqlCommand("UPDATE Configuration.dbo.SE_GetPromotionActivityCouponInfoConfig SET Status=0 WHERE  FK_GetPromotionActivityID=@FK_GetPromotionActivityID "))
     {
         cmd.Parameters.AddWithValue("@FK_GetPromotionActivityID", ID);
         db.ExecuteNonQuery(cmd);
     }
 }
        public bool Add(SE_FlagshipStoreConfig model)
        {
            StringBuilder sql = new StringBuilder("INSERT INTO configuration.dbo.SE_FlagshipStoreConfig(Brand,Name,Describe,Uri,ImageUrl,Remark,CreateDT,UpdateDT)");

            sql.Append(" VALUES(@Brand,@Name,@Describe,@Uri,@ImageUrl,@Remark,GETDATE(),GETDATE()) ");
            try
            {
                using (SqlCommand cmd = new SqlCommand(sql.ToString()))
                {
                    cmd.Parameters.AddWithValue("@Brand", model.Brand);
                    cmd.Parameters.AddWithValue("@Name", model.Name);
                    cmd.Parameters.AddWithValue("@Describe", model.Describe);
                    cmd.Parameters.AddWithValue("@Uri", model.Uri);
                    cmd.Parameters.AddWithValue("@ImageUrl", model.ImageUrl.Trim());
                    cmd.Parameters.AddWithValue("@Remark", model.Remark);
                    return(db.ExecuteNonQuery(cmd) > 0);
                }
            }
            catch (Exception e)
            {
                return(false);
            }
        }
Exemplo n.º 6
0
        public static void UpdateDeatil(AsyncDbHelper db, SE_ActivityDeatil model)
        {
            string     sql = @"UPDATE Configuration].[dbo].[SE_ActivityDeatil]
   SET 
      [GROUP] =@GROUP
      ,[PID] = @PID
      ,[ActivityFlashID] = @ActivityFlashID
      ,[CouponID] = @CouponID
      ,[SmallImage] =@SmallImage
      ,[BigImage] = @BigImage
      ,[ColunmNumber] = @ColunmNumber
      ,[Type] = @Type
      ,[OrderBy] = @OrderBy
      ,[AppUrl] = @AppUrl
      ,[WapUrl] = @WapUrl
      ,[PCUrl] = @PCUrl
      ,[HandlerIOS] = @HandlerIOS
      ,[HandlerAndroid] = @HandlerAndroid
      ,[SOAPIOS] = @SOAPIOS
      ,[SOAPAndroid] = @SOAPAndroid
      ,[IsImage] = @IsImage
      ,[DisplayWay] = @DisplayWay
      ,[Description] = @Description
 WHERE ID=@ID ";
            SqlCommand cmd = new SqlCommand(sql);

            // cmd.Parameters.AddWithValue("@FK_Activity", model.FK_Activity.ToString());
            cmd.Parameters.AddWithValue("@GROUP", model.GROUP);
            cmd.Parameters.AddWithValue("@PID", model.PID);
            cmd.Parameters.AddWithValue("@ActivityFlashID", model.ActivityFlashID);
            cmd.Parameters.AddWithValue("@CouponID", model.CouponID);
            cmd.Parameters.AddWithValue("@SmallImage", model.SmallImage);
            cmd.Parameters.AddWithValue("@BigImage", model.BigImage);
            cmd.Parameters.AddWithValue("@ColunmNumber", model.ColunmNumber);
            cmd.Parameters.AddWithValue("@Type", model.Type);
            cmd.Parameters.AddWithValue("@OrderBy", model.OrderBy);
            cmd.Parameters.AddWithValue("@AppUrl", model.AppUrl);
            cmd.Parameters.AddWithValue("@WapUrl", model.WapUrl);
            cmd.Parameters.AddWithValue("@PCUrl", model.PCUrl);
            cmd.Parameters.AddWithValue("@HandlerIOS", model.HandlerIOS);
            cmd.Parameters.AddWithValue("@HandlerAndroid", model.HandlerAndroid);
            cmd.Parameters.AddWithValue("@SOAPIOS", model.SOAPIOS);
            cmd.Parameters.AddWithValue("@SOAPAndroid", model.SOAPAndroid);
            cmd.Parameters.AddWithValue("@IsImage", model.IsImage);
            cmd.Parameters.AddWithValue("@DisplayWay", model.DisplayWay);
            cmd.Parameters.AddWithValue("@Description", model.Description);
            cmd.Parameters.AddWithValue("@ID", model.ID);
            db.ExecuteNonQuery(cmd);
        }
        private void UpdateCouponInfo(AsyncDbHelper db, SE_GetPromotionActivityCouponInfoConfig item)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append(@"UPDATE Configuration.dbo.SE_GetPromotionActivityCouponInfoConfig
          GetRuleID =@GetRuleID,
          GetRuleGUID=@GetRuleGUID ,
          VerificationMode=@VerificationMode ,
          ValidDays =@ValidDays,
          ValidStartDateTime =@ValidStartDateTime,
          ValidEndDateTime =@ValidEndDateTime,
          UserType =@UserType,
          [Description]=@Description,
          Discount=@Discount ,
          MinMoney =@MinMoney,
          SingleQuantity =@SingleQuantity,
          Quantity=@Quantity
WHERE   FK_GetPromotionActivityID=@FK_GetPromotionActivityID ");
            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.CommandText = sql.ToString();
                cmd.Parameters.AddWithValue("@FK_GetPromotionActivityID", item.FK_GetPromotionActivityID);
                cmd.Parameters.AddWithValue("@GetRuleID", item.GetRuleID);
                cmd.Parameters.AddWithValue("@GetRuleGUID", item.GetRuleGUID);
                cmd.Parameters.AddWithValue("@VerificationMode", item.VerificationMode);
                cmd.Parameters.AddWithValue("@ValidDays", item.ValidDays);
                cmd.Parameters.AddWithValue("@ValidStartDateTime", item.ValidStartDateTime);
                cmd.Parameters.AddWithValue("@ValidEndDateTime", item.ValidEndDateTime);
                cmd.Parameters.AddWithValue("@UserType", item.UserType);
                cmd.Parameters.AddWithValue("@Description", item.Description);
                cmd.Parameters.AddWithValue("@Discount", item.Discount);
                cmd.Parameters.AddWithValue("@MinMoney", item.MinMoney);
                cmd.Parameters.AddWithValue("@SingleQuantity", item.SingleQuantity);
                cmd.Parameters.AddWithValue("@Quantity", item.Quantity);
                db.ExecuteNonQuery(cmd);
            }
        }
Exemplo n.º 8
0
        public static void AddDeatil(AsyncDbHelper db, SE_ActivityDeatil model)
        {
            string     sql = @"INSERT INTO Configuration.dbo.SE_ActivityDeatilConfig
        (FK_Activity,
          [GROUP],
          PID,
          ActivityFlashID,
          CouponID,
          SmallImage,
          BigImage,
          ColunmNumber,
          [Type],
          OrderBy,
          AppUrl,
          WapUrl,
          PCUrl,
          HandlerIOS,
          HandlerAndroid,
          SOAPIOS,
          SOAPAndroid,
          IsImage,
          DisplayWay,
          [Description],
         ProductName,ActivityPrice
        )
VALUES(@FK_Activity, --FK_Activity - uniqueidentifier
          @GROUP, --GROUP - nvarchar(50)
          @PID, --PID - nvarchar(50)
          @ActivityFlashID, --ActivityFlashID - nvarchar(100)
          @CouponID, --CouponID - int
          @SmallImage, --SmallImage - nvarchar(200)
          @BigImage, --BigImage - nvarchar(200)
          @ColunmNumber, --ColunmNumber - int
          @Type, --Type - int
          @OrderBy, --OrderBy - int
          @AppUrl, --AppUrl - nvarchar(100)
          @WapUrl, --WapUrl - nvarchar(100)
          @PCUrl, --PCUrl - nvarchar(100)
          @HandlerIOS, --HandlerIOS - nvarchar(200)
          @HandlerAndroid, --HandlerAndroid - nvarchar(200)
          @SOAPIOS, --SOAPIOS - nvarchar(200)
          @SOAPAndroid, --SOAPAndroid - nvarchar(200)
          @IsImage, --IsImage - int
          @DisplayWay, --DisplayWay - int
          @Description, -- Description - text
          @ProductName,
          @ActivityPrice
        )
";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@FK_Activity", model.FK_Activity.ToString());
            cmd.Parameters.AddWithValue("@GROUP", model.GROUP);
            cmd.Parameters.AddWithValue("@PID", model.PID);
            cmd.Parameters.AddWithValue("@ActivityFlashID", model.ActivityFlashID);
            cmd.Parameters.AddWithValue("@CouponID", model.CouponID);
            cmd.Parameters.AddWithValue("@SmallImage", model.SmallImage);
            cmd.Parameters.AddWithValue("@BigImage", model.BigImage);
            cmd.Parameters.AddWithValue("@ColunmNumber", model.ColunmNumber);
            cmd.Parameters.AddWithValue("@Type", model.Type);
            cmd.Parameters.AddWithValue("@OrderBy", model.OrderBy);
            cmd.Parameters.AddWithValue("@AppUrl", model.AppUrl);
            cmd.Parameters.AddWithValue("@WapUrl", model.WapUrl);
            cmd.Parameters.AddWithValue("@PCUrl", model.PCUrl);
            cmd.Parameters.AddWithValue("@HandlerIOS", model.HandlerIOS);
            cmd.Parameters.AddWithValue("@HandlerAndroid", model.HandlerAndroid);
            cmd.Parameters.AddWithValue("@SOAPIOS", model.SOAPIOS);
            cmd.Parameters.AddWithValue("@SOAPAndroid", model.SOAPAndroid);
            cmd.Parameters.AddWithValue("@IsImage", model.IsImage);
            cmd.Parameters.AddWithValue("@DisplayWay", model.DisplayWay);
            cmd.Parameters.AddWithValue("@Description", model.Description);
            cmd.Parameters.AddWithValue("@ProductName", model.ProductName);
            cmd.Parameters.AddWithValue("@ActivityPrice", model.ActivityPrice);
            db.ExecuteNonQuery(cmd);
        }
        public bool Add(SE_GetPromotionActivityConfig model)
        {
            bool          result = false;
            StringBuilder sql    = new StringBuilder();

            try
            {
                db.BeginTransaction();
                sql.Append(@" INSERT INTO Configuration.dbo.SE_GetPromotionActivityConfig
         ( ID ,
           ActivityName ,
           StartDateTime ,
           EndDateTime ,
           Channel ,
           Status ,
           TopBanner ,
           BottomBanner ,
           NumberCodeTimes ,
           ChartCodeTimes ,
           AutoCompleteTimes ,
           CodeErrorTimes ,
           LimitPhoneHourse ,
           NewUserValidMode ,
           SuccessfulTopBanner ,
           SuccessfulCenterBanner ,
           SuccessfulBottomBanner ,
           SuccessfulIOSUrl ,
           SuccessfulAndroidUrl ,
           SuccessfulJumpMode ,
           SuccessfulWaitTime ,
           FailTopBanner ,
           FailCenterBanner ,
           FailBottomBanner ,
           FailIOSUrl ,
           FailAndroidUrl ,
           FailJumpMode ,
           FailWaitTime ,
           CreateDateTime ,
           UpdateDateTime,
           IsNewUser,
           IsNeedCode,
            IsPostion,IsSendMsg,SendMsg,
            NewBottomBanner,NewPageIOSUrl,NewPageAndroidUrl,NewIOSUrl,NewAndroidUrl,SuccessfulPageIOSUrl,SuccessfulPageAndroidUrl,FailPageIOSUrl,FailPageAndroidUrl,TipStyle,NewJumpMode,NewWaitTime,
            NewUserTip,OldUserTip,ActivityNoStartTip,ActivityOverTip,CouponTip,PageTip,LimitUserTypeTip,AlreadyHadTip,DefaultTip,BlackTip,CardChannel,CardConsumedURL,CardExpireURL,
            CardGiftingURL,CardGiftTimeOutURL,CardDeleteURL,CardUnavailableURL,CardInvalidSerialCodeURL,TokenAccessFailedURL,CreatorUser,UpdateUser
         )");
                sql.Append(@" VALUES  ( @ID , -- ID - uniqueidentifier
           @ActivityName , -- ActivityName - nvarchar(100)
           @StartDateTime , -- StartDateTime - datetime
           @EndDateTime , -- EndDateTime - datetime
           @Channel, -- Channel - nvarchar(50)
           @Status , -- Status - bigint
           @TopBanner , -- TopBanner - nvarchar(500)
           @BottomBanner , -- BottomBanner - nvarchar(500)
           @NumberCodeTimes , -- NumberCodeTimes - int
           @ChartCodeTimes , -- ChartCodeTimes - int
           @AutoCompleteTimes , -- AutoCompleteTimes - int
           @CodeErrorTimes , -- CodeErrorTimes - int
           @LimitPhoneHourse, -- LimitPhoneHourse - int
           @NewUserValidMode , -- NewUserValidMode - int
           @SuccessfulTopBanner , -- SuccessfulTopBanner - nvarchar(500)
           @SuccessfulCenterBanner , -- SuccessfulCenterBanner - nvarchar(500)
           @SuccessfulBottomBanner , -- SuccessfulBottomBanner - nvarchar(500)
           @SuccessfulIOSUrl , -- SuccessfulIOSUrl - nvarchar(100)
           @SuccessfulAndroidUrl , -- SuccessfulAndroidUrl - nvarchar(100)
           @SuccessfulJumpMode , -- SuccessfulJumpMode - int
           @SuccessfulWaitTime , -- SuccessfulWaitTime - int
           @FailTopBanner , -- FailTopBanner - nvarchar(500)
           @FailCenterBanner , -- FailCenterBanner - nvarchar(500)
           @FailBottomBanner , -- FailBottomBanner - nvarchar(500)
           @FailIOSUrl , -- FailIOSUrl - nvarchar(100)
           @FailAndroidUrl , -- FailAndroidUrl - nvarchar(100)
           @FailJumpMode , -- FailJumpMode - int
           @FailWaitTime , -- FailWaitTime - int
           GETDATE() , -- CreateDateTime - datetime
           GETDATE(),  -- UpdateDateTime - datetime
           @IsNewUser,
           @IsNeedCode,
            @IsPostion,@IsSendMsg,@SendMsg,
                 @NewBottomBanner,@NewPageIOSUrl,@NewPageAndroidUrl,@NewIOSUrl,@NewAndroidUrl,@SuccessfulPageIOSUrl,@SuccessfulPageAndroidUrl,@FailPageIOSUrl,@FailPageAndroidUrl,@TipStyle,@NewJumpMode,@NewWaitTime,
             @NewUserTip,@OldUserTip,@ActivityNoStartTip,@ActivityOverTip,@CouponTip,@PageTip,@LimitUserTypeTip,@AlreadyHadTip,@DefaultTip,@BlackTip,@CardChannel,@CardConsumedURL,@CardExpireURL,
            @CardGiftingURL,@CardGiftTimeOutURL,@CardDeleteURL,@CardUnavailableURL,@CardInvalidSerialCodeURL,@TokenAccessFailedURL,@CreatorUser,@UpdateUser
         )");
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = sql.ToString();
                model.ID        = Guid.NewGuid();
                cmd.Parameters.AddWithValue("@ID", model.ID.Value);
                cmd.Parameters.AddWithValue("@ActivityName", model.ActivityName);
                cmd.Parameters.AddWithValue("@StartDateTime", model.StartDateTime);
                cmd.Parameters.AddWithValue("@EndDateTime", model.EndDateTime);
                cmd.Parameters.AddWithValue("@Channel", model.Channel);
                cmd.Parameters.AddWithValue("@Status", model.Status);
                cmd.Parameters.AddWithValue("@TopBanner", model.TopBanner);
                cmd.Parameters.AddWithValue("@BottomBanner", model.BottomBanner);
                cmd.Parameters.AddWithValue("@NumberCodeTimes", model.NumberCodeTimes);
                cmd.Parameters.AddWithValue("@ChartCodeTimes", model.ChartCodeTimes);
                cmd.Parameters.AddWithValue("@AutoCompleteTimes", model.AutoCompleteTimes);
                cmd.Parameters.AddWithValue("@CodeErrorTimes", model.CodeErrorTimes);
                cmd.Parameters.AddWithValue("@LimitPhoneHourse", model.LimitPhoneHourse);
                cmd.Parameters.AddWithValue("@NewUserValidMode", model.NewUserValidMode);
                cmd.Parameters.AddWithValue("@SuccessfulTopBanner", model.SuccessfulTopBanner);
                cmd.Parameters.AddWithValue("@SuccessfulCenterBanner", model.SuccessfulCenterBanner);
                cmd.Parameters.AddWithValue("@SuccessfulBottomBanner", model.SuccessfulBottomBanner);
                cmd.Parameters.AddWithValue("@SuccessfulIOSUrl", model.SuccessfulIOSUrl);
                cmd.Parameters.AddWithValue("@SuccessfulAndroidUrl", model.SuccessfulAndroidUrl);
                cmd.Parameters.AddWithValue("@SuccessfulJumpMode", model.SuccessfulJumpMode);
                cmd.Parameters.AddWithValue("@SuccessfulWaitTime", model.SuccessfulWaitTime);
                cmd.Parameters.AddWithValue("@FailTopBanner", model.FailTopBanner);
                cmd.Parameters.AddWithValue("@FailCenterBanner", model.FailCenterBanner);
                cmd.Parameters.AddWithValue("@FailBottomBanner", model.FailBottomBanner);
                cmd.Parameters.AddWithValue("@FailIOSUrl", model.FailIOSUrl);
                cmd.Parameters.AddWithValue("@FailAndroidUrl", model.FailAndroidUrl);
                cmd.Parameters.AddWithValue("@FailJumpMode", model.FailJumpMode);
                cmd.Parameters.AddWithValue("@FailWaitTime", model.FailWaitTime);
                cmd.Parameters.AddWithValue("@IsNewUser", model.IsNewUser);
                cmd.Parameters.AddWithValue("@IsNeedCode", model.IsNeedCode);
                cmd.Parameters.AddWithValue("@IsPostion", model.IsPostion);
                cmd.Parameters.AddWithValue("@IsSendMsg", model.IsSendMsg);
                cmd.Parameters.AddWithValue("@SendMsg", model.SendMsg);
                cmd.Parameters.AddWithValue("@NewBottomBanner", model.NewBottomBanner);
                cmd.Parameters.AddWithValue("@NewPageIOSUrl", model.NewPageIOSUrl);
                cmd.Parameters.AddWithValue("@NewPageAndroidUrl", model.NewPageAndroidUrl);
                cmd.Parameters.AddWithValue("@NewIOSUrl", model.NewIOSUrl);
                cmd.Parameters.AddWithValue("@NewAndroidUrl", model.NewAndroidUrl);
                cmd.Parameters.AddWithValue("@SuccessfulPageAndroidUrl", model.SuccessfulPageAndroidUrl);
                cmd.Parameters.AddWithValue("@SuccessfulPageIOSUrl", model.SuccessfulPageIOSUrl);
                cmd.Parameters.AddWithValue("@FailPageAndroidUrl", model.FailPageAndroidUrl);
                cmd.Parameters.AddWithValue("@FailPageIOSUrl", model.FailPageIOSUrl);
                cmd.Parameters.AddWithValue("@TipStyle", model.TipStyle);
                cmd.Parameters.AddWithValue("@NewJumpMode", model.NewJumpMode);
                cmd.Parameters.AddWithValue("@NewWaitTime", model.NewWaitTime);
                cmd.Parameters.AddWithValue("@NewUserTip", model.NewUserTip);
                cmd.Parameters.AddWithValue("@OldUserTip", model.OldUserTip);
                cmd.Parameters.AddWithValue("@ActivityNoStartTip", model.ActivityNoStartTip);
                cmd.Parameters.AddWithValue("@ActivityOverTip", model.ActivityOverTip);
                cmd.Parameters.AddWithValue("@CouponTip", model.CouponTip);
                cmd.Parameters.AddWithValue("@PageTip", model.PageTip);
                cmd.Parameters.AddWithValue("@LimitUserTypeTip", model.LimitUserTypeTip);
                cmd.Parameters.AddWithValue("@AlreadyHadTip", model.AlreadyHadTip);
                cmd.Parameters.AddWithValue("@DefaultTip", model.DefaultTip);
                cmd.Parameters.AddWithValue("@BlackTip", model.BlackTip);

                cmd.Parameters.AddWithValue("@CardChannel", model.CardChannel);
                cmd.Parameters.AddWithValue("@CardConsumedURL", model.CardConsumedURL);
                cmd.Parameters.AddWithValue("@CardExpireURL", model.CardExpireURL);
                cmd.Parameters.AddWithValue("@CardGiftingURL", model.CardGiftingURL);
                cmd.Parameters.AddWithValue("@CardGiftTimeOutURL", model.CardGiftTimeOutURL);
                cmd.Parameters.AddWithValue("@CardDeleteURL", model.CardDeleteURL);
                cmd.Parameters.AddWithValue("@CardUnavailableURL", model.CardUnavailableURL);
                cmd.Parameters.AddWithValue("@CardInvalidSerialCodeURL", model.CardInvalidSerialCodeURL);
                cmd.Parameters.AddWithValue("@TokenAccessFailedURL", model.TokenAccessFailedURL);
                cmd.Parameters.AddWithValue("@CreatorUser", model.CreatorUser);
                cmd.Parameters.AddWithValue("@UpdateUser", model.UpdateUser);
                db.ExecuteNonQuery(cmd);

                foreach (var item in model.CouponItems)
                {
                    item.FK_GetPromotionActivityID = model.ID.Value;
                    item.Status = true;
                    InsertCouponInfo(db, item);
                }

                db.Commit();
                result = true;
            }
            catch (Exception em)
            {
                db.Rollback();
                result = false;
            }
            finally
            {
                db.Dispose();
            }
            return(result);
        }