public ReceiptService() { _imageFormating = new ImageFormating(); _ocr = new EmguOcr(); _dataConverter = new DataConverter(); _dataManager = new ItemManager(); }
public CheckoutController(IItemManager item, IItemHandler <ItemModel> itemHandler, IPurchaseHandler purchaseHandler, IUserHandler userHandler) { _itemManager = item ?? throw new ArgumentNullException(nameof(_itemManager)); _itemHandler = itemHandler ?? throw new ArgumentNullException(nameof(_itemHandler)); _purchaseHandler = purchaseHandler ?? throw new ArgumentNullException(nameof(_purchaseHandler)); _userHandler = userHandler ?? throw new ArgumentNullException(nameof(_userHandler)); }
private void Awake() { DIContainer.SetModule <IResourceManager, ResourceManager>(); DIContainer.SetModule <IItemManager, ItemManager>(); DIContainer.SetModule <ITalentManager, TalentManager>(); DIContainer.SetModule <ICharacterManager, CharacterManager>(); IItemManager itemManager = DIContainer.GetModule <IItemManager>(); if (PlayerPrefs.GetInt("1", 0) == 0) { PlayerPrefs.SetInt("1", 1); for (int i = 0; i < 15; i++) { int levelUpgrade = Random.Range(0, 2); int type = 0; int id = Random.Range((int)WeaponType.Type.knife, (int)WeaponType.Type.doublePisol + 1); Item item = new Item(0, id, type, 1, 0, levelUpgrade, false); itemManager.AddItem(item); } //for (int i = 0; i < 5; i++) //{ // int type = (int)TypeOfItem.Type.Other; // int id = i; // Item item = new Item(0, id, type, 100, 0, 0, false); // itemManager.AddItem(item); //} itemManager.SaveItemIntoPlayerPrefX(); } }
public ActionResult Details(int id) { itemManager = new ItemManager(); userManager = new UserManager(); subManager = new SubscriptionManager(); Item requestedItem = itemManager.GetThemeWithDetails(id); Theme theme = itemManager.GetThemeWithDetails(id); if (requestedItem == null) { return(HttpNotFound()); } Item subbedItem = subManager.GetSubscribedItemsForUser(User.Identity.GetUserId()) .FirstOrDefault(item => item.ItemId == id); ThemeViewModel themeViewModel = Mapper.Map(theme, new ThemeViewModel()); themeViewModel.PageTitle = theme.Name; themeViewModel.User = User.Identity.IsAuthenticated ? userManager.GetUser(User.Identity.GetUserId()) : null; themeViewModel.Theme = Mapper.Map(theme, new ItemDTO()); themeViewModel.Subscribed = subbedItem != null; themeViewModel.Keywords = theme.Keywords.ToList(); //Log visit activity new SubplatformManager().LogActivity(ActivityType.VisitActitiy); //Assembling the view return(View(themeViewModel)); }
public void SetUp() { _itemDao = Substitute.For <IItemDao>(); _betDao = Substitute.For <IBetDao>(); _userDao = Substitute.For <IUserDao>(); _itemManager = SingletonManager.Instance.SetItemManager(new ItemManager(_itemDao, _userDao, _betDao)); }
public ActionResult Index() { //Get hold of subplatformID we received int subPlatformID = (int)RouteData.Values["SubPlatformID"]; itemManager = new ItemManager(); userManager = new UserManager(); subManager = new SubscriptionManager(); subplatformManager = new SubplatformManager(); //Return platformspecific data IList <ItemDTO> themes = null; themes = Mapper.Map(itemManager.GetAllThemes().Where(theme => theme.SubPlatform.SubPlatformId == subPlatformID), new List <ItemDTO>()); IEnumerable <Subscription> subs = subManager.GetSubscriptionsWithItemsForUser(User.Identity.GetUserId()); themes.Where(theme => subs.Any(sub => sub.SubscribedItem.ItemId == theme.ItemId)).ForEach(dto => dto.Subscribed = true); //Assembling the view return(View("Index", new ItemViewModel() { PageTitle = subplatformManager.GetCustomization(subPlatformID).ThemesAlias, User = User.Identity.IsAuthenticated ? userManager.GetUser(User.Identity.GetUserId()) : null, Items = themes })); }
public ViewItemDetail(Item item) { InitializeComponent(); _itemManager = new ItemManager(); _manageBackstockRecord = new ManageBackstockRecords(); _item = item; }
public AddItemReport(Item item) { InitializeComponent(); _item = item; _itemReportManager = new ItemReportManager(); _itemManager = new ItemManager(); }
public ReceiptService(IImageFormating imageFormating, IOcr ocr, IDataConverter dataConverter, IItemManager dataManager) { _imageFormating = imageFormating; _ocr = ocr; _dataConverter = dataConverter; _dataManager = dataManager; }
public void TestSetup() { _mock = new ItemAccessorMock(); _itemManager = new ItemManager(_mock); _items = new List <Item>(); _items = _itemManager.RetrieveAllItems(); }
public ImageUploadController(IItemManager itemManager, IReceiptService receiptService, IAuthenticationService authenticationService) { _itemManager = itemManager; _receiptService = receiptService; _authenticationService = authenticationService; }
public void SetupCurrentCharacter() { Dame.RemoveAllModifiers(); Power.RemoveAllModifiers(); HP.RemoveAllModifiers(); ICharacterManager characterManager = DIContainer.GetModule <ICharacterManager>(); curCharacter = characterManager.GetCurrentCharacter(); ITalentManager talent = DIContainer.GetModule <ITalentManager>(); List <Talent> talentList = talent.GetAllTalent(); foreach (Talent _talent in talentList) { _talent.AddTalent(this); } IItemManager itemEquips = DIContainer.GetModule <IItemManager>(); List <Item> items = itemEquips.EquipmentItemList(); foreach (Item item in items) { item.Equip(this); } // Thay doi lai base value cua hero Dame.BaseValue = 10 + (float)0.2 * (curCharacter.level + 1); Power.BaseValue = 10 + (float)0.2 * (curCharacter.level + 1); HP.BaseValue = 10 + (float)0.2 * (curCharacter.level + 1); }
public ScannedPageController(IScannedPageManager scannedPageManager, IBookManager bookManager, IReaderManager readerManager, IItemManager itemManager) { this.scannedPageManager = scannedPageManager; this.bookManager = bookManager; this.readerManager = readerManager; this.itemManager = itemManager; }
public IHttpActionResult GetTopTrendingItems(int itemType) { //Get the subplatformID from the SubPlatformCheckAPI attribute int suplatformID = -1; if (Request.Properties.TryGetValue("SubPlatformID", out object _customObject)) { suplatformID = (int)_customObject; } ItemType type = (ItemType)itemType; itemManager = new ItemManager(); List <Item> lijst = new List <Item>(); if (type == ItemType.Person) { itemManager.GetMostTrendingItemsForType(suplatformID, ItemType.Person, 3) .ForEach(item => lijst.Add(itemManager.GetPersonWithDetails(item.ItemId))); } else if (type == ItemType.Organisation) { itemManager.GetMostTrendingItemsForType(suplatformID, ItemType.Organisation, 3) .ForEach(item => lijst.Add(itemManager.GetOrganisationWithDetails(item.ItemId))); } else { itemManager.GetMostTrendingItemsForType(suplatformID, ItemType.Theme, 3) .ForEach(item => lijst.Add(itemManager.GetThemeWithDetails(item.ItemId))); } return(Ok(Mapper.Map(lijst, new List <Item>()))); }
public ActionResult Details(int id) { itemManager = new ItemManager(); userManager = new UserManager(); subManager = new SubscriptionManager(); Item item = itemManager.GetPersonWithDetails(id); if (item == null) { return(HttpNotFound()); } Item subbedItem = subManager.GetSubscribedItemsForUser(User.Identity.GetUserId()) .FirstOrDefault(i => i.ItemId == item.ItemId); PersonViewModel personViewModel = Mapper.Map(item, new PersonViewModel()); personViewModel.PageTitle = item.Name; personViewModel.User = User.Identity.IsAuthenticated ? userManager.GetUser(User.Identity.GetUserId()) : null; personViewModel.Item = Mapper.Map(item, new ItemDTO()); personViewModel.Subscribed = subbedItem != null; personViewModel.RankNumberOfMentions = CalculateRankNumberOfMentions(personViewModel.Item.NumberOfMentions); personViewModel.RankTrendingPercentage = CalculateRankTrendingPercentage(personViewModel.Item.ItemId); personViewModel.PeopleFromSameOrg = GetPeopleFromSameOrg(personViewModel.Item.ItemId); //Log visit activity new SubplatformManager().LogActivity(ActivityType.VisitActitiy); //Assembling the view return(View(personViewModel)); }
public UpdateShelterItem(Item shelterItem, IItemManager itemManager) { InitializeComponent(); _shelterItem = shelterItem; _itemManager = itemManager; _itemCategoryManager = new ItemCategoryManager(); }
/// <summary> /// Creator: Tener Karar /// Created: 2020/02/7 /// Approver: Steven Cardona /// /// this constrctor method mainwindow class /// </summary> /// /// <remarks> /// Updater Name /// Updated: yyyy/mm/dd /// Update: /// </remarks> public ViewInventory() { InitializeComponent(); StockManger = new ManageBackstockRecords(); _itemManager = new ItemManager(); item = new Item(); }
public ActionResult Index() { //Get hold of subplatformID we received int subPlatformID = (int)RouteData.Values["SubPlatformID"]; subManager = new SubscriptionManager(); itemManager = new ItemManager(); userManager = new UserManager(); subplatformManager = new SubplatformManager(); IList <ItemDTO> people = Mapper.Map <IList <Item>, IList <ItemDTO> >(itemManager.GetAllOrganisationsForSubplatform(subPlatformID).ToList()); IEnumerable <Subscription> subs = subManager.GetSubscriptionsWithItemsForUser(User.Identity.GetUserId()); foreach (ItemDTO item in people) { foreach (var sub in subs) { if (sub.SubscribedItem.ItemId == item.ItemId) { item.Subscribed = true; } } } //Assembling the view return(View("Index", new ItemViewModel() { PageTitle = subplatformManager.GetCustomization(subPlatformID).OrganisationsAlias, User = User.Identity.IsAuthenticated ? userManager.GetUser(User.Identity.GetUserId()) : null, Items = people })); }
/// <summary> /// Item management page for admin. /// </summary> public ActionResult ItemManagement() { //Get hold of subplatformID we received int subPlatformID = (int)RouteData.Values["SubPlatformID"]; itemManager = new ItemManager(); userManager = new UserManager(); //Assembling the view ItemCreateViewModel vm = new ItemCreateViewModel() { User = userManager.GetUser(User.Identity.GetUserId()), PageTitle = Resources.ItemManagement, Items = Mapper.Map(itemManager.GetAllItems().Where(item => item.SubPlatform.SubPlatformId == subPlatformID), new List <ItemDTO>()) }; int count = itemManager.GetAllOrganisationsForSubplatform(subPlatformID).Count(); vm.Organisations = itemManager.GetAllOrganisationsForSubplatform(subPlatformID).Select(org => new SelectListItem { Value = System.Convert.ToString(org.ItemId), Text = org.Name, }).OrderBy(org => org.Text); return(View(vm)); }
public ItemService( IDataConverter dataConverter, IItemManager dataManager, IItemCategorization itemCategorization) { _dataConverter = dataConverter; _dataManager = dataManager; _itemCategorization = itemCategorization; }
public IHttpActionResult AddNewWidgetToDashboard([FromBody] AddWidgetDTO model) { UnitOfWorkManager uowManager = new UnitOfWorkManager(); widgetManager = new WidgetManager(uowManager); itemManager = new ItemManager(uowManager); Dashboard dash = widgetManager.GetDashboard(User.Identity.GetUserId()); List <PropertyTag> propertyTags = new List <PropertyTag> { new PropertyTag() { Name = model.PropertyTag } }; List <Item> items = itemManager.GetAllItems().Where(i => model.ItemIds.Contains(i.ItemId)).ToList(); if (string.IsNullOrEmpty(model.Title)) { model.Title = Resources.Title; } widgetManager.AddWidget(WidgetType.GraphType, model.Title, 0, 0, propertyTags, graphType: model.GraphType, dashboardId: dash.DashboardId, items: items); uowManager.Save(); return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult CreateOrganisation(CreateItemModels.CreateOrganisationModel model) { int subPlatformID = (int)RouteData.Values["SubPlatformID"]; if (model.Name == null || model.Website == null) { return(RedirectToAction("ItemManagement", "Admin")); } else { string themeName = Regex.Replace(model.Name, @"\s+", ""); string themeWordlist = Regex.Replace(model.Website, @"\s+", ""); if (themeName.Count() == 0 || themeWordlist.Count() == 0) { return(RedirectToAction("ItemManagement", "Admin")); } } itemManager = new ItemManager(); platformManager = new SubplatformManager(); SubPlatform subplatform = platformManager.GetSubPlatform(subPlatformID); Organisation org = (Organisation)itemManager.AddItem(ItemType.Organisation, model.Name, site: "www.kdg.be"); itemManager.ChangeItemPlatform(org.ItemId, subplatform.SubPlatformId); itemManager.GenerateDefaultItemWidgets(org.Name, org.ItemId); return(RedirectToAction("Details", "Organisation", new { id = org.ItemId })); }
/// <summary> /// 游戏框架组件初始化。 /// </summary> protected override void Awake() { base.Awake(); m_ItemManager = GameFrameworkEntry.GetModule <IItemManager>(); if (m_ItemManager == null) { Log.Fatal("Item manager is invalid."); return; } m_ItemManager.ShowItemSuccess += OnShowItemSuccess; m_ItemManager.ShowItemFailure += OnShowItemFailure; if (m_EnableShowItemUpdateEvent) { m_ItemManager.ShowItemUpdate += OnShowItemUpdate; } if (m_EnableShowItemDependencyAssetEvent) { m_ItemManager.ShowItemDependencyAsset += OnShowItemDependencyAsset; } m_ItemManager.HideItemComplete += OnHideItemComplete; }
public static bool CanStoreItems(this IItemStorage itemStorage, IItemManager itemManager, ItemSlot itemSlot) { var slots = itemStorage.Slots.ToList(); // Test if we have enough inventory slots to store the items. if (!slots.Any(s => s.Empty)) { var item = itemManager.GetItem(itemSlot.ItemIndex); if (!item.Flags.HasFlag(ItemFlags.Stackable)) { return(false); } // If no slot is empty but the item is stackable we check // if there are slots with the same item and look if the // items would fit into these slots. int remainingCount = itemSlot.Amount; foreach (var slot in slots.Where(s => s.ItemIndex == itemSlot.ItemIndex)) { remainingCount -= (99 - slot.Amount); } // TODO: unlimited stack slots (merchants) if (remainingCount > 0) { return(false); } } return(true); }
public string GetItemType(int itemId) { if (itemId < 0) { return(null); } //Get item itemManager = new ItemManager(); Item item = itemManager.GetItem(itemId); //return correct type if (item is Person) { return("Person"); } else if (item is Organisation) { return("Organisation"); } else if (item is Theme) { return("Theme"); } else { return(null); } }
public IHttpActionResult GetItemWithDetails(int itemId) { itemManager = new ItemManager(); Item item = itemManager.GetPersonWithDetails(itemId); return(Ok(item)); }
public GetItemsFromPostedReceiptController(IItemManager itemManager, IAuthenticationService authenticationService, IReceiptManager receiptManager) { _itemManager = itemManager; _authenticationService = authenticationService; _receiptManager = receiptManager; }
public EditShelterItem(Item item) { InitializeComponent(); _itemManager = new ItemManager(); _manageBackstockRecord = new ManageBackstockRecords(); _item = item; }
public ActionResult Details(int id) { itemManager = new ItemManager(); userManager = new UserManager(); subManager = new SubscriptionManager(); Item org = itemManager.GetOrganisationWithDetails(id); if (org == null) { return(HttpNotFound()); } Item subbedItem = subManager.GetSubscribedItemsForUser(User.Identity.GetUserId()) .FirstOrDefault(i => i.ItemId == org.ItemId); OrganisationViewModel organisationViewModel = Mapper.Map(org, new OrganisationViewModel()); organisationViewModel.User = User.Identity.IsAuthenticated ? userManager.GetUser(User.Identity.GetUserId()) : null; organisationViewModel.Organisation = Mapper.Map(org, new ItemDTO()); organisationViewModel.Subscribed = subbedItem != null; organisationViewModel.MemberList = GetOrgMembers(org); //Log visit actitivy new SubplatformManager().LogActivity(ActivityType.VisitActitiy); //Assembling the view return(View(organisationViewModel)); }
public ActionResult CreatePerson(CreateItemModels.CreatePersonModel model) { int subPlatformID = (int)RouteData.Values["SubPlatformID"]; itemManager = new ItemManager(); platformManager = new SubplatformManager(); dataManager = new DataManager(); SubPlatform subplatform = platformManager.GetSubPlatform(subPlatformID); if (model.Name == null || model.Website == null || model.OrganisationId == 0) { return(RedirectToAction("ItemManagement", "Admin")); } else { string themeName = Regex.Replace(model.Name, @"\s+", ""); string themeWordlist = Regex.Replace(model.Website, @"\s+", ""); if (themeName.Count() == 0 || themeWordlist.Count() == 0) { return(RedirectToAction("ItemManagement", "Admin")); } } Person person = (Person)itemManager.AddItem(ItemType.Person, model.Name, site: model.Website, dateOfBirth: new System.DateTime(1900, 1, 1)); itemManager.ChangeItemPlatform(person.ItemId, subplatform.SubPlatformId); itemManager.ChangePersonOrganisation(person.ItemId, model.OrganisationId); itemManager.ChangePersonSocialMedia(person.ItemId, model.Twitter, model.Facebook); itemManager.GenerateDefaultItemWidgets(person.Name, person.ItemId); return(RedirectToAction("Details", "Person", new { id = person.ItemId })); }
public PriceListingFragment(Item item, string kind, string qtyName) { _item = item; _kind = kind; _qtyName = qtyName; _itemManager = TinyIoCContainer.Current.Resolve<IItemManager>(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _itemManager = TinyIoCContainer.Current.Resolve<IItemManager>(); _items = Search(); InitUI(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Settings); var container = TinyIoCContainer.Current; _itemManager = container.Resolve<IItemManager>(); var updateDbButton = FindViewById<Button>(Resource.Id.UpdateDbButton); updateDbButton.Click += OnUpdateDbButtonClick; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _itemManager = TinyIoCContainer.Current.Resolve<IItemManager>(); var itemId = (int) Intent.GetLongExtra("ItemId", 0); _item = _itemManager.GetItem(itemId); CreateTabs(); }
public RecommendationManager(ITagScoresFacade tagScoresFacade, IItemManager itemManager, IReaderManager readerManager, IReservedItemManager reservedItemManager, IReaderHistoryManager readerHistoryManager) { this.tagScoresFacade = tagScoresFacade; this.itemManager = itemManager; this.readerManager = readerManager; this.reservedItemManager = reservedItemManager; this.readerHistoryManager = readerHistoryManager; }
public ItemController(IItemManager itemManager, IBookManager bookInfoManager, IMagazineManager magazineManager, IDiskManager diskManager, IAuthorManager authorManager, IBookAuthorManager bookauthorManager, IRecommendationManager recommendationManager) { this.itemManager = itemManager; this.bookInfoManager = bookInfoManager; this.diskManager = diskManager; this.magazineManager = magazineManager; this.authorManager = authorManager; this.bookauthorManager = bookauthorManager; this.recommendationManager = recommendationManager; }
public override void OnCreate(Bundle savedInstanceState) { _itemManager = TinyIoCContainer.Current.Resolve<IItemManager>(); _iconStore = TinyIoCContainer.Current.Resolve<IIconStore>(); base.OnCreate(savedInstanceState); }
public ConsignmentController(IConsignmentManager consignmentManager, IInventoryManager inventoryManager, IItemManager itemManager) { this.consignmentManager = consignmentManager; this.inventoryManager = inventoryManager; this.itemManager = itemManager; }
public ItemApiController(IItemManager itemManager) { this.itemManager = itemManager; }