public static void SendClaimCodes(int couponId, IList <CouponItemInfo> listCouponItem)
 {
     foreach (CouponItemInfo info in listCouponItem)
     {
         PromotionsProvider.Instance().SendClaimCodes(couponId, info);
     }
 }
Esempio n. 2
0
        public static int EditPromotion(PromotionInfo promotion)
        {
            int num;

            using (DbConnection connection = DatabaseFactory.CreateDatabase().CreateConnection())
            {
                connection.Open();
                DbTransaction dbTran = connection.BeginTransaction();
                try
                {
                    if (!PromotionsProvider.Instance().EditPromotion(promotion, dbTran))
                    {
                        dbTran.Rollback();
                        return(-1);
                    }
                    if (!PromotionsProvider.Instance().AddPromotionMemberGrades(promotion.ActivityId, promotion.MemberGradeIds, dbTran))
                    {
                        dbTran.Rollback();
                        return(-2);
                    }
                    dbTran.Commit();
                    num = 1;
                }
                catch (Exception)
                {
                    dbTran.Rollback();
                    num = 0;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Esempio n. 3
0
        public static bool DeleteGift(int giftId)
        {
            GiftInfo info2 = new GiftInfo();

            info2.GiftId = giftId;
            GiftInfo gift = info2;

            return(PromotionsProvider.Instance().CreateUpdateDeleteGift(gift, DataProviderAction.Delete) == GiftActionStatus.Success);
        }
Esempio n. 4
0
        public static bool DeleteGift(int giftId)
        {
            GiftInfo gift = new GiftInfo
            {
                GiftId = giftId
            };
            GiftActionStatus giftActionStatus = PromotionsProvider.Instance().CreateUpdateDeleteGift(gift, DataProviderAction.Delete);

            return(giftActionStatus == GiftActionStatus.Success);
        }
Esempio n. 5
0
        public static bool UpdateGroupBuy(GroupBuyInfo groupBuy)
        {
            Globals.EntityCoding(groupBuy, true);
            Database database = DatabaseFactory.CreateDatabase();
            bool     result;

            using (System.Data.Common.DbConnection dbConnection = database.CreateConnection())
            {
                dbConnection.Open();
                System.Data.Common.DbTransaction dbTransaction = dbConnection.BeginTransaction();
                try
                {
                    if (!PromotionsProvider.Instance().UpdateGroupBuy(groupBuy, dbTransaction))
                    {
                        dbTransaction.Rollback();
                        result = false;
                    }
                    else
                    {
                        if (!PromotionsProvider.Instance().DeleteGroupBuyCondition(groupBuy.GroupBuyId, dbTransaction))
                        {
                            dbTransaction.Rollback();
                            result = false;
                        }
                        else
                        {
                            if (!PromotionsProvider.Instance().AddGroupBuyCondition(groupBuy.GroupBuyId, groupBuy.GroupBuyConditions, dbTransaction))
                            {
                                dbTransaction.Rollback();
                                result = false;
                            }
                            else
                            {
                                dbTransaction.Commit();
                                result = true;
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    dbTransaction.Rollback();
                    result = false;
                }
                finally
                {
                    dbConnection.Close();
                }
            }
            return(result);
        }
Esempio n. 6
0
        public static bool UpdateBundlingProduct(BundlingInfo bundlingInfo)
        {
            Database database = DatabaseFactory.CreateDatabase();
            bool     result;

            using (System.Data.Common.DbConnection dbConnection = database.CreateConnection())
            {
                dbConnection.Open();
                System.Data.Common.DbTransaction dbTransaction = dbConnection.BeginTransaction();
                try
                {
                    if (!PromotionsProvider.Instance().UpdateBundlingProduct(bundlingInfo, dbTransaction))
                    {
                        dbTransaction.Rollback();
                        result = false;
                    }
                    else
                    {
                        if (!PromotionsProvider.Instance().DeleteBundlingByID(bundlingInfo.BundlingID, dbTransaction))
                        {
                            dbTransaction.Rollback();
                            result = false;
                        }
                        else
                        {
                            if (!PromotionsProvider.Instance().AddBundlingProductItems(bundlingInfo.BundlingID, bundlingInfo.BundlingItemInfos, dbTransaction))
                            {
                                dbTransaction.Rollback();
                                result = false;
                            }
                            else
                            {
                                dbTransaction.Commit();
                                result = true;
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    dbTransaction.Rollback();
                    result = false;
                }
                finally
                {
                    dbConnection.Close();
                }
            }
            return(result);
        }
Esempio n. 7
0
        public static int AddPromotion(PromotionInfo promotion)
        {
            Database database = DatabaseFactory.CreateDatabase();
            int      result;

            using (System.Data.Common.DbConnection dbConnection = database.CreateConnection())
            {
                dbConnection.Open();
                System.Data.Common.DbTransaction dbTransaction = dbConnection.BeginTransaction();
                try
                {
                    int num = PromotionsProvider.Instance().AddPromotion(promotion, dbTransaction);
                    if (num <= 0)
                    {
                        dbTransaction.Rollback();
                        result = -1;
                    }
                    else
                    {
                        if (!PromotionsProvider.Instance().AddPromotionMemberGrades(num, promotion.MemberGradeIds, dbTransaction))
                        {
                            dbTransaction.Rollback();
                            result = -2;
                        }
                        else
                        {
                            dbTransaction.Commit();
                            result = num;
                        }
                    }
                }
                catch (Exception)
                {
                    dbTransaction.Rollback();
                    result = 0;
                }
                finally
                {
                    dbConnection.Close();
                }
            }
            return(result);
        }
Esempio n. 8
0
        public static bool UpdateGroupBuy(GroupBuyInfo groupBuy)
        {
            bool flag;

            Globals.EntityCoding(groupBuy, true);
            using (DbConnection connection = DatabaseFactory.CreateDatabase().CreateConnection())
            {
                connection.Open();
                DbTransaction dbTran = connection.BeginTransaction();
                try
                {
                    if (!PromotionsProvider.Instance().UpdateGroupBuy(groupBuy, dbTran))
                    {
                        dbTran.Rollback();
                        return(false);
                    }
                    if (!PromotionsProvider.Instance().DeleteGroupBuyCondition(groupBuy.GroupBuyId, dbTran))
                    {
                        dbTran.Rollback();
                        return(false);
                    }
                    if (!PromotionsProvider.Instance().AddGroupBuyCondition(groupBuy.GroupBuyId, groupBuy.GroupBuyConditions, dbTran))
                    {
                        dbTran.Rollback();
                        return(false);
                    }
                    dbTran.Commit();
                    flag = true;
                }
                catch (Exception)
                {
                    dbTran.Rollback();
                    flag = false;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(flag);
        }
Esempio n. 9
0
        public static bool UpdateBundlingProduct(BundlingInfo bundlingInfo)
        {
            bool flag;

            using (DbConnection connection = DatabaseFactory.CreateDatabase().CreateConnection())
            {
                connection.Open();
                DbTransaction dbTran = connection.BeginTransaction();
                try
                {
                    if (!PromotionsProvider.Instance().UpdateBundlingProduct(bundlingInfo, dbTran))
                    {
                        dbTran.Rollback();
                        return(false);
                    }
                    if (!PromotionsProvider.Instance().DeleteBundlingByID(bundlingInfo.BundlingID, dbTran))
                    {
                        dbTran.Rollback();
                        return(false);
                    }
                    if (!PromotionsProvider.Instance().AddBundlingProductItems(bundlingInfo.BundlingID, bundlingInfo.BundlingItemInfos, dbTran))
                    {
                        dbTran.Rollback();
                        return(false);
                    }
                    dbTran.Commit();
                    flag = true;
                }
                catch (Exception)
                {
                    dbTran.Rollback();
                    flag = false;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(flag);
        }
Esempio n. 10
0
 public static bool SetGroupBuyStatus(int groupBuyId, GroupBuyStatus status)
 {
     return(PromotionsProvider.Instance().SetGroupBuyStatus(groupBuyId, status));
 }
Esempio n. 11
0
 public static bool SetGroupBuyEndUntreated(int groupBuyId)
 {
     return(PromotionsProvider.Instance().SetGroupBuyEndUntreated(groupBuyId));
 }
Esempio n. 12
0
 public static bool ProductGroupBuyExist(int productId)
 {
     return(PromotionsProvider.Instance().ProductGroupBuyExist(productId));
 }
Esempio n. 13
0
 public static bool ProductCountDownExist(int productId)
 {
     return(PromotionsProvider.Instance().ProductCountDownExist(productId));
 }
Esempio n. 14
0
 public static DataTable GetPromotions(bool isProductPromote, bool isWholesale)
 {
     return(PromotionsProvider.Instance().GetPromotions(isProductPromote, isWholesale));
 }
Esempio n. 15
0
 public static DbQueryResult GetCouponsList(CouponItemInfoQuery couponquery)
 {
     return(PromotionsProvider.Instance().GetCouponsList(couponquery));
 }
Esempio n. 16
0
 public static DbQueryResult GetBundlingProducts(BundlingInfoQuery query)
 {
     return(PromotionsProvider.Instance().GetBundlingProducts(query));
 }
Esempio n. 17
0
 public static IList <MemberGradeInfo> GetPromoteMemberGrades(int activityId)
 {
     return(PromotionsProvider.Instance().GetPromoteMemberGrades(activityId));
 }
Esempio n. 18
0
 public static IList <Member> GetMembersByRank(int?gradeId)
 {
     return(PromotionsProvider.Instance().GetMembersByRank(gradeId));
 }
Esempio n. 19
0
 public static bool AddCountDown(CountDownInfo countDownInfo)
 {
     return(PromotionsProvider.Instance().AddCountDown(countDownInfo));
 }
Esempio n. 20
0
 public static DbQueryResult GetGroupBuyList(GroupBuyQuery query)
 {
     return(PromotionsProvider.Instance().GetGroupBuyList(query));
 }
Esempio n. 21
0
 public static GroupBuyInfo GetGroupBuy(int groupBuyId)
 {
     return(PromotionsProvider.Instance().GetGroupBuy(groupBuyId));
 }
Esempio n. 22
0
 public static decimal GetCurrentPrice(int groupBuyId, int prodcutQuantity)
 {
     return(PromotionsProvider.Instance().GetCurrentPrice(groupBuyId, prodcutQuantity));
 }
Esempio n. 23
0
 public static void SwapCountDownSequence(int countDownId, int displaySequence)
 {
     PromotionsProvider.Instance().SwapCountDownSequence(countDownId, displaySequence);
 }
Esempio n. 24
0
 public static PromotionInfo GetPromotion(int activityId)
 {
     return(PromotionsProvider.Instance().GetPromotion(activityId));
 }
Esempio n. 25
0
 public static void SwapGroupBuySequence(int groupBuyId, int displaySequence)
 {
     PromotionsProvider.Instance().SwapGroupBuySequence(groupBuyId, displaySequence);
 }
Esempio n. 26
0
 public static DataTable GetPromotionProducts(int activityId)
 {
     return(PromotionsProvider.Instance().GetPromotionProducts(activityId));
 }
Esempio n. 27
0
 public static int GetOrderCount(int groupBuyId)
 {
     return(PromotionsProvider.Instance().GetOrderCount(groupBuyId));
 }
Esempio n. 28
0
 public static CountDownInfo GetCountDownInfo(int countDownId)
 {
     return(PromotionsProvider.Instance().GetCountDownInfo(countDownId));
 }
Esempio n. 29
0
 static FullFreeFactory()
 {
     _defaultInstance.provider = PromotionsProvider.Instance();
 }
Esempio n. 30
0
 public static string GetPriceByProductId(int productId)
 {
     return(PromotionsProvider.Instance().GetPriceByProductId(productId));
 }