示例#1
0
 public ActionResult AddQuantity(ItemAdded itemAdded)
 {
     InventoryClient client = new InventoryClient();
     client.DbAddQuantity(itemAdded.Item.ItemId, itemAdded.QuantityAdded);
     
     return RedirectToAction("Index");
 }
示例#2
0
        public InventoryItemBase Get(InventoryItemBase item, UUID rootFolder, CachedUserInfo userInfo)
        {
            InventoryClient invCli       = null;
            string          inventoryURL = UserInventoryURL(item.Owner);

            if (!m_inventoryServers.TryGetValue(inventoryURL, out invCli))
            {
                m_log.Debug("[HGScene]: Starting new InventorytClient for " + inventoryURL);
                invCli = new InventoryClient(inventoryURL);
                m_inventoryServers.Add(inventoryURL, invCli);
            }

            item = invCli.GetInventoryItem(item);
            if (item != null)
            {
                // Change the folder, stick it in root folder, all items flattened out here in this region cache
                item.Folder = rootFolder;
                //userInfo.AddItem(item); don't use this, it calls back to the inventory server
                lock (userInfo.RootFolder.Items)
                {
                    userInfo.RootFolder.Items[item.ID] = item;
                }
            }
            return(item);
        }
示例#3
0
        //public ActionResult Delete(int id)
        //{
        //    InventoryClient client = new InventoryClient();
        //    client.DbRemoveItem(id);
        //    return null;
        //}

        public ActionResult DeleteItems()
        {
            //return RedirectToAction("Delete");
            InventoryClient db = new InventoryClient();
            db.DbClearItems();
            return RedirectToAction("Index");
        }
示例#4
0
文件: Program.cs 项目: rnmisrahi/JB
        static void Main(string[] args)
        {
            NewClient.InventoryService.InventoryClient service = new InventoryClient();

            Console.WriteLine(service.GetMessage());
            Console.WriteLine("Enter name:");
            var name = Console.ReadLine();
            Item[] items;
            while (name != "quit")
            {
                try
                {
                    string s = service.GetMessage();
                    Console.WriteLine(string.Format("message: {0}", s));
                    int n = service.AddItem(name, 5);
                    items = service.GetItems();
                    foreach (Item item in items)
                    {
                        Console.WriteLine("Item: {0}. Qty: {1}", item.Name, item.Quantity);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                Console.WriteLine("Enter name:");
                name = Console.ReadLine();
            }
        }
        private async void AddNewItem(object sender, EventArgs e)
        {
            Inventory       item            = (Inventory)BindingContext;
            InventoryClient inventoryClient = new InventoryClient();
            await inventoryClient.PostItemAsync(item);

            await Navigation.PopAsync();
        }
示例#6
0
        public void test_inventory_client_connection()
        {
            // Arrange
            var proxy = new InventoryClient();

            // Act & Assert
            proxy.Open();
        }
        public async void UpdateClicked(object sender, EventArgs e)
        {
            InventoryClient inventoryClient = new InventoryClient();
            Inventory       inventory       = (Inventory)BindingContext;
            await inventoryClient.PutItemAsync(inventory.Id, inventory);

            await Navigation.PopAsync();
        }
        public MainMenuViewModel(INavigation navigation, InventoryClient inventoryClient)
            : base(navigation)
        {
            this.CategoriesViewModel     = new CategoryListViewModel(navigation, inventoryClient);
            this.BrowseByCategoryCommand = new DelegateCommand(() => this.Navigation.PushAsync(new CategoryListPage(this.CategoriesViewModel)));

            this.AddItemCommand = new DelegateCommand(() => this.Navigation.PushAsync(new AddItemPage(new AddItemViewModel())));
        }
        public CategoryListViewModel(INavigation navigation, InventoryClient inventoryClient)
            : base(navigation)
        {
            this.inventoryClient = inventoryClient;

            this.Categories = new ObservableCollection <string>();

            this.RefreshCommand = new DelegateCommand(async() => await this.RefreshList());
        }
 public InventoryService(InventoryClient <InventoryDTO> client,
                         IUnitOfWorkProduccion repository,
                         IMapper mapper,
                         Serilog.ILogger logger) :
     base(client, repository, mapper)
 {
     _inventoryClient = client;
     _logger          = logger;
 }
示例#11
0
 public ActionResult AddQuantity(int Id)
 {
     InventoryClient client = new InventoryClient();
     var item = client.GetItems().FirstOrDefault(m => m.ItemId == Id);
     ItemAdded itemAdded = new ItemAdded();
     itemAdded.Item = client.GetItems().FirstOrDefault(m => m.ItemId == Id);
     itemAdded.QuantityAdded = 0;
     return View(itemAdded);
 }
示例#12
0
 public ActionResult AddQuantity(int Id)
 {
     InventoryClient client = new InventoryClient();
     //Todo: Add to the server a more efficient way to get a specific item based on ItemId
     //var item = client.DbGetItems().FirstOrDefault(m => m.ItemId == Id);
     ItemAdded itemAdded = new ItemAdded();
     itemAdded.Item = client.DbGetItems().FirstOrDefault(m => m.ItemId == Id);
     itemAdded.QuantityAdded = 0;
     return View(itemAdded);
 }
示例#13
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            InventoryClient  inventoryClient = new InventoryClient();
            List <Inventory> inventory       = await inventoryClient.GetInventoryAsync();

            var trends = new ObservableCollection <Inventory>(inventory);

            InventoryList.ItemsSource = trends;
        }
        public ItemDetailsViewModel(INavigation navigation, InventoryClient inventoryClient, Item model, bool isEditing = false)
            : base(navigation)
        {
            this.inventoryClient = inventoryClient;

            this.InitialiseEditFields();
            this.LoadModel(model);

            this.IsEditing = isEditing;
        }
示例#15
0
        protected void UploadButton_Click(object sender, EventArgs e)
        {
            try
            {
                InventoryClient InGoodsSave = new InventoryClient();

                if (FileUploadControl.HasFile)
                {
                    //string filename = Path.GetFileName(FileUploadControl.FileName);
                    //string str = Path.GetFullPath(FileUploadControl.FileName);
                    //string str1 = Path.GetFullPath(Convert.ToString(FileUploadControl.PostedFile.FileName));
                    //FileUploadControl.SaveAs(Server.MapPath("~/") + filename);


                    string jsonString = string.Empty; string strResultJson = string.Empty;
                    using (StreamReader inputStreamReader = new StreamReader(FileUploadControl.PostedFile.InputStream))
                    {
                        jsonString = inputStreamReader.ReadToEnd();
                    }


                    // var tableResult = JsonStringToDataTable(jsonString);

                    //string FileName = @"C:\Users\Guna\Documents\INVENTORY_GOODS_ISSUE _Multiple.txt";
                    //var stream = File.OpenText(FileName);
                    //string jsonString = stream.ReadToEnd();

                    if (jsonString.Contains("INVENTORY_GOODS_ISSUE"))
                    {
                        strResultJson = InGoodsSave.SaveInventoryGoodsIssue(jsonString);
                    }
                    else
                    {
                        strResultJson = InGoodsSave.SaveInventoryGoodsRecipet(jsonString);
                    }


                    //  DataTable dt = JsonStringToDataTable(jsonString);

                    //  var dt11 = creatingTempTableWithDatas();

                    // string strval = GetJson(dt);

                    txtResult.Text        = strResultJson.ToString();
                    StatusLabel.ForeColor = System.Drawing.Color.Green;
                    StatusLabel.Text      = "SUCCESS";
                }
            }
            catch (Exception ex)
            {
                StatusLabel.ForeColor = System.Drawing.Color.Red;
                StatusLabel.Text      = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
                Response.Write(ex.Message.ToString().Replace("\n", "<br/>"));
            }
        }
示例#16
0
        static void Main(string[] args)
        {
            InventoryClient client = new InventoryClient
                                     (
                new Adapter.ProductRepositoryAdapter(
                    new WebShop.ProductRepository()
                    )
                                     );

            client.DisplayInventory();
        }
        public async void DeleteClicked(object sender, EventArgs e)
        {
            var confirm = await DisplayAlert("Confirm", "Are you sure you Want to Delete this Item?", "Yes", "No");

            if (confirm)
            {
                InventoryClient inventoryClient = new InventoryClient();
                Inventory       inventory       = (Inventory)BindingContext;
                await inventoryClient.DeleteItemAsync(inventory.Id);

                await Navigation.PopAsync();
            }

            await Navigation.PopAsync();
        }
示例#18
0
        public ItemsControllerFixture()
        {
            Client = new InventoryClient();

            var result = Client.Post(Endpoint, new ItemCreateModel
            {
                Name     = $"{TestKey}_FIXTURE_Name",
                Model    = $"{TestKey}_FIXTURE_Model",
                Category = $"{TestKey}_FIXTURE_Category"
            }).GetAwaiter().GetResult();

            result.Response.IsSuccessStatusCode.Should().BeTrue();
            result.Response.StatusCode.Should().Be(HttpStatusCode.Created);

            FixtureItemId = result.ResourceId;
        }
示例#19
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            BindingContext = _bill;
            InventoryClient inventoryClient = new InventoryClient();

            Inventory = await inventoryClient.GetInventoryAsync();

            List <string> names = new List <string>();

            foreach (var item in Inventory)
            {
                string format = item.Name + " , " + item.Size;
                names.Add(format);
            }
            ItemsPicker.ItemsSource = names;
        }
示例#20
0
        /// <summary>
        /// To determine Orion value
        /// </summary>
        /// <param name="id">id</param>
        /// <returns>orion status</returns>
        public IActionResult CheckOrion(string id)
        {
            var client  = new InventoryClient();
            var request = new BasicVersionByCID
            {
                ContentID = new string[] { id }
            };

            GetBasicVersionInformationByCIDResponseMessage response = null;

            Task.Run(async() =>
            {
                response = await client.GetBasicVersionInformationByCIDAsync(request);
            }).Wait();

            return(Json(response));
        }
示例#21
0
        public ItemListViewModel(INavigation navigation, InventoryClient inventoryClient, string title, Task <IEnumerable <Item> > itemsGetterTask)
            : base(navigation)
        {
            this.inventoryClient = inventoryClient;
            this.Title           = title;

            itemsGetterTask.ContinueWith(items =>
            {
                if (items.Exception == null)
                {
                    this.Items = new ObservableCollection <Item>(items.Result);
                    base.OnPropertyChanged(nameof(this.Items));
                }
            });

            this.Items = new ObservableCollection <Item>();
        }
示例#22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="settings"></param>
        /// <param name="deviceProfile"></param>
        /// <param name="authenticatedUser"></param>
        public PokemonGoApiClient(IApiSettings settings, IDeviceProfile deviceProfile, AuthenticatedUser authenticatedUser = null) : this()
        {
            StartTime = DateTimeOffset.UtcNow;
            CancellationTokenSource = new CancellationTokenSource();
            RequestQueue            = new BlockingCollection <RequestEnvelope>();

            Player    = new PlayerClient(this);
            Download  = new DownloadClient(this);
            Inventory = new InventoryClient(this);
            Map       = new MapClient(this);
            Fort      = new FortClient(this);
            Encounter = new EncounterClient(this);

            ApiSettings   = settings;
            DeviceProfile = deviceProfile;

            SetAuthenticationProvider();
            AuthenticatedUser = authenticatedUser;
            Player.SetCoordinates(ApiSettings.DefaultPosition.Latitude, ApiSettings.DefaultPosition.Longitude, ApiSettings.DefaultPosition.Accuracy);
        }
示例#23
0
        static void Main(string[] args)
        {
            var client = new InventoryClient();

            var result = client.GetBasicVersionInformationByTitle(new BasicVersionByTitleInfo
                                                          {
                                                              TitleID = new int[] { 798460 }
                                                          });

            Console.Write(result);

            const int versionId = 619275;

            var versionDetails = client.GetBasicVersionInformationByVersionID(new BasicVersionByVersionID
                                                                                  {
                                                                                      VersionID = new int[] { versionId }
                                                                                  });

            Console.Write(versionDetails);
        }
示例#24
0
        static void Main(string[] args)
        {
            var client = new InventoryClient();

            var result = client.GetBasicVersionInformationByTitle(new BasicVersionByTitleInfo
            {
                TitleID = new int[] { 798460 }
            });

            Console.Write(result);

            const int versionId = 619275;

            var versionDetails = client.GetBasicVersionInformationByVersionID(new BasicVersionByVersionID
            {
                VersionID = new int[] { versionId }
            });


            Console.Write(versionDetails);
        }
示例#25
0
        static int Main(string[] args)
        {
            var client          = new ApiClient("test", "username", "password");
            var inventoryClient = new InventoryClient(client);

            try
            {
                // Create inventory
                var inventory = new Inventory();
                inventory.whse        = "00";
                inventory.partNo      = "TESTPART";
                inventory.type        = InventoryType.Normal;
                inventory.status      = InventoryStatus.Active;
                inventory.description = "Test Inventory";
                inventory             = inventoryClient.Create(inventory);

                // List inventory matching the query "TEST"
                foreach (var i in inventoryClient.List(0, 100, "TEST"))
                {
                    // i.id
                }

                // Get inventory
                inventory = inventoryClient.Fetch(inventory.id);

                // Update inventory
                inventory.description = "New Description";
                inventoryClient.Update(inventory.id, inventory);

                // Delete inventory
                inventoryClient.Delete(inventory.id);
            }
            catch (ApiException e)
            {
                Console.Error.WriteLine(e.Message);
                return(1);
            }

            return(0);
        }
        static int Main(string[] args)
        {
            var client = new ApiClient("test", "username", "password");
            var inventoryClient = new InventoryClient(client);

            try
            {
                // Create inventory
                var inventory = new Inventory();
                inventory.whse = "00";
                inventory.partNo = "TESTPART";
                inventory.type = InventoryType.Normal;
                inventory.status = InventoryStatus.Active;
                inventory.description = "Test Inventory";
                inventory = inventoryClient.Create(inventory);

                // List inventory matching the query "TEST"
                foreach (var i in inventoryClient.List(0, 100, "TEST"))
                {
                    // i.id
                }

                // Get inventory
                inventory = inventoryClient.Fetch(inventory.id);

                // Update inventory
                inventory.description = "New Description";
                inventoryClient.Update(inventory.id, inventory);

                // Delete inventory
                inventoryClient.Delete(inventory.id);
            }
            catch (ApiException e)
            {
                Console.Error.WriteLine(e.Message);
                return 1;
            }

            return 0;
        }
示例#27
0
        public CommerceService()
        {
            this._listClient      = ClientContext.Clients.CreateListClient();
            this._browseClient    = ClientContext.Clients.CreateBrowseClient();
            this._storeClient     = ClientContext.Clients.CreateStoreClient();
            this._cartClient      = ClientContext.Clients.CreateCartClient();
            this._orderClient     = ClientContext.Clients.CreateOrderClient();
            this._securityClient  = ClientContext.Clients.CreateSecurityClient();
            this._priceClient     = ClientContext.Clients.CreatePriceClient();
            this._marketingClient = ClientContext.Clients.CreateMarketingClient();
            this._inventoryClient = ClientContext.Clients.CreateInventoryClient();
            this._themeClient     = ClientContext.Clients.CreateThemeClient();
            this._pageClient      = ClientContext.Clients.CreatePageClient();
            this._reviewsClient   = ClientContext.Clients.CreateReviewsClient();

            _themesCacheStoragePath = ConfigurationManager.AppSettings["ThemeCacheFolder"];
            _pagesCacheStoragePath  = ConfigurationManager.AppSettings["PageCacheFolder"];

            this._viewLocator = new FileThemeViewLocator(HostingEnvironment.MapPath(_themesCacheStoragePath));

            this._cartHelper = new CartHelper(this);
        }
示例#28
0
        public Content Get(string contentId)
        {
            var client  = new InventoryClient();
            var request = new BasicVersionByCID
            {
                ContentID = new string[] { contentId }
            };

            GetBasicVersionInformationByCIDResponseMessage result = null;

            Task.Run(async() =>
            {
                result = await client.GetBasicVersionInformationByCIDAsync(request);
            }).Wait();

            if (result == null)
            {
                return(new Content());
            }

            var response = result.ResultByCID;

            if (response == null || response.Length < 1)
            {
                return(new Content());
            }

            if (response.Length > 1)
            {
                throw new Exception(string.Format("To many versions were returned from Orion. ContentId: {0}", contentId));
            }

            return(new Content
            {
                ContentId = contentId,
                MaterialIds = response[0].Segments.Select(s => s.MaterialID).ToList()
            });
        }
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            Bills            bill            = (Bills)BindingContext;
            List <Item>      items           = new List <Item>();
            InventoryClient  inventoryClient = new InventoryClient();
            List <Inventory> inventory       = await inventoryClient.GetInventoryAsync();

            foreach (var billItem in bill.Items)
            {
                foreach (var item in inventory)
                {
                    if (!item.Id.Equals(billItem.ItemId))
                    {
                        continue;
                    }
                    billItem.Name  = item.Name;
                    billItem.Type  = item.Type;
                    billItem.Size  = item.Size;
                    billItem.Price = item.Price;
                }
            }
            ItemsList.ItemsSource = bill.Items;
        }
示例#30
0
        public void InitializeClient()

        {
            this.inventoryClient = new InventoryClient();
        }
示例#31
0
 public ActionResult Delete(int Id)
 {
     InventoryClient client = new InventoryClient();
     var item = client.DbGetItem(Id);
     return View(item);
 }
示例#32
0
 public ActionResult Delete(Item item)
 {
     InventoryClient client = new InventoryClient();
     client.DbRemoveItem(item.ItemId);
     return RedirectToAction("Index");
 }
示例#33
0
        public void test_inventory_client_connection()
        {
            var proxy = new InventoryClient();

            proxy.Open();
        }
示例#34
0
        public void test_inventory_client_connection()
        {
            InventoryClient proxy = new InventoryClient();

            proxy.Open();
        }
示例#35
0
 public ActionResult Edit(Item item)
 {
     InventoryClient client = new InventoryClient();
     client.DbSaveItem(item);
     return RedirectToAction("Index");
 }
示例#36
0
 public ActionResult Delete(int Id)
 {
     InventoryClient client = new InventoryClient();
     client.RemoveItem(Id);
     return RedirectToAction("Index");
 }
示例#37
0
 public ActionResult Plus1(int Id)
 {
     InventoryClient client = new InventoryClient();
     client.AddQuantity(Id, 1);
     return RedirectToAction("Index");
 }
示例#38
0
 public ActionResult Minus1(int Id)
 {
     InventoryClient client = new InventoryClient();
     client.DbSubtractQuantity(Id, 1);
     return RedirectToAction("Index");
 }
示例#39
0
 public InventoryViewModel()
 {
     Items              = new ObservableCollection <InventoryItem>();
     _inventoryClient   = new InventoryClient();
     _someFancyUniqueId = Guid.NewGuid().ToString(); //that's not unique.
 }
示例#40
0
 public ActionResult Index()
 {
     InventoryClient client = new InventoryClient();
     var items = client.DbGetItems();
     return View(items);
 }
示例#41
0
 public ActionResult Details(int id)
 {
     InventoryClient client = new InventoryClient();
     var item = client.DbGetItems().FirstOrDefault(m => m.ItemId == id);
     return View(item);
 }
示例#42
0
 public ActionResult Inventory()
 {
     InventoryClient client = new InventoryClient();
     Item[] items = client.GetItems();
     return View(items);
 }
示例#43
0
 public ActionResult Create()
 {
     InventoryClient client = new InventoryClient();
     return View(new Item());
 }
示例#44
0
 public ActionResult Edit(int id)
 {
     InventoryClient client = new InventoryClient();
     var item = client.DbGetItem(id);
     return View(item);
 }
示例#45
0
 public ActionResult Create(Item item)
 {
     InventoryClient client = new InventoryClient();
     client.DbAddItem(item.ItemName, item.Quantity);
     return RedirectToAction("Index");
 }