public ConsumerService() { try { var coreBuilder = new CoreBuilder(); coreBuilder.builder.RegisterModule <AutofacModules>(); coreBuilder.UserRedis(ConfigurationManager.ConnectionStrings["RedisConnectionString"].ConnectionString); coreBuilder.OnStarting(builder => { builder.RegisterType <MemoryEventBusService>().As <IMemoryEventBusService>().InstancePerMatchingLifetimeScope(); builder.RegisterType <DistributedEventBusService>().As <IDistributedEventBusService>().InstancePerMatchingLifetimeScope(); }); //拆分DLL后需要注册,需要注入的DLL Assembly[] asm = Utils.GetAllAssembly("MutualClass.*.dll").ToArray(); coreBuilder.Build(asm); CoreBuilderWork.LifetimeScope.Resolve <IDistributedEventBusService>(); //var _MutualClassRewardQueueService = CoreBuilderWork.LifetimeScope.Resolve<MutualClassRewardQueueService>(); //_MutualClassRewardQueueService.imq_onReceive_test(); } catch (Exception ex) { _Logger.Error("Autofac注册异常", ex); } InitializeComponent(); }
public dynamic GetInfo(int Id) { CoreBuilder model = new CoreBuilder(); try { model = _coreBuilderService.GetObjectById(Id); } catch (Exception ex) { LOG.Error("GetInfo", ex); model.Errors.Add("Generic", "Error : " + ex); } return(Json(new { model.Id, model.Name, model.Category, model.UoMId, UoM = _uomService.GetObjectById(model.UoMId).Name, model.BaseSku, model.SkuUsedCore, model.SkuNewCore, UsedCoreQuantity = _itemService.GetObjectById(model.UsedCoreItemId).Quantity, NewCoreQuantity = _itemService.GetObjectById(model.NewCoreItemId).Quantity, model.Errors }, JsonRequestBehavior.AllowGet)); }
public ConfluxBuffBuilders(IStatFactory statFactory) { Igniting = new BuffBuilder(statFactory, CoreBuilder.Create("IgnitingConflux")); Shocking = new BuffBuilder(statFactory, CoreBuilder.Create("ShockingConflux")); Chilling = new BuffBuilder(statFactory, CoreBuilder.Create("ChillingConflux")); Elemental = new BuffBuilder(statFactory, CoreBuilder.Create("ElementalConflux")); }
public RecoveryOrder VQuantityIsInStock(RecoveryOrder recoveryOrder, ICoreIdentificationDetailService _coreIdentificationDetailService, IRecoveryOrderDetailService _recoveryOrderDetailService, ICoreBuilderService _coreBuilderService, IItemService _itemService, IWarehouseItemService _warehouseItemService) { IList <RecoveryOrderDetail> details = _recoveryOrderDetailService.GetObjectsByRecoveryOrderId(recoveryOrder.Id); IDictionary <int, int> ValuePairItemIdQuantity = new Dictionary <int, int>(); foreach (var detail in details) { CoreIdentificationDetail coreIdentificationDetail = _coreIdentificationDetailService.GetObjectById(detail.CoreIdentificationDetailId); CoreBuilder coreBuilder = _coreBuilderService.GetObjectById(coreIdentificationDetail.CoreBuilderId); Item item = (coreIdentificationDetail.MaterialCase == Core.Constants.Constant.MaterialCase.New) ? _coreBuilderService.GetNewCore(coreBuilder.Id) : _coreBuilderService.GetUsedCore(coreBuilder.Id); WarehouseItem warehouseItem = _warehouseItemService.FindOrCreateObject(recoveryOrder.WarehouseId, item.Id); if (ValuePairItemIdQuantity.ContainsKey(warehouseItem.Id)) { ValuePairItemIdQuantity[warehouseItem.Id] += 1; } else { ValuePairItemIdQuantity.Add(warehouseItem.Id, 1); } } foreach (var ValuePair in ValuePairItemIdQuantity) { WarehouseItem warehouseItem = _warehouseItemService.GetObjectById(ValuePair.Key); if (warehouseItem.Quantity < ValuePair.Value) { recoveryOrder.Errors.Add("Generic", "Stock quantity core item tidak boleh kurang dari jumlah di dalam recovery order"); return(recoveryOrder); } } return(recoveryOrder); }
public CoreBuilder SoftDeleteObject(CoreBuilder coreBuilder, IItemService _itemService, IRollerBuilderService _rollerBuilderService, ICoreIdentificationDetailService _coreIdentificationDetailService, IRecoveryOrderDetailService _recoveryOrderDetailService, IRecoveryAccessoryDetailService _recoveryAccessoryDetailService, IWarehouseItemService _warehouseItemService, IStockMutationService _stockMutationService, IItemTypeService _itemTypeService) { Item UsedCore = _itemService.GetObjectById(coreBuilder.UsedCoreItemId); Item NewCore = _itemService.GetObjectById(coreBuilder.NewCoreItemId); if (_itemService.GetValidator().ValidDeleteLegacyObject(UsedCore, _stockMutationService, _itemTypeService, _warehouseItemService) && _itemService.GetValidator().ValidDeleteLegacyObject(UsedCore, _stockMutationService, _itemTypeService, _warehouseItemService)) { if (_validator.ValidDeleteObject(coreBuilder, _coreIdentificationDetailService, _rollerBuilderService)) { _itemService.GetRepository().SoftDeleteObject(UsedCore); _itemService.GetRepository().SoftDeleteObject(NewCore); _repository.SoftDeleteObject(coreBuilder); } } else { if (UsedCore.Errors.Count() > 0) { coreBuilder.Errors.Add(UsedCore.Errors.First().Key, UsedCore.Errors.First().Value); } else if (NewCore.Errors.Count() > 0) { coreBuilder.Errors.Add(NewCore.Errors.First().Key, NewCore.Errors.First().Value); } else { coreBuilder.Errors.Add("Generic", "Item tidak dapat di hapus"); } } return(coreBuilder); }
/// <summary> /// Default constructor /// </summary> public UserDepartmentController() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.IUserDepartmentMgr = coreBuilder.GetManager <IUserDepartmentMgr>(CoreBuilder.IUSERDEPARTMENTMGR); this.UserDepartmentWrapper = UserDepartmentWrapper.GetInstance(); }
/// <summary> /// Default Constructor /// </summary> public AddressController() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.IAddressMgr = coreBuilder.GetManager <IAddressMgr>(CoreBuilder.IADDRESSMGR); SystemLogWrapper = SystemLogWrapper.GetInstance(); }
public void SourceBuildsToCorrectResults() { var damageTypes = Mock.Of <IDamageTypeBuilder>(b => b.BuildDamageTypes() == new[] { DamageType.Fire, DamageType.Cold }); var sut = new AilmentBuilder(new StatFactory(), CoreBuilder.Create(Ailment.Bleed)); var statBuilder = sut.Source(damageTypes); var results = statBuilder.Build(default).ToList();
public IStatBuilder DamageHasKeyword(DamageSource damageSource, IKeywordBuilder keyword) { var coreBuilder = new CoreStatBuilderFromCoreBuilder <Keyword>( CoreBuilder.Proxy(keyword, (ps, b) => b.Build(ps)), (e, k) => StatFactory.MainSkillPartDamageHasKeyword(e, k, damageSource)); return(new StatBuilder(StatFactory, coreBuilder)); }
public IStatBuilder AdditionalLevels(ISkillBuilder skill) { var coreBuilder = new CoreStatBuilderFromCoreBuilder <string>( CoreBuilder.Proxy(skill, (ps, b) => b.Build(ps).Id), (e, t) => StatFactory.FromIdentity($"Gem.AdditionalLevels.{t}", e, typeof(int))); return(new StatBuilder(StatFactory, coreBuilder)); }
/// <summary> /// Default Constructor /// </summary> public EventGroupController() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.IEventGroupMgr = coreBuilder.GetManager <IEventGroupMgr>(CoreBuilder.IEVENTGROUPMGR); SystemLogWrapper = SystemLogWrapper.GetInstance(); }
public CoreBuilder VNameNotEmpty(CoreBuilder coreBuilder) { if (String.IsNullOrEmpty(coreBuilder.Name) || coreBuilder.Name.Trim() == "") { coreBuilder.Errors.Add("Name", "Tidak boleh kosong"); } return(coreBuilder); }
private IStatBuilder AdditionalLevels(string identityInfix, IGemTagBuilder gemTag, Func <BuildParameters, string, string> buildIdentitySuffix) { var coreBuilder = new CoreStatBuilderFromCoreBuilder <string>( CoreBuilder.Proxy(gemTag, (ps, b) => buildIdentitySuffix(ps, b.Build(ps))), (e, t) => StatFactory.FromIdentity($"Gem.AdditionalLevels{identityInfix}.{t}", e, typeof(int))); return(new StatBuilder(StatFactory, coreBuilder)); }
/// <summary> /// Default constructor /// </summary> private CarWrapper() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.ICarMgr = coreBuilder.GetManager <ICarMgr>(CoreBuilder.ICARMGR); this.ITransportMgr = coreBuilder.GetManager <ITransportMgr>(CoreBuilder.ITRANSPORTMGR); this.IEventMgr = coreBuilder.GetManager <IEventMgr>(CoreBuilder.IEVENTMGR); }
/// <summary> /// Default constructor /// </summary> private AssistantWrapper() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.IAssistantMgr = coreBuilder.GetManager <IAssistantMgr>(CoreBuilder.IASSISTANTMGR); this.IEventMgr = coreBuilder.GetManager <IEventMgr>(CoreBuilder.IEVENTMGR); this.EmailWrapper = EmailWrapper.GetInstance(); }
public void OnInvoke() { var coreBuilder = new CoreBuilder(); coreBuilder.OnStarting(builder => { builder.RegisterModule <GrpcModule>(); }); coreBuilder.Build(); }
public ChargeTypeBuilders(IStatFactory statFactory) { Endurance = new ChargeTypeBuilder(statFactory, CoreBuilder.Create(ChargeType.Endurance)); Frenzy = new ChargeTypeBuilder(statFactory, CoreBuilder.Create(ChargeType.Frenzy)); Power = new ChargeTypeBuilder(statFactory, CoreBuilder.Create(ChargeType.Power)); ChanceToSteal = StatBuilderUtils.DamageRelatedFromIdentity(statFactory, "ChanceToStealACharge", typeof(int)).WithHits; Rage = new ChargeTypeBuilder(statFactory, CoreBuilder.Create(ChargeType.Rage)); RageEffect = StatBuilderUtils.FromIdentity(statFactory, "RageEffect", typeof(double)); }
/// <summary> /// Default constructor /// </summary> private InvitationWrapper() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.IInvitationMgr = coreBuilder.GetManager <IInvitationMgr>(CoreBuilder.IINVITATIONMGR); this.IAssistantMgr = coreBuilder.GetManager <IAssistantMgr>(CoreBuilder.IASSISTANTMGR); this.IEventMgr = coreBuilder.GetManager <IEventMgr>(CoreBuilder.IEVENTMGR); this.EmailWrapper = EmailWrapper.GetInstance(); }
public RollerBuilder VHasCoreBuilder(RollerBuilder rollerBuilder, ICoreBuilderService _coreBuilderService) { CoreBuilder coreBuilder = _coreBuilderService.GetObjectById(rollerBuilder.CoreBuilderId); if (coreBuilder == null) { rollerBuilder.Errors.Add("CoreBuilderId", "Tidak terasosiasi dengan coreBuilder"); } return(rollerBuilder); }
/// <summary> /// Default Constructor /// </summary> public InvitationController() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.IInvitationMgr = coreBuilder.GetManager <IInvitationMgr>(CoreBuilder.IINVITATIONMGR); this.InvitationWrapper = InvitationWrapper.GetInstance(); SystemLogWrapper = SystemLogWrapper.GetInstance(); }
public CoreBuilder VIsInCoreIdentificationDetail(CoreBuilder coreBuilder, ICoreIdentificationDetailService _coreIdentificationDetailService) { IList <CoreIdentificationDetail> details = _coreIdentificationDetailService.GetObjectsByCoreBuilderId(coreBuilder.Id); if (details.Any()) { coreBuilder.Errors.Add("Generic", "Tidak boleh terasosiasi dengan Core Identification Detail"); } return(coreBuilder); }
public CoreBuilder VHasUoM(CoreBuilder coreBuilder, IUoMService _uomService) { UoM uom = _uomService.GetObjectById(coreBuilder.UoMId); if (uom == null) { coreBuilder.Errors.Add("UoMId", "Tidak terasosiasi dengan unit of measurement"); } return(coreBuilder); }
/// <summary> /// Default Constructor /// </summary> public PassengerController() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.IPassengerMgr = coreBuilder.GetManager <IPassengerMgr>(CoreBuilder.IPASSENGERMGR); this.PassengerWrapper = PassengerWrapper.GetInstance(); SystemLogWrapper = SystemLogWrapper.GetInstance(); }
public CoreBuilder VDeleteObject(CoreBuilder coreBuilder, ICoreIdentificationDetailService _coreIdentificationDetailService, IRollerBuilderService _rollerBuilderService) { VIsInCoreIdentificationDetail(coreBuilder, _coreIdentificationDetailService); if (!isValid(coreBuilder)) { return(coreBuilder); } VIsInRollerBuilder(coreBuilder, _rollerBuilderService); return(coreBuilder); }
/// <summary> /// Default constructor /// </summary> public TransportController() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.ITransportMgr = coreBuilder.GetManager <ITransportMgr>(CoreBuilder.ITRANSPORTMGR); this.TransportWrapper = TransportWrapper.GetInstance(); this.SystemLogWrapper = SystemLogWrapper.GetInstance(); }
/// <summary> /// Default constructor /// </summary> public CarController() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.ICarMgr = coreBuilder.GetManager <ICarMgr>(CoreBuilder.ICARMGR); this.CarWrapper = CarWrapper.GetInstance(); this.SystemLogWrapper = SystemLogWrapper.GetInstance(); }
public CoreBuilder VIsInRollerBuilder(CoreBuilder coreBuilder, IRollerBuilderService _rollerBuilderService) { IList <RollerBuilder> rollerBuilders = _rollerBuilderService.GetObjectsByCoreBuilderId(coreBuilder.Id); if (rollerBuilders.Any()) { coreBuilder.Errors.Add("Generic", "Tidak boleh terasosiasi dengan Roller Builder"); } return(coreBuilder); }
/// <summary> /// Default Constructor /// </summary> public EventController() { CoreBuilder coreBuilder = CoreBuilder.GetInstance(); this.IEventMgr = coreBuilder.GetManager <IEventMgr>(CoreBuilder.IEVENTMGR); this.EventWrapper = EventWrapper.GetInstance(); SystemLogWrapper = SystemLogWrapper.GetInstance(); }
public CoreBuilder VHasNewCoreItem(CoreBuilder coreBuilder, IItemService _itemService) { Item NewCoreItem = _itemService.GetObjectById(coreBuilder.NewCoreItemId); if (NewCoreItem == null) { coreBuilder.Errors.Add("NewCoreItemId", "Tidak terasosiasi dengan Item"); } return(coreBuilder); }
public CoreIdentificationDetail VHasCoreBuilder(CoreIdentificationDetail coreIdentificationDetail, ICoreBuilderService _coreBuilderService) { CoreBuilder coreBuilder = _coreBuilderService.GetObjectById(coreIdentificationDetail.CoreBuilderId); if (coreBuilder == null) { coreIdentificationDetail.Errors.Add("CoreBuilderId", "Tidak terasosiasi dengan coreBuilder"); } return(coreIdentificationDetail); }