コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["ActiveId"]))
     {
         int.TryParse(base.Request.QueryString["ActiveId"], out activeId);
     }
     LoadParameters();
     if (!Page.IsPostBack)
     {
         dropCategories.DataBind();
         dropCategories.SelectedValue = categoryId;
         BindProducts();
         PromotionInfo promotionInfoById = new PromotionInfo();
         promotionInfoById = SubsitePromoteHelper.GetPromotionInfoById(activeId);
         lblPromtion.Text = promotionInfoById.Name;
         ProductIds = SubsitePromoteHelper.GetPromotionProducts(activeId);
         BindPromoteProducts();
     }
     CheckBoxColumn.RegisterClientCheckEvents(Page, Page.Form.ClientID);
 }
コード例 #2
0
ファイル: FullDiscountFactory.cs プロジェクト: davinx/himedi
 public override PromotionActionStatus Create(PromotionInfo promote)
 {
     return provider.CreateFullDiscount(promote as FullDiscountInfo);
 }
コード例 #3
0
ファイル: CommentBrowser.cs プロジェクト: davinx/himedi
 public static PromotionInfo GetFrontOrNextPromoteInfo(PromotionInfo promote, string type)
 {
     return CommentProvider.Instance().GetFrontOrNextPromoteInfo(promote, type);
 }
コード例 #4
0
ファイル: PurchaseGiftFactory.cs プロジェクト: davinx/himedi
 public override PromotionActionStatus Create(PromotionInfo promote)
 {
     return this.provider.CreatePurchaseGift(promote as PurchaseGiftInfo);
 }
コード例 #5
0
ファイル: CommentData.cs プロジェクト: davinx/himedi
 public override PromotionInfo GetFrontOrNextPromoteInfo(PromotionInfo promote, string type)
 {
     string query = string.Empty;
     if (type == "Next")
     {
         query = "SELECT TOP 1 * FROM Hishop_Promotions WHERE activityId<@activityId AND PromoteType=@PromoteType  ORDER BY activityId DESC";
     }
     else
     {
         query = "SELECT TOP 1 * FROM Hishop_Promotions WHERE activityId>@activityId AND PromoteType=@PromoteType ORDER BY activityId ASC";
     }
     DbCommand sqlStringCommand = this.database.GetSqlStringCommand(query);
     this.database.AddInParameter(sqlStringCommand, "activityId", DbType.Int32, promote.ActivityId);
     this.database.AddInParameter(sqlStringCommand, "PromoteType", DbType.Int32, Convert.ToInt32(promote.PromoteType));
     PromotionInfo info = null;
     using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
     {
         if (reader.Read())
         {
             info = DataMapper.PopulatePromote(reader);
         }
         reader.Close();
     }
     return info;
 }
コード例 #6
0
ファイル: PromotionFactory.cs プロジェクト: davinx/himedi
 public abstract PromotionActionStatus Create(PromotionInfo promote);
コード例 #7
0
ファイル: PromoteHelper.cs プロジェクト: davinx/himedi
 public static PromotionActionStatus AddPromotion(PromotionInfo promotion)
 {
     Globals.EntityCoding(promotion, true);
     return PromotionFactory.Create(promotion.PromoteType).Create(promotion);
 }
コード例 #8
0
ファイル: CommentProvider.cs プロジェクト: davinx/himedi
 public abstract PromotionInfo GetFrontOrNextPromoteInfo(PromotionInfo promote, string type);
コード例 #9
0
ファイル: PromotionData.cs プロジェクト: davinx/himedi
 public override WholesaleDiscountInfo GetWholesaleDiscountInfo(int activeId)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("SELECT * FROM distro_Promotions P INNER JOIN distro_WholesaleDiscounts F ON P.ActivityId=F.ActivityId WHERE P.ActivityId=@ActivityId AND P.DistributorUserId=@DistributorUserId");
     database.AddInParameter(sqlStringCommand, "ActivityId", DbType.Int32, activeId);
     database.AddInParameter(sqlStringCommand, "DistributorUserId", DbType.Int32, HiContext.Current.User.UserId);
     PromotionInfo info = new PromotionInfo();
     WholesaleDiscountInfo info2 = new WholesaleDiscountInfo();
     using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
     {
         if (reader.Read())
         {
             info = DataMapper.PopulatePromote(reader);
             info2 = DataMapper.PopulateWholesaleDiscount(reader);
         }
         info2.Name = info.Name;
         info2.Description = info.Description;
     }
     return info2;
 }
コード例 #10
0
 public override PromotionActionStatus Create(PromotionInfo promote)
 {
     return this.provider.CreateWholesaleDiscount(promote as WholesaleDiscountInfo);
 }
コード例 #11
0
ファイル: PromotionData.cs プロジェクト: davinx/himedi
 public override PromotionInfo GetPromotionInfoById(int activeId)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("SELECT * FROM distro_Promotions WHERE ActivityId=@ActivityId AND DistributorUserId=@DistributorUserId");
     database.AddInParameter(sqlStringCommand, "ActivityId", DbType.Int32, activeId);
     database.AddInParameter(sqlStringCommand, "DistributorUserId", DbType.Int32, HiContext.Current.User.UserId);
     PromotionInfo entity = new PromotionInfo();
     using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
     {
         if (reader.Read())
         {
             entity = DataMapper.PopulatePromote(reader);
         }
     }
     Globals.EntityCoding(entity, false);
     return entity;
 }
コード例 #12
0
ファイル: PromotionData.cs プロジェクト: davinx/himedi
 PromotionActionStatus UpdatePromotion(PromotionInfo promotion, DbTransaction tran)
 {
     DbCommand storedProcCommand = database.GetStoredProcCommand("sub_Promotions_Update");
     database.AddInParameter(storedProcCommand, "DistributorUserId", DbType.Int32, HiContext.Current.User.UserId);
     database.AddInParameter(storedProcCommand, "ActivityId", DbType.Int32, promotion.ActivityId);
     database.AddInParameter(storedProcCommand, "Name", DbType.String, promotion.Name);
     database.AddInParameter(storedProcCommand, "Description", DbType.String, promotion.Description);
     database.AddParameter(storedProcCommand, "ReturnValue", DbType.Int32, ParameterDirection.ReturnValue, string.Empty, DataRowVersion.Default, null);
     database.ExecuteNonQuery(storedProcCommand, tran);
     return (PromotionActionStatus)Convert.ToInt32(database.GetParameterValue(storedProcCommand, "ReturnValue"));
 }
コード例 #13
0
ファイル: PromotionData.cs プロジェクト: davinx/himedi
 int CreatePromotion(PromotionInfo promotion, DbTransaction tran)
 {
     DbCommand storedProcCommand = database.GetStoredProcCommand("sub_Promotions_Add");
     database.AddInParameter(storedProcCommand, "Name", DbType.String, promotion.Name);
     database.AddInParameter(storedProcCommand, "PromoteType", DbType.Int32, (int)promotion.PromoteType);
     database.AddInParameter(storedProcCommand, "Description", DbType.String, promotion.Description);
     database.AddInParameter(storedProcCommand, "DistributorUserId", DbType.Int32, HiContext.Current.User.UserId);
     return Convert.ToInt32(database.ExecuteScalar(storedProcCommand, tran));
 }
コード例 #14
0
ファイル: FullFreeFactory.cs プロジェクト: davinx/himedi
 public override PromotionActionStatus Create(PromotionInfo promote)
 {
     return provider.CreateFullFree(promote as FullFreeInfo);
 }
コード例 #15
0
ファイル: PromotionData.cs プロジェクト: davinx/himedi
 public override PurchaseGiftInfo GetPurchaseGiftInfo(int activeId)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("SELECT * FROM Hishop_Promotions P INNER JOIN Hishop_PurchaseGifts F ON P.ActivityId=F.ActivityId WHERE P.ActivityId=@ActivityId");
     database.AddInParameter(sqlStringCommand, "ActivityId", DbType.Int32, activeId);
     PromotionInfo info = new PromotionInfo();
     PurchaseGiftInfo info2 = new PurchaseGiftInfo();
     using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
     {
         if (reader.Read())
         {
             info = DataMapper.PopulatePromote(reader);
             info2 = DataMapper.PopulatePurchaseGift(reader);
         }
         info2.Name = info.Name;
         info2.Description = info.Description;
     }
     return info2;
 }