/// <summary> /// 用户升级 /// </summary> public bool Upgrade(int id) { if (!Exists(id)) { return(false); } Model.users.users model = GetModel(id); Model.users.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.users.user_point_log().Add(model.id, model.user_name, groupModel.point, "升级获得积分", true); } //增加金额 if (groupModel.amount > 0) { new BLL.users.user_amount_log().Add(model.id, model.user_name, OSEnums.AmountTypeEnum.SysGive.ToString(), groupModel.amount, "升级赠送金额", 1); } } return(true); }
/// <summary> /// �û����� /// </summary> public bool Upgrade(int id) { if (!Exists(id)) { return false; } Model.users.users model = GetModel(id); Model.users.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.users.user_point_log().Add(model.id, model.user_name, groupModel.point, "������û���", true); } //���ӽ�� if (groupModel.amount > 0) { new BLL.users.user_amount_log().Add(model.id, model.user_name, OSEnums.AmountTypeEnum.SysGive.ToString(), groupModel.amount, "�������ͽ��", 1); } } return true; }