Exemple #1
0
        /// <summary>
        /// 使一个购买单的佣金生效
        /// 完结订单时使用
        /// </summary>
        /// <param name="order"></param>
        public void AgentMoneyOK()
        {
            //string sql = "update Lebi_Agent_Money set Type_id_AgentMoneyType=382 where Order_id=" + order.id + "";
            //Common.ExecuteSql(sql);
            List <Lebi_Agent_Money> models = B_Lebi_Agent_Money.GetList("Order_id=" + Order.id + "", "");

            foreach (Lebi_Agent_Money model in models)
            {
                model.Type_id_AgentMoneyStatus = 382;
                Lebi_User user = B_Lebi_User.GetModel(model.User_id);
                if (user != null)
                {
                    UpdateUserMoney(user, model);
                    B_Lebi_Agent_Money.Update(model);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// 使一个购买单的佣金失效
        /// 已完结订单取消完结时使用
        /// </summary>
        /// <param name="order"></param>
        public void AgentMoneyCancal()
        {
            //string sql = "update Lebi_Agent_Money set Type_id_AgentMoneyType=383 where Order_id=" + order.id + "";
            //Common.ExecuteSql(sql);
            List <Lebi_Agent_Money> models = B_Lebi_Agent_Money.GetList("Order_id=" + Order.id + "", "");

            foreach (Lebi_Agent_Money model in models)
            {
                model.Type_id_AgentMoneyStatus = 381;
                Lebi_User user = B_Lebi_User.GetModel(model.User_id);
                if (user != null)
                {
                    B_Lebi_Agent_Money.Update(model);
                    user.AgentMoney_history -= model.Money;
                    user.AgentMoney         -= model.Money;
                    B_Lebi_User.Update(user);
                    //model.Money = 0 - model.Money;
                    //UpdateUserMoney(user, model);
                }
            }
        }