private void btnReset_Click(object sender, EventArgs e) { // 잔고 초기화 userBalance = new balance(); double totalAsset = userBalance.getTotalAsset(); double cash = userBalance.getCash(); double profitPercent = userBalance.calcProfitPercentage(); double profit = userBalance.getProfit(); double purchase = userBalance.getPurchaseAmount(); double currentTotalPrice = userBalance.getCurrentTotalPrice(); lblBalance.Text = totalAsset.ToString(); lbl_percent.Text = "0%"; profit_txt.Text = profit.ToString(); purchase_txt.Text = purchase.ToString(); evaluated_txt.Text = currentTotalPrice.ToString(); cash_txt.Text = cash.ToString(); }
public mainForm() { InitializeComponent(); userBalance = new balance(); double totalAsset = userBalance.getTotalAsset(); double cash = userBalance.getCash(); double profitPercent = userBalance.calcProfitPercentage(); double profit = userBalance.getProfit(); double purchase = userBalance.getPurchaseAmount(); double currentTotalPrice = userBalance.getCurrentTotalPrice(); lblBalance.Text = totalAsset.ToString(); lbl_percent.Text = "0%"; profit_txt.Text = profit.ToString(); purchase_txt.Text = purchase.ToString(); evaluated_txt.Text = currentTotalPrice.ToString(); cash_txt.Text = cash.ToString(); }