using BiskLog_Point_Of_Sale.Properties; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace BiskLog_Point_Of_Sale.POSDialogs { public partial class AlterWindow : Form { public decimal sellingprice, totalPrice; public int quantity; private void sellingPrice_TextChanged(object sender, EventArgs e) { if (!String.IsNullOrEmpty(sellingPriceTXT.Text)) { sellingprice = decimal.Parse(sellingPriceTXT.Text); totalPrice = sellingprice * quantity; totallbl.Text = Settings.Default.currrencyCode + " " + totalPrice.ToString(); } else { sellingprice = 0; totalPrice = 0; } } private void confirm_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; this.Close(); } public AlterWindow(string ID, string name, int quantity, string unit,decimal sellingprice, decimal totalPrice) { InitializeComponent(); this.sellingprice = sellingprice; this.totalPrice = totalPrice; this.quantity = quantity; currencyLBL.Text = Settings.Default.currrencyCode; productIDlbl.Text = ID; productNamelbl.Text = name; qtylbl.Text = quantity.ToString(); unitMeasure.Text = unit; sellingPriceTXT.Text = sellingprice.ToString(); totallbl.Text = Settings.Default.currrencyCode + " " + totalPrice.ToString(); } private void qtylbl_TextChanged(object sender, EventArgs e) { if (!String.IsNullOrEmpty(qtylbl.Text)) { quantity = int.Parse(qtylbl.Text); sellingprice = decimal.Parse(sellingPriceTXT.Text); totalPrice = sellingprice * quantity; totallbl.Text = Settings.Default.currrencyCode + " " + totalPrice.ToString(); } else { quantity = 0; sellingprice = decimal.Parse(sellingPriceTXT.Text); totalPrice = sellingprice * quantity; totallbl.Text = Settings.Default.currrencyCode + " " + totalPrice.ToString(); } } private void exitBTN_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Abort; this.Close(); } } }