You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.4 KiB
C#

using POS.Language.Language;
using POSV.Entity;
using POSV.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace POSV.Business
{
public partial class InputPriceDialogForm : BusinessForm
{
private ProductExt _product = null;
private bool isUse = false;
public InputPriceDialogForm(ProductExt product)
{
InitializeComponent();
this._product = product;
}
private void OnTouchClick(object sender, Component.TouchEventArgs e)
{
if (isUse) {
return;
}
isUse = true;
switch (e.Value)
{
case "clear":
{
this.txtPrice.Text = string.Empty;
this.txtPrice.Focus();
}
break;
case "close":
{
OnControlBoxCloseClick(sender, EventArgs.Empty);
}
break;
case "accept":
if (this.txtPrice.DecimalValue > 0)
{
bool isGo = true;
LOGGER.Info("确定商品价格>>>>>{0}",DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
if (isGo)
{
this.OnAcceptButtonClick(new TransparentEventArgs(TransparentAction.Accept, e.Value, this.txtPrice.DecimalValue));
}
LOGGER.Info("关闭窗口>>>>>{0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
OnControlBoxCloseClick(sender, EventArgs.Empty);
}
else
{
this.ShowMessage(this.lblInfo, LangProxy.ToLang("不允许销售价格为零"), true);
}
break;
default:
InputSimulatorUtils.SendKey(KeyCodes.Map[e.Value]);
break;
}
isUse = false;
}
private void OnControlBoxCloseClick(object sender, EventArgs e)
{
if (this.Owner != null)
{
this.Owner.Close();
}
this.Close();
}
}
}