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 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);
            }
        }
 public DALFlagshipStoreConfig()
 {
     db = DbHelper.CreateDefaultDbHelper();
 }
        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 DALGetPromotionActivityConfig()
 {
     db = DbHelper.CreateDefaultDbHelper();
 }
示例#9
0
 public DalABTestPlatform()
 {
     db = DbHelper.CreateDefaultDbHelper();
 }