Ejemplo n.º 1
0
        public static int BuyTopic(int uid, int tid, int posterid, int price, float netamount)
        {
            if (price > Scoresets.GetMaxIncPerTopic())
            {
                Scoresets.GetMaxIncPerTopic();
            }

            var user = User.FindByID(uid);

            if (user == null)
            {
                return(-2);
            }

            if (PaymentLogs.GetUserExtCredits(user, Scoresets.GetTopicAttachCreditsTrans()) < (float)price)
            {
                return(-1);
            }

            Discuz.Data.Users.BuyTopic(uid, tid, posterid, price, netamount, Scoresets.GetTopicAttachCreditsTrans());
            CreditsFacade.UpdateUserCredits(uid);
            CreditsFacade.UpdateUserCredits(posterid);
            return(Discuz.Data.PaymentLogs.CreatePaymentLog(uid, tid, posterid, price, netamount));
        }
Ejemplo n.º 2
0
 public static DataTable GetPayLogOutList(int pagesize, int currentpage, int uid)
 {
     return(PaymentLogs.LoadPayLogForumName(DatabaseProvider.GetInstance().GetPayLogOutList(pagesize, currentpage, uid)));
 }
Ejemplo n.º 3
0
 public static DataTable GetPayLogInList(int pagesize, int currentpage, int uid)
 {
     return(PaymentLogs.LoadPayLogForumName(Discuz.Data.PaymentLogs.GetPayLogInList(pagesize, currentpage, uid)));
 }