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; using POSV.Entity; using POSV.ShoppingCart; namespace POSV.Business { public partial class FlavorDialogForm : BusinessForm { private FlavorPanelEx flavorPanelEx; /// /// 当前选择的记录 /// private readonly OrderItem _orderItem = null; /// /// 权限控制码 /// private string _permissionCode = string.Empty; /// /// 授权人信息 /// private Tuple , Worker> _authz = null; public FlavorDialogForm(OrderItem orderItem , string permissionCode , Tuple , Worker> authz = null) { InitializeComponent(); this._orderItem = orderItem; this._permissionCode = permissionCode; this._authz = authz; this.mainPanel.Controls.Clear(); this.flavorPanelEx = new POSV.Business.FlavorPanelEx(orderItem , permissionCode , authz); this.flavorPanelEx.Dock = System.Windows.Forms.DockStyle.Fill; this.flavorPanelEx.Location = new System.Drawing.Point(0 , 0); this.flavorPanelEx.Name = "flavorPanelEx"; this.flavorPanelEx.Padding = new System.Windows.Forms.Padding(2); this.mainPanel.Controls.Add(this.flavorPanelEx); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (this.DesignMode) return; this.SetStyle(ControlStyles.Selectable , true); this.ActiveControl = this.flavorPanelEx; this.flavorPanelEx.NotifyChanged += OnNotifyChanged; this.flavorPanelEx.CancelButtonClick += OnCancelButtonClick; } private void OnNotifyChanged(object sender , FlyoutEventArgs e) { this.OnAcceptButtonClick(new TransparentEventArgs(TransparentAction.Accept , e.KeyCode , e.Data)); } 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(); } } }