narsil/Tanshu.Accounts.PointOfSale/Sales/PaxForm.cs

37 lines
850 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Tanshu.Accounts.Helpers;
namespace Tanshu.Accounts.PointOfSale
{
public partial class PaxForm : Form
{
int _pax;
public PaxForm()
{
InitializeComponent();
}
public int Pax
{
get { return _pax; }
}
private void txtAmount_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Return && int.TryParse(txtAmount.Text, out _pax))
{
this.DialogResult = DialogResult.OK;
this.Close();
}
else if (e.KeyCode == Keys.Escape)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}
}