public static void AdjustCustomerExperience(int customerSysNo, decimal experience, ExperienceLogType type, string memo) { CustomerExperienceLog entity = new CustomerExperienceLog(); entity.CustomerSysNo = customerSysNo; entity.Amount = experience; entity.Memo = memo; entity.Type = type; CustomerBasicInfo customer = GetCustomerInfo(customerSysNo); var totalExperience = customer.TotalExperience.Value; totalExperience = totalExperience + entity.Amount.Value; if (totalExperience < 0) { throw new BusinessException("顾客的最终经验值必须为正值"); } CustomerDA.UpdateExperience(entity.CustomerSysNo.Value, totalExperience); CustomerExperienceLog cuslog = new CustomerExperienceLog(); cuslog.CustomerSysNo = entity.CustomerSysNo; cuslog.Amount = entity.Amount; cuslog.Memo = string.Format("(用户系统号:{0};原值:{1}){2}", entity.CustomerSysNo, totalExperience - cuslog.Amount, entity.Memo); cuslog.Type = entity.Type; CustomerDA.InsertExperienceLog(cuslog); CustomerDA.SetRank(entity.CustomerSysNo.Value); }
public static void InsertExperienceLog(CustomerExperienceLog entity) { DataCommand cmd = DataCommandManager.GetDataCommand("InsertExperienceLog"); cmd.SetParameterValue <CustomerExperienceLog>(entity); cmd.ExecuteNonQuery(); }
public virtual void Adjust(BizEntity.Customer.CustomerExperienceLog adjustInfo) { var totalExperience = GetValidExperience(adjustInfo.CustomerSysNo.Value); totalExperience = totalExperience + adjustInfo.Amount.Value; if (totalExperience < 0) { throw new BizException(ResouceManager.GetMessageString("Customer.CustomerInfo", "CustomerExpericeMustMoreThanZero")); } ObjectFactory <ICustomerInfoDA> .Instance.UpdateExperience(adjustInfo.CustomerSysNo.Value, totalExperience); if (adjustInfo.Type != ExperienceLogType.MerchantSOOutbound) { CustomerExperienceLog cuslog = new CustomerExperienceLog(); cuslog.CustomerSysNo = adjustInfo.CustomerSysNo; cuslog.Amount = adjustInfo.Amount; cuslog.Memo = string.Format(ResouceManager.GetMessageString("Customer.CustomerInfo", "ManualAdjustUserExperience_Log_Memo"), adjustInfo.CustomerSysNo, totalExperience - cuslog.Amount, adjustInfo.Memo); cuslog.Type = adjustInfo.Type; ObjectFactory <ICustomerInfoDA> .Instance.InsertExperienceLog(cuslog); } else { ObjectFactory <RankProcessor> .Instance.SetVIPRank(adjustInfo.CustomerSysNo.Value); } ObjectFactory <RankProcessor> .Instance.SetRank(adjustInfo.CustomerSysNo.Value); }
public void ManualAdjustUserExperience(ExperienceVM vm, EventHandler <RestClientEventArgs <CustomerExperienceLog> > callback) { string relativeUrl = "/CustomerService/Customer/ManualAdjustUserExperience"; CustomerExperienceLog msg = vm.ConvertVM <ExperienceVM, CustomerExperienceLog>(); restClient.Update(relativeUrl, msg, callback); }
public virtual void AdjustCustomerExperience(int customerSysNo, decimal experience, ExperienceLogType type, string memo) { CustomerExperienceLog entity = new CustomerExperienceLog(); entity.CustomerSysNo = customerSysNo; entity.Amount = experience; entity.Memo = memo; entity.Type = type; ObjectFactory <ExperienceProcessor> .Instance.Adjust(entity); }
/// <summary> /// 手动调整经验值 /// </summary> /// <param name="CustomerSysNo"></param> /// <param name="Amount"></param> /// <param name="Memo"></param> /// <returns></returns> public virtual void AdjustExperience(CustomerExperienceLog adjustInfo) { ObjectFactory <ExperienceProcessor> .Instance.Adjust(adjustInfo); }
public void ManualAdjustUserExperience(CustomerExperienceLog adjustInfo) { ObjectFactory <CustomerAppService> .Instance.AdjustExperience(adjustInfo); }