You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.0 KiB
73 lines
2.0 KiB
3 months ago
|
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.Dialogs
|
||
|
{
|
||
|
public partial class PriceAmendmentD : Form
|
||
|
{
|
||
|
public string newprice;
|
||
|
public PriceAmendmentD(string pcode = null, string pname = null, string previous = null)
|
||
|
{
|
||
|
InitializeComponent();
|
||
|
productCode.Text = pcode;
|
||
|
productName.Text = pname;
|
||
|
txtCurrent.Text = previous;
|
||
|
}
|
||
|
private void EXXIT_Click(object sender, EventArgs e)
|
||
|
{
|
||
|
this.DialogResult = DialogResult.Cancel;
|
||
|
this.Close();
|
||
|
}
|
||
|
private void Cllose_MouseEnter(object sender, EventArgs e)
|
||
|
{
|
||
|
EXXIT.BackColor = Color.Crimson;
|
||
|
}
|
||
|
private void Cllose_MouseLeave(object sender, EventArgs e)
|
||
|
{
|
||
|
EXXIT.BackColor = Color.FromArgb(20, 158, 132);
|
||
|
}
|
||
|
private void TxtnewP_KeyPress(object sender, KeyPressEventArgs e)
|
||
|
{
|
||
|
if (e.KeyChar == 46)
|
||
|
{
|
||
|
// accepts . character
|
||
|
}
|
||
|
else if (e.KeyChar == 8)
|
||
|
{
|
||
|
//accepts backspace
|
||
|
}
|
||
|
else if ((e.KeyChar < 48) || (e.KeyChar > 57)) //ascii code 48-57 between 0-9
|
||
|
{
|
||
|
e.Handled = true;
|
||
|
}
|
||
|
}
|
||
|
private void TxtnewP_TextChanged(object sender, EventArgs e)
|
||
|
{
|
||
|
newprice = txtnewP.Text;
|
||
|
if (String.IsNullOrEmpty(txtnewP.Text))
|
||
|
{
|
||
|
BTNsave.Enabled = false;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
BTNsave.Enabled = true;
|
||
|
}
|
||
|
}
|
||
|
private void BTNsave_Click(object sender, EventArgs e)
|
||
|
{
|
||
|
if (!String.IsNullOrEmpty(txtnewP.Text))
|
||
|
{
|
||
|
this.DialogResult = DialogResult.OK;
|
||
|
this.Close();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|