// POST: odata/OdataInitialAmounts public IHttpActionResult Post(InitialAmount initialAmount) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _db.InitialAmounts.Add(initialAmount); _db.SaveChanges(); return(Created(initialAmount)); }
public override int GetHashCode() { int hashCode = 1016347869; hashCode = hashCode * -1521134295 + Id.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Brand); hashCode = hashCode * -1521134295 + InitialAmount.GetHashCode(); hashCode = hashCode * -1521134295 + ConsumedAmount.GetHashCode(); hashCode = hashCode * -1521134295 + CurrentAmount.GetHashCode(); hashCode = hashCode * -1521134295 + DeliveryDate.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <FlavorDto> .Default.GetHashCode(Flavor); hashCode = hashCode * -1521134295 + FlavorId.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <SupplementTypeDto> .Default.GetHashCode(SupplementType); hashCode = hashCode * -1521134295 + SupplementTypeId.GetHashCode(); return(hashCode); }
public void SetItem(ItemDefinition newItem) { int amount = Mathf.CeilToInt(newItem.Amount * DarkestDungeonManager.Campaign.EventModifiers.ProvisionAmountModifier(newItem.Type)); Item = new ItemDefinition(newItem.Type, newItem.Id, amount); InitialAmount = amount; InventoryItem = DarkestDungeonManager.Data.Items[Item.Type][Item.Id]; if (Item.Type == "gold" || Item.Type == "provision") { itemIcon.sprite = DarkestDungeonManager.Data.Sprites["inv_" + Item.Type + "+" + Item.Id + "_1"]; } else { itemIcon.sprite = DarkestDungeonManager.Data.Sprites["inv_" + Item.Type + "+" + Item.Id]; } Cost = (int)(InventoryItem.PurchasePrice * DarkestDungeonManager.Campaign.EventModifiers.ProvisionCostModifier(newItem.Type)); costText.text = Cost.ToString(); amountLabel.text = InitialAmount.ToString(); }
void ReleaseDesignerOutlets() { if (InitAmountLabel != null) { InitAmountLabel.Dispose(); InitAmountLabel = null; } if (InitialAmount != null) { InitialAmount.Dispose(); InitialAmount = null; } if (MainText != null) { MainText.Dispose(); MainText = null; } if (NavigateToTipCalculator != null) { NavigateToTipCalculator.Dispose(); NavigateToTipCalculator = null; } if (TipAmount != null) { TipAmount.Dispose(); TipAmount = null; } if (TipAmountLabel != null) { TipAmountLabel.Dispose(); TipAmountLabel = null; } }