public static bool BindTaobaoSetting(bool isUserHomeSiteApp, string topkey, string topSecret)
 {
     if (HiContext.Current.User.UserRole != UserRole.Distributor)
     {
         return(false);
     }
     return(SubsiteStoreProvider.Instance().BindTaobaoSetting(isUserHomeSiteApp, topkey, topSecret));
 }
 public static bool CreateFriendlyLink(FriendlyLinksInfo friendlyLink)
 {
     if (null == friendlyLink)
     {
         return(false);
     }
     return(SubsiteStoreProvider.Instance().CreateUpdateDeleteFriendlyLink(friendlyLink, DataProviderAction.Create));
 }
Esempio n. 3
0
        public static bool UpdateVote(VoteInfo vote)
        {
            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 (!SubsiteStoreProvider.Instance().UpdateVote(vote, dbTransaction))
                    {
                        dbTransaction.Rollback();
                        result = false;
                    }
                    else
                    {
                        if (!SubsiteStoreProvider.Instance().DeleteVoteItem(vote.VoteId, dbTransaction))
                        {
                            dbTransaction.Rollback();
                            result = false;
                        }
                        else
                        {
                            int num = 0;
                            if (vote.VoteItems != null)
                            {
                                foreach (VoteItemInfo current in vote.VoteItems)
                                {
                                    current.VoteId    = vote.VoteId;
                                    current.ItemCount = 0;
                                    num += SubsiteStoreProvider.Instance().CreateVoteItem(current, dbTransaction);
                                }
                                if (num < vote.VoteItems.Count)
                                {
                                    dbTransaction.Rollback();
                                    result = false;
                                    return(result);
                                }
                            }
                            dbTransaction.Commit();
                            result = true;
                        }
                    }
                }
                catch
                {
                    dbTransaction.Rollback();
                    result = false;
                }
                finally
                {
                    dbConnection.Close();
                }
            }
            return(result);
        }
        public static bool Recharge(BalanceDetailInfo balanceDetails)
        {
            bool flag = SubsiteStoreProvider.Instance().IsRecharge(balanceDetails.InpourId);

            if (!flag)
            {
                flag = SubsiteStoreProvider.Instance().AddBalanceDetail(balanceDetails);
                SubsiteStoreProvider.Instance().RemoveInpourRequest(balanceDetails.InpourId);
            }
            return(flag);
        }
Esempio n. 5
0
        public static bool Recharge(BalanceDetailInfo balanceDetails)
        {
            bool result;

            if (!(result = SubsiteStoreProvider.Instance().IsRecharge(balanceDetails.InpourId)))
            {
                result = SubsiteStoreProvider.Instance().AddBalanceDetail(balanceDetails);
                SubsiteStoreProvider.Instance().RemoveInpourRequest(balanceDetails.InpourId);
            }
            return(result);
        }
        public static bool UpdateVote(VoteInfo vote)
        {
            bool flag;

            using (DbConnection connection = DatabaseFactory.CreateDatabase().CreateConnection())
            {
                connection.Open();
                DbTransaction dbTran = connection.BeginTransaction();
                try
                {
                    if (!SubsiteStoreProvider.Instance().UpdateVote(vote, dbTran))
                    {
                        dbTran.Rollback();
                        return(false);
                    }
                    if (!SubsiteStoreProvider.Instance().DeleteVoteItem(vote.VoteId, dbTran))
                    {
                        dbTran.Rollback();
                        return(false);
                    }
                    int num = 0;
                    if (vote.VoteItems != null)
                    {
                        foreach (VoteItemInfo info in vote.VoteItems)
                        {
                            info.VoteId    = vote.VoteId;
                            info.ItemCount = 0;
                            num           += SubsiteStoreProvider.Instance().CreateVoteItem(info, dbTran);
                        }
                        if (num < vote.VoteItems.Count)
                        {
                            dbTran.Rollback();
                            return(false);
                        }
                    }
                    dbTran.Commit();
                    flag = true;
                }
                catch
                {
                    dbTran.Rollback();
                    flag = false;
                }
                finally
                {
                    connection.Close();
                }
            }
            return(flag);
        }
Esempio n. 7
0
        public static int CreateVote(VoteInfo vote)
        {
            int  num  = 0;
            long num2 = SubsiteStoreProvider.Instance().CreateVote(vote);

            if (num2 > 0L)
            {
                num = 1;
                if (vote.VoteItems != null)
                {
                    foreach (VoteItemInfo current in vote.VoteItems)
                    {
                        current.VoteId    = num2;
                        current.ItemCount = 0;
                        num += SubsiteStoreProvider.Instance().CreateVoteItem(current, null);
                    }
                }
            }
            return(num);
        }
        public static int CreateVote(VoteInfo vote)
        {
            int  num  = 0;
            long num2 = SubsiteStoreProvider.Instance().CreateVote(vote);

            if (num2 > 0L)
            {
                num = 1;
                if (vote.VoteItems == null)
                {
                    return(num);
                }
                foreach (VoteItemInfo info in vote.VoteItems)
                {
                    info.VoteId    = num2;
                    info.ItemCount = 0;
                    num           += SubsiteStoreProvider.Instance().CreateVoteItem(info, null);
                }
            }
            return(num);
        }
 public static bool AddInpourBalance(InpourRequestInfo inpourRequest)
 {
     return(SubsiteStoreProvider.Instance().AddInpourBlance(inpourRequest));
 }
 public static void SwapHotWordsSequence(int hid, int replaceHid, int displaySequence, int replaceDisplaySequence)
 {
     SubsiteStoreProvider.Instance().SwapHotWordsSequence(hid, replaceHid, displaySequence, replaceDisplaySequence);
 }
 public static void SwapFriendlyLinkSequence(int linkId, int replaceLinkId, int displaySequence, int replaceDisplaySequence)
 {
     SubsiteStoreProvider.Instance().SwapFriendlyLinkSequence(linkId, replaceLinkId, displaySequence, replaceDisplaySequence);
 }
 public static int SetVoteIsBackup(long voteId)
 {
     return(SubsiteStoreProvider.Instance().SetVoteIsBackup(voteId));
 }
 public static PaymentModeInfo GetPaymentMode(string gateway)
 {
     return(SubsiteStoreProvider.Instance().GetPaymentMode(gateway));
 }
 public static InpourRequestInfo GetInpouRequest(string inpourId)
 {
     return(SubsiteStoreProvider.Instance().GetInpouRequest(inpourId));
 }
 public static bool AddSiteRequest(SiteRequestInfo siteRequest)
 {
     return(SubsiteStoreProvider.Instance().AddSiteRequest(siteRequest));
 }
 public static IList <VoteItemInfo> GetVoteItems(long voteId)
 {
     return(SubsiteStoreProvider.Instance().GetVoteItems(voteId));
 }
 public static DataSet GetVotes()
 {
     return(SubsiteStoreProvider.Instance().GetVotes());
 }
 public static int GetVoteCounts(long voteId)
 {
     return(SubsiteStoreProvider.Instance().GetVoteCounts(voteId));
 }
 public static VoteInfo GetVoteById(long voteId)
 {
     return(SubsiteStoreProvider.Instance().GetVoteById(voteId));
 }
 public static IList <PaymentModeInfo> GetPaymentModes()
 {
     return(SubsiteStoreProvider.Instance().GetPaymentModes());
 }
 public static void UpdateHotWords(int hid, int categoryId, string hotKeyWords)
 {
     SubsiteStoreProvider.Instance().UpdateHotWords(hid, categoryId, hotKeyWords);
 }
 public static SiteRequestInfo GetMySiteRequest()
 {
     return(SubsiteStoreProvider.Instance().GetMySiteRequest());
 }
 public static AccountSummaryInfo GetMyAccountSummary()
 {
     return(SubsiteStoreProvider.Instance().GetMyAccountSummary());
 }
 public static DbQueryResult GetMyBalanceDetails(BalanceDetailQuery query)
 {
     return(SubsiteStoreProvider.Instance().GetMyBalanceDetails(query));
 }
 public static bool BalanceDrawRequest(BalanceDrawRequestInfo balanceDrawRequest)
 {
     return(SubsiteStoreProvider.Instance().BalanceDrawRequest(balanceDrawRequest));
 }
 public static void RemoveInpourRequest(string inpourId)
 {
     SubsiteStoreProvider.Instance().RemoveInpourRequest(inpourId);
 }
 public static void AddHotkeywords(int categoryId, string keywords)
 {
     SubsiteStoreProvider.Instance().AddHotkeywords(categoryId, keywords);
 }
 public static PaymentModeInfo GetPaymentMode(int modeId)
 {
     return(SubsiteStoreProvider.Instance().GetPaymentMode(modeId));
 }
 public static void DeleteHotKeywords(int hid)
 {
     SubsiteStoreProvider.Instance().DeleteHotKeywords(hid);
 }
 public static bool IsExitSiteUrl(string siteUrl)
 {
     return(SubsiteStoreProvider.Instance().IsExitSiteUrl(siteUrl));
 }