Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,UnitId")] Item item, IList <IFormFile> files)
        {
            if (ModelState.IsValid)
            {
                ServicesCommonFunctions.AddImage(ref item, files);
                await _itemService.AddAsync(item);

                return(RedirectToAction(nameof(Index)));
            }
            SetViewData();
            return(View(item));
        }
Exemplo n.º 2
0
        public async Task Add()
        {
            var item = new Item {
                Number = "ABC0001", ItemType = ItemType.EUR
            };

            try
            {
                await _ItemsService.AddAsync(SelectedLoad.LoadId, item);

                SelectedLoad.Items.Add(item);
            }
            catch (Exception e)
            {
                var dialog = new MessageDialog(e.Message);
                await dialog.ShowAsync();
            }
        }
Exemplo n.º 3
0
        public async Task <IHttpActionResult> Post(int id, Item item)
        {
            await _ItemsService.AddAsync(id, item);

            return(Created("", item));
        }