|
|
|
|
using POSV.Entity;
|
|
|
|
|
using POSV.ShoppingCart;
|
|
|
|
|
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 QuantityForm : BusinessForm
|
|
|
|
|
{
|
|
|
|
|
private QuantityPanelEx quantityPanelEx;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 当前选择的记录
|
|
|
|
|
/// </summary>
|
|
|
|
|
private readonly OrderItem _orderItem = null;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 权限控制码
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string _permissionCode = string.Empty;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 授权人信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
private Tuple<decimal, decimal, List<string>, Worker> _authz = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public QuantityForm(OrderItem orderItem, string permissionCode, Tuple<decimal, decimal, List<string>, Worker> authz = null)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
this._orderItem = orderItem;
|
|
|
|
|
|
|
|
|
|
this._permissionCode = permissionCode;
|
|
|
|
|
|
|
|
|
|
this._authz = authz;
|
|
|
|
|
|
|
|
|
|
this.bottomPanel.Text = this._orderItem.Name;
|
|
|
|
|
|
|
|
|
|
this.mainPanel.Controls.Clear();
|
|
|
|
|
|
|
|
|
|
this.quantityPanelEx = new POSV.Business.QuantityPanelEx(orderItem, permissionCode, AuthOperator.输入操作, _authz);
|
|
|
|
|
this.quantityPanelEx.Dock = System.Windows.Forms.DockStyle.Fill;
|
|
|
|
|
this.quantityPanelEx.Location = new System.Drawing.Point(0, 0);
|
|
|
|
|
this.quantityPanelEx.Name = "quantityPanelEx";
|
|
|
|
|
this.quantityPanelEx.Padding = new System.Windows.Forms.Padding(2);
|
|
|
|
|
|
|
|
|
|
this.mainPanel.Controls.Add(this.quantityPanelEx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnLoad(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnLoad(e);
|
|
|
|
|
|
|
|
|
|
if (this.DesignMode) return;
|
|
|
|
|
|
|
|
|
|
this.SetStyle(ControlStyles.Selectable, true);
|
|
|
|
|
|
|
|
|
|
this.ActiveControl = this.quantityPanelEx;
|
|
|
|
|
|
|
|
|
|
this.quantityPanelEx.AcceptButtonClick += OnAcceptButtonClick;
|
|
|
|
|
this.quantityPanelEx.CancelButtonClick += OnCancelButtonClick;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnAcceptButtonClick(object sender, FlyoutEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.OnAcceptButtonClick(new TransparentEventArgs(TransparentAction.Accept, e.KeyCode, e.Data));
|
|
|
|
|
OnControlBoxCloseClick(sender, EventArgs.Empty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnCancelButtonClick(object sender, FlyoutEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
OnControlBoxCloseClick(sender, EventArgs.Empty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnControlBoxCloseClick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (this.Owner != null)
|
|
|
|
|
{
|
|
|
|
|
this.Owner.Close();
|
|
|
|
|
}
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|