public ActionResult ListMoney() { var item = new List <MoneyClass>(); for (int i = 1; i < 5; i++) { var model = new MoneyClass(); if (i % 5 == 0) { model.MoneyType = "支出"; } else { model.MoneyType = "收入"; } model.MoneyAmount = i * 100; model.MoneyDate = DateTime.Now.AddMonths(i); model.MoneyNote = "第" + i + "筆備註。"; model.MoneyCount = i; item.Add(model); } return(View(item)); }
static void Main(string[] args) { Class1 cl = new Class1(); Console.WriteLine(cl.Add(55, 8)); MoneyClass mc = new MoneyClass("Ivanochko", 150); }
public ActionResult MoneyInput(MoneyClass Input) { if (ModelState.IsValid) { _MoneyService.Add(Input); _MoneyService.Save(); return(View()); } return(View(Input)); }
public void Add(MoneyClass money) { var account = new AccountBook() { Id = Guid.NewGuid(), Categoryyy = (int)money.category, Dateee = money.date, Amounttt = Convert.ToInt32(money.money), Remarkkk = money.description }; _accountBookRep.Create(account); }
/*RIP AZIR*/ public void BuyShopItem() { XMLParser XML = GameObject.FindGameObjectWithTag("ItemManager").GetComponent <XMLParser>(); MoneyClass PlayerMoney = GameObject.FindGameObjectWithTag("Player").GetComponent <MoneyClass>(); InventoryClass cInventory = GameObject.FindGameObjectWithTag("InventoryManager").GetComponent <InventoryClass>(); ItemBase Item = new ItemBase(); ItemBase NewItem = gameObject.GetComponentInParent <ItemBase>(); ItemTypeFinder TypeFinder = GameObject.FindGameObjectWithTag("ItemManager").GetComponent <ItemTypeFinder>(); // Get the object the component will be on and give it a name GameObject SubGameObject = new GameObject(NewItem.bName); SubGameObject.transform.parent = cInventory.ToolItems.transform; // If the player has enough gold if (PlayerMoney.GetMoney() >= NewItem.GetSellPrice()) { // If it has the item and is stackable if (cInventory.HasItem(NewItem.GetName()) && NewItem.GetStackable()) { cInventory.AddAmount(NewItem.GetName(), NewItem.GetAmount()); PlayerMoney.SetMoney(PlayerMoney.GetMoney() - NewItem.GetSellPrice()); } else { // Find the type of the item and set it up, after add it to the dictionary. Item = TypeFinder.ItemTyepFinder(NewItem, SubGameObject); Item.SetUpThisItem(NewItem.bItemType, NewItem.bName, NewItem.bAmount, NewItem.bStackable, NewItem.bSrcImage, NewItem.bSoundEffect, NewItem.bTile, NewItem.bPrefab, NewItem.bSellPrice, NewItem.bCustomData, NewItem.GetDesc()); cInventory.AddItem(Item); PlayerMoney.SetMoney(PlayerMoney.GetMoney() - Item.GetSellPrice()); } } cInventory.UpdateUI(); }
public ActionResult MoneyInput() { var input = new MoneyClass(); return(PartialView(input)); }