Exemple #1
0
        /// <summary>
        /// 用户升级
        /// </summary>
        public bool Upgrade(int id)
        {
            if (!Exists(id))
            {
                return(false);
            }
            Model.users       model      = GetModel(id);
            Model.user_groups groupModel = new user_groups().GetUpgrade(model.group_id, model.exp);
            if (groupModel == null)
            {
                return(false);
            }
            int result = UpdateField(id, "group_id=" + groupModel.id);

            if (result > 0)
            {
                //增加积分
                if (groupModel.point > 0)
                {
                    new BLL.user_point_log().Add(model.id, model.user_name, groupModel.point, "升级获得积分", true);
                }
                //增加金额
                if (groupModel.amount > 0)
                {
                    new BLL.user_amount_log().Add(model.id, model.user_name, MXEnums.AmountTypeEnum.SysGive.ToString(), groupModel.amount, "升级赠送金额", 1);
                }
            }
            return(true);
        }
Exemple #2
0
 /// <summary>
 /// �û�����
 /// </summary>
 public bool Upgrade(int id)
 {
     if (!Exists(id))
     {
         return false;
     }
     Model.users model = GetModel(id);
     Model.user_groups groupModel = new user_groups().GetUpgrade(model.group_id, model.exp);
     if (groupModel == null)
     {
         return false;
     }
     int result = UpdateField(id, "group_id=" + groupModel.id);
     if (result > 0)
     {
         //���ӻ���
         if (groupModel.point > 0)
         {
             new BLL.user_point_log().Add(model.id, model.user_name, groupModel.point, "������û���", true);
         }
         //���ӽ��
         if (groupModel.amount > 0)
         {
             new BLL.user_amount_log().Add(model.id, model.user_name, MXEnums.AmountTypeEnum.SysGive.ToString(), groupModel.amount, "�������ͽ��", 1);
         }
     }
     return true;
 }