public async Task <ItemMasterLootCurrency> Update(ItemMasterLootCurrency item) { var ItemMasterLootCurrency = await _repo.Get((int)item.ItemMasterLootCurrencyId); if (ItemMasterLootCurrency == null) { return(ItemMasterLootCurrency); } ItemMasterLootCurrency.Amount = item.Amount; //ItemMasterLootCurrency.Name = item.Name; //ItemMasterLootCurrency.BaseUnit = item.BaseUnit; //ItemMasterLootCurrency.WeightValue = item.WeightValue; //ItemMasterLootCurrency.SortOrder = item.SortOrder; //ItemMasterLootCurrency.CurrencyTypeId = item.CurrencyTypeId; //ItemMasterLootCurrency.CharacterId = item.CharacterId; try { await _repo.Update(ItemMasterLootCurrency); } catch (Exception ex) { throw ex; } return(ItemMasterLootCurrency); }
public async Task <ItemMasterLootCurrency> DropQuantity(ItemMasterLootCurrency item) { var itemMasterLootCurrency = await _repo.Get((int)item.ItemMasterLootCurrencyId); if (itemMasterLootCurrency == null) { return(itemMasterLootCurrency); } if (itemMasterLootCurrency.Amount >= item.Amount) { itemMasterLootCurrency.Amount -= item.Amount; } try { await _repo.Update(itemMasterLootCurrency); } catch (Exception ex) { throw ex; } return(itemMasterLootCurrency); }
public async Task <ItemMasterLootCurrency> Create(ItemMasterLootCurrency item) { var ItemMasterLootCurrency = new ItemMasterLootCurrency { Name = item.Name, Amount = item.Amount, Command = item.Command, BaseUnit = item.BaseUnit, WeightValue = item.WeightValue, SortOrder = item.SortOrder, IsDeleted = false, CurrencyTypeId = item.CurrencyTypeId, LootId = item.LootId, }; return(await _repo.Add(ItemMasterLootCurrency)); }
public async Task <ItemMasterLootCurrency> UpdateQuantity(ItemMasterLootCurrency item) { var itemMasterLootCurrency = await _repo.Get((int)item.ItemMasterLootCurrencyId); if (itemMasterLootCurrency == null) { return(itemMasterLootCurrency); } itemMasterLootCurrency.Amount += item.Amount; itemMasterLootCurrency.Command = itemMasterLootCurrency.Amount.ToString(); try { await _repo.Update(itemMasterLootCurrency); } catch (Exception ex) { throw ex; } return(itemMasterLootCurrency); }