public async void AddItemButton() { try { await _itemsEnd.AddPendingItem(new AddPendingItemModel { Amount = Amount, ItemTypeID = SelectedItemType.ItemTypeID }); await _soloDB.SetAndShow("Success!", "Your item has been added to the pending list. It will be added to your inventory when authorized by an admin.", "Ok"); } catch (Exception ex) { await _soloDB.SetAndShow("Error!", "Something has gone wrong\n" + ex.Message, "Ok"); } }
public async void AddNewItemTypeButton() { try { await _itemsEndPoint.AddNewItemType(NewTypeName); await _soloButton.SetAndShow("Success", "The New item type is added", "Ok"); NewTypeName = ""; BackButton(); } catch { await _soloButton.SetAndShow("Failure", "Couldn't add new item type", "Ok"); } }
public async void CreateSellOfferButton() { OfferModel offer = new OfferModel { Amount = SellingAmount, ItemTypeID = _uim.ItemTypeId, UnitPrice = UnitPrice, }; try { await _itemsEndPoint.CreateSellOffer(offer); await TryCloseAsync(); await _dialogbox.SetAndShow("Success", "Succesfully created the sell offer", "Ok"); } catch { await _dialogbox.SetAndShow("Failure", "Couldn't place the sell offer", "Ok"); } }
public async void CreateBuyOfferButton() { OfferModel offer = new OfferModel { Amount = BuyingAmount, ItemTypeID = SelectedItemType.ItemTypeID, UnitPrice = UnitPrice, }; try { await _moneysEndPoint.CreateBuyOffer(offer); UserMoney = await _moneysEndPoint.GetUserMoneyByID(); await _dialogbox.SetAndShow("Success", "Succesfully created the buy offer", "Ok"); } catch { await _dialogbox.SetAndShow("Failure", "Couldn't place the buy offer", "Ok"); } }