Exemplo n.º 1
0
        public async Task TestAddItemSuccess(int itemid, string itemname, string price, int stocknumber, string description, string remarks, int sellerid)
        {
            try
            {
                var items = new ItemDetails {
                    Itemid = itemid, Itemname = itemname, Price = price, Stockno = stocknumber, Description = description, Remarks = remarks, Sellerid = sellerid
                };
                var result = await itemRepository.AddItems(items);

                Assert.NotNull(result);
            }
            catch (Exception e)
            {
                Assert.Fail(e.InnerException.Message);
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Index()
        {
            //TransactionTest();
            await _itemRepository.AddItems(new Item("Item 1"), new Item("Item 2"));

            return(View(await _itemRepository.GetAll()));
        }
Exemplo n.º 3
0
 public IActionResult AddItems(Items item)
 {
     try
     {
         _repo.AddItems(item);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(NotFound(ex.Message));
     }
 }
Exemplo n.º 4
0
 public IActionResult AddItems(Items obj)
 {
     try
     {
         _repo.AddItems(obj);
         return(Ok());
     }
     catch (Exception e)
     {
         return(Ok(e.InnerException.Message));
     }
 }
Exemplo n.º 5
0
        public async Task <bool> AddItems(ItemDetails items)
        {
            bool item = await _itemRepository.AddItems(items);

            return(item);
        }
Exemplo n.º 6
0
        public async Task <IActionResult> AddItem(Items item)
        {
            var result = await _itemRepo.AddItems(item);

            return(Ok(result));
        }
Exemplo n.º 7
0
        public async Task <bool> AddItemsManager(ItemDetails obj)
        {
            bool item = await _itemRepository.AddItems(obj);

            return(item);
        }
        public async Task <bool> AddItemsManager(ItemsModel items)
        {
            bool item = await _repo.AddItems(items);

            return(item);
        }