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

59 lines
1.6 KiB
C#

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 Tanshu.Accounts.Entities;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.SqlDAO;
using Tanshu.Accounts.Helpers;
namespace Tanshu.Accounts.PointOfSale
{
public partial class ModifierForm : Form
{
private IList<Modifier> selection;
private IList<Modifier> source;
private IList<CheckBox> list;
public ModifierForm(IList<Modifier> source, IList<Modifier> selection)
{
InitializeComponent();
this.selection = selection;
this.source = source;
list = new List<CheckBox>();
}
private void button_Click(object sender, EventArgs e)
{
CheckBox button = sender as CheckBox;
if (button == null)
return;
if (button.CheckState == CheckState.Checked)
selection.Add((Modifier)button.Tag);
else
selection.Remove((Modifier)button.Tag);
}
public IList<Modifier> Selection
{
get
{
return selection;
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void ModifierForm_Load(object sender, EventArgs e)
{
ControlFactory.GenerateModifiers(ref flpModifier, ref list, selection, new Point(75, 75), 30, source, new ButtonClickDelegate(button_Click));
}
}
}