public void SaveToJsonSaveFile(string format)
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + string.Format("/{0}." + format, SAVE_FILE));

        ItemServices[] JsonArray = new ItemServices[itemServicesList.Count];
        if (format == "psv")
        {
            for (int i = 0; i < itemServicesList.Count; i++)
            {
                JsonArray[i] = itemServicesList[i];
            }
        }
        else
        {
            for (int i = 0; i < InAppPurchaseList.Count; i++)
            {
                JsonArray[i] = InAppPurchaseList[i];
            }
        }

        string playerToJson = JsonHelper.ToJson(JsonArray, true);

        Debug.Log(playerToJson);
        bf.Serialize(file, EncryptJson(playerToJson));
        file.Close();
        //loadItemShop();
    }
Beispiel #2
0
 public RawMaterialsController()
 {
     unitOfWork          = new UnitOfWork();
     RawMaterialServices = new RawMaterialServices(unitOfWork);
     ItemServices        = new ItemServices(unitOfWork);
     ItemElementServices = new ItemElementServices(unitOfWork);
 }
        private ItemServices ItemServices()
        {
            var userID  = Guid.Parse(User.Identity.GetUserId());
            var service = new ItemServices(userID);

            return(service);
        }
 public ProductDetailsController()
 {
     unitOfWork            = new UnitOfWork();
     productDetailsService = new ProductDetailsServices(unitOfWork);
     itemServices          = new ItemServices(unitOfWork);
     productServices       = new ProductServices(unitOfWork);
 }
Beispiel #5
0
        public async Task <JsonResult> AddItem(ItemModel item)
        {
            IItemServices itemServices = new ItemServices();

            item.ItemName = Regex.Replace(item.ItemName, "[^a-zA-Z0-9]", "", RegexOptions.Compiled);

            try
            {
                if (itemServices.DoesTableExists(item.ItemName))
                {
                    await itemServices.DropExistingTable(item.ItemName);
                }
                var tableName = await itemServices.CreateItemTable(item);

                IExcelServices excelServices = new ExcelServices(new MemoryStream(item.ItemContent));

                var list = await excelServices.ParseExcelFile();

                var ret = await itemServices.WriteLine(list, item.ItemName);

                return(new JsonResult {
                    Data = ret, JsonRequestBehavior = JsonRequestBehavior.AllowGet
                });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public DamagedItemController()
 {
     unitOfWork          = new UnitOfWork();
     damagedItemServices = new DamagedItemServices(unitOfWork);
     ItemServices        = new ItemServices(unitOfWork);
     storeServices       = new StoreServices(unitOfWork);
 }
        public ActionResult Index()
        {
            var userID  = Guid.Parse(User.Identity.GetUserId());
            var service = new ItemServices(userID);
            var model   = service.GetItems();

            return(View(model));
        }
        public void Setup()
        {
            _mapper        = new Mock <IMapper>();
            _unitOfWork    = new Mock <IUnitOfWork>();
            _configuration = new Mock <IConfiguration>();
            _orderService  = new Mock <IOrderServices>();

            itemServices = new ItemServices(_unitOfWork.Object, _mapper.Object, _configuration.Object, _orderService.Object);
        }
Beispiel #9
0
        private CharacterSheetServices CharacterSheetServices()
        {
            var userID                = Guid.Parse(User.Identity.GetUserId());
            var characterService      = new CharacterServices(userID);
            var itemService           = new ItemServices(userID);
            var characterSheetService = new CharacterSheetServices(userID);

            return(characterSheetService);
        }
Beispiel #10
0
        public ActionResult Index()
        {
            var userID                = Guid.Parse(User.Identity.GetUserId());
            var characterService      = new CharacterServices(userID);
            var itemService           = new ItemServices(userID);
            var characterSheetService = new CharacterSheetServices(userID);
            var model = characterService.GetCharacters();

            return(View(model));
        }
 public EmailController()
 {
     UnitOfWork                = new UnitOfWork();
     EmailServices             = new EmailServices(UnitOfWork);
     ItemServices              = new ItemServices(UnitOfWork);
     StoreServices             = new StoreServices(UnitOfWork);
     SubStoreServices          = new SubStoreServices(UnitOfWork);
     SubSubStoreServices       = new SubSubStoreServices(UnitOfWork);
     SubSubSubStoreServices    = new SubSubSubStoreServices(UnitOfWork);
     SubSubSubSubStoreServices = new SubSubSubSubStoreServices(UnitOfWork);
     TransferService           = new TransferService(UnitOfWork);
     UnitServices              = new UnitServices(UnitOfWork);
 }
 public TransferController()
 {
     UnitOfWork                = new UnitOfWork();
     TransferService           = new TransferService(UnitOfWork);
     ItemServices              = new ItemServices(UnitOfWork);
     ProcurementServices       = new ProcurementServices(UnitOfWork);
     StoreServices             = new StoreServices(UnitOfWork);
     SubStoreServices          = new SubStoreServices(UnitOfWork);
     SubSubStoreServices       = new SubSubStoreServices(UnitOfWork);
     SubSubSubStoreServices    = new SubSubSubStoreServices(UnitOfWork);
     SubSubSubSubStoreServices = new SubSubSubSubStoreServices(UnitOfWork);
     TransferTypeServices      = new TransferTypeServices(UnitOfWork);
     UnitServices              = new UnitServices(UnitOfWork);
     ConditionOfItemServices   = new ConditionOfItemServices(UnitOfWork);
 }
Beispiel #13
0
    void Start()
    {
        // services created at runtime as managers are also only available at runtime
        gridServices        = new GridServices();
        itemServices        = new ItemServices();
        carrierServices     = new CarrierServices();
        buildingServices    = new BuildingServices();
        assignmentServices  = new AssignmentServices();
        persistenceServices = new PersistenceServices();
        oscsr         = GameObject.FindWithTag("OSC").GetComponent <OSCSendReceive>();
        soundServices = new SoundServices(oscsr);
        EventServices.Instance.SetSoundServices(soundServices);

        persistenceServices.InitScene();
    }
 public ProcurementController()
 {
     UnitOfWork                   = new UnitOfWork();
     ProcurementServices          = new ProcurementServices(UnitOfWork);
     ProcrurementTypeServices     = new ProcrurementTypeServices(UnitOfWork);
     SupplierCompanyServices      = new SupplierCompanyServices(UnitOfWork);
     SubSubSubSubCategoryServices = new SubSubSubSubCategoryServices(UnitOfWork);
     SubSubSubCategoryServices    = new SubSubSubCategoryServices(UnitOfWork);
     SubSubCategoryServices       = new SubSubCategoryServices(UnitOfWork);
     SubCategoryServices          = new SubCategoryServices(UnitOfWork);
     CategoryServices             = new CategoryServices(UnitOfWork);
     ItemServices                 = new ItemServices(UnitOfWork);
     ModelServices                = new ModelServices(UnitOfWork);
     BrandServices                = new BrandServices(UnitOfWork);
     UnitServices                 = new UnitServices(UnitOfWork);
 }
Beispiel #15
0
        /// <summary>
        /// Gets a random item build with five unique items and upgraded boots.
        /// </summary>
        /// <returns>List of items</returns>
        public IEnumerable <Item> GetItemBuild(string projectRoot)
        {
            _itemServiceHandler = new ItemServices();
            JArray itemsArray = base.GetArrayFromJsonFile(projectRoot, "items.json");
            JArray bootsArray = base.GetArrayFromJsonFile(projectRoot, "boots.json");

            List <Item> allItems  = _itemServiceHandler.ItemListFromJArray(itemsArray);
            List <Item> bootsList = _itemServiceHandler.ItemListFromJArray(bootsArray);

            var boots     = _itemServiceHandler.GetRandomItemFromList(bootsList);
            var itemBuild = new List <Item>();

            itemBuild.Add(boots);
            itemBuild.AddRange(RandomItemBuildFromList(allItems));

            return(itemBuild);
        }
Beispiel #16
0
 public ProcurementController()
 {
     UnitOfWork                 = new UnitOfWork();
     ProcurementServices        = new ProcurementServices(UnitOfWork);
     ProcrurementTypeServices   = new ProcrurementTypeServices(UnitOfWork);
     SupplierCompanyServices    = new SupplierCompanyServices(UnitOfWork);
     StoreService               = new StoreServices(UnitOfWork);
     ItemServices               = new ItemServices(UnitOfWork);
     SubContractCompanyServices = new SubContractCompanyServices(UnitOfWork);
     SubStoreServices           = new SubStoreServices(UnitOfWork);
     SubSubStoreServices        = new SubSubStoreServices(UnitOfWork);
     SubSubSubStoreServices     = new SubSubSubStoreServices(UnitOfWork);
     SubSubSubSubStoreServices  = new SubSubSubSubStoreServices(UnitOfWork);
     conditionOfItemServices    = new ConditionOfItemServices(UnitOfWork);
     warrantyServices           = new WarrantyServices(UnitOfWork);
     countryServices            = new CountryServices(UnitOfWork);
     principleServices          = new PrincipleServices(UnitOfWork);
 }
 public ItemController()
 {
     unitOfWork                   = new UnitOfWork();
     itemServices                 = new ItemServices(unitOfWork);
     categoryServices             = new CategoryServices(unitOfWork);
     subCategoryServices          = new SubCategoryServices(unitOfWork);
     subSubCategoryServices       = new SubSubCategoryServices(unitOfWork);
     subSubSubCategoryServices    = new SubSubSubCategoryServices(unitOfWork);
     subSubSubSubCategoryServices = new SubSubSubSubCategoryServices(unitOfWork);
     companyServices              = new CompanyServices(unitOfWork);
     unitServices                 = new UnitServices(unitOfWork);
     storeServices                = new StoreServices(unitOfWork);
     subStoreServices             = new SubStoreServices(unitOfWork);
     subSubStoreServices          = new SubSubStoreServices(unitOfWork);
     subSubSubStoreServices       = new SubSubSubStoreServices(unitOfWork);
     subSubSubSubStoreServices    = new SubSubSubSubStoreServices(unitOfWork);
     BrandServices                = new BrandServices(unitOfWork);
     ModelServices                = new ModelServices(unitOfWork);
 }
Beispiel #18
0
        static void Main(string[] args)
        {
            IPromotionRuleServices PromotionRules = new PromotionRuleServices();
            IItemServices          itemServices   = new ItemServices();
            IOrderServices         orderServices  = new OrderServices(PromotionRules, itemServices);


            #region 3_A_FOR_130
            List <Cart> ListOfCartItemDetails1 = new List <Cart>()
            {
                new Cart(Constants.A, 3)
            };

            var total = orderServices.ProcessBill(ListOfCartItemDetails1);
            Console.WriteLine(total);
            #endregion

            #region 2_B_For_45
            List <Cart> ListOfCartItemDetails2 = new List <Cart>()
            {
                new Cart(Constants.B, 2)
            };

            total = orderServices.ProcessBill(ListOfCartItemDetails2);
            Console.WriteLine(total);
            #endregion

            #region C_AND_D_FOR_30
            List <Cart> ListOfCartItemDetails3 = new List <Cart>()
            {
                new Cart(Constants.C, 1),
                new Cart(Constants.D, 1)
            };

            total = orderServices.ProcessBill(ListOfCartItemDetails3);
            Console.WriteLine(total);
            #endregion
        }
        public SportDataLOLClient(string primarySubscriptionKey, string ProjectionPrimarySubscriptionKey)
        {
            Uri scoreApiBaseUrl      = LOLConfig.ScoreApiBaseUrl;
            Uri statApiBaseUrl       = LOLConfig.StateApiBaseUrl;
            Uri ProjectionApiBaseUrl = LOLConfig.ProjectionApiBaseUrl;

            AreasServices       = new AreaServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            CompetitionServices = new CompetitionServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            GameServices        = new GameServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            MembershipServices  = new MembershipServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            PlayerServices      = new PlayerServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            SeasonServices      = new SeasonServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            TeamServices        = new TeamServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            VenueServices       = new VenueServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            StandingsServices   = new StandingsServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            ScheduleServices    = new ScheduleServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);

            ItemServices     = new ItemServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            SpellServices    = new SpellServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            ChampionServices = new ChampionServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            BoxScoreServices = new BoxScoreServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey);

            ProjectionServices = new ProjectionServices(ProjectionApiBaseUrl.AbsoluteUri, ProjectionPrimarySubscriptionKey);
        }
        public SobekCM_Item Get_Sobek_Item(string BibID, string VID, int UserID, Custom_Tracer Tracer)
        {
            ItemServices srvcs = new ItemServices();

            return(srvcs.getSobekItem(BibID, VID, UserID, Tracer).Item1);
        }
 public RemoverItem(ItemServices itemServices)
 {
     InitializeComponent();
     _itemServices = itemServices;
 }
 public CadastrarItem(ItemServices itemServices)
 {
     InitializeComponent();
     _itemServices = itemServices;
 }
Beispiel #23
0
        public HttpResponseMessage Get()
        {
            var itens = ItemServices.RecuperaItens();

            return(Request.CreateResponse(HttpStatusCode.OK, itens));
        }
Beispiel #24
0
        public HttpResponseMessage Get(int id)
        {
            var itemViewModel = ItemServices.Recupera(id);

            return(Request.CreateResponse(HttpStatusCode.OK, itemViewModel));
        }
Beispiel #25
0
        public HttpResponseMessage Post(AddItemViewModel item)
        {
            ItemServices.CriaItem(item);

            return(Request.CreateResponse(HttpStatusCode.OK, new DescriptionMessage(HttpStatusCode.OK, "Item Added", "Item Added")));
        }
 public AlterarDesconto(ItemServices servives)
 {
     InitializeComponent();
     _itemServices = servives;
 }
Beispiel #27
0
        public HttpResponseMessage Put(int id, UpdateItemViewModel item)
        {
            ItemServices.AtualizaItem(id, item);

            return(Request.CreateResponse(HttpStatusCode.OK, new DescriptionMessage(HttpStatusCode.OK, "Item Updated", $"Item #{id} Updated")));
        }
Beispiel #28
0
 public HttpResponseMessage Delete(int id)
 {
     ItemServices.DeleteItem(id);
     return(Request.CreateResponse(HttpStatusCode.OK, new DescriptionMessage(HttpStatusCode.OK, "Item Deleted", $"Item #{id} Deleted")));
 }
        public SobekCM_Item Get_Sobek_Item_Group(string BibID, Custom_Tracer Tracer)
        {
            ItemServices srvcs = new ItemServices();

            return(srvcs.getSobekItemGroup(BibID, Tracer));
        }