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); } }
public async Task <IActionResult> Index() { //TransactionTest(); await _itemRepository.AddItems(new Item("Item 1"), new Item("Item 2")); return(View(await _itemRepository.GetAll())); }
public IActionResult AddItems(Items item) { try { _repo.AddItems(item); return(Ok()); } catch (Exception ex) { return(NotFound(ex.Message)); } }
public IActionResult AddItems(Items obj) { try { _repo.AddItems(obj); return(Ok()); } catch (Exception e) { return(Ok(e.InnerException.Message)); } }
public async Task <bool> AddItems(ItemDetails items) { bool item = await _itemRepository.AddItems(items); return(item); }
public async Task <IActionResult> AddItem(Items item) { var result = await _itemRepo.AddItems(item); return(Ok(result)); }
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); }