/// <summary> /// 用户冲值升级 /// </summary> public bool Upgrade(int id, decimal price) { if (!Exists(id)) { return(false); } Model.users model = Get(id); Model.user_groups groupModel = new user_groups().GetUpgradePrice(model.group_id, price); if (null == groupModel) { 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, 1, "升级获得积分", true); } //增加金额 if (groupModel.amount > 0) { new BLL.user_amount_log().Add(model.id, model.user_name, groupModel.amount, "升级赠送金额"); } } return(true); }
/// <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 + ",group_start_time=" + DateTime.Now + ",group_end_time=" + DateTime.Now.AddDays(365)); 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, groupModel.amount, "升级赠送金额"); } } return(true); }
/// <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, DTEnums.AmountTypeEnum.SysGive.ToString(), groupModel.amount, "升级赠送金额", 1); } } return(true); }
/// <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.point_log().Add(model.id, model.user_name, groupModel.point, "������û���"); } //���ӽ�� if (groupModel.amount > 0) { new BLL.amount_log().Add(model.id, model.user_name, DTEnums.AmountTypeEnum.SysGive.ToString(), groupModel.amount, "�������ͽ��", 1); } } return true; }
/// <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, groupModel.amount, "升级赠送金额"); } } return true; }