Checked actamount before calculating
This commit is contained in:
@ -3,13 +3,7 @@ using Helpers;
|
||||
using StockDAL.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace StockInfo
|
||||
@ -87,7 +81,7 @@ namespace StockInfo
|
||||
if (txtSoldPrice.Text.IsNumeric() && txtSoldAmount.Text.IsNumeric())
|
||||
{
|
||||
txtSellValue.Text = (decimal.Parse(txtSoldPrice.Text) * long.Parse(txtSoldAmount.Text)).ToString();
|
||||
txtRemainingNo.Text = (stkMemSelected.PostAmount - long.Parse(txtSoldAmount.Text)).ToString();
|
||||
txtRemainingNo.Text = stkMemSelected.ActAmount > 0 ? (stkMemSelected.PostAmount - long.Parse(txtSoldAmount.Text)).ToString() : 0.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user