Moved numpad control to Tanshu.Common. Billing feature complete. Delete not working as expected
Signed-off-by: unknown <tanshu@.(none)>
This commit is contained in:
@ -7,6 +7,8 @@ using System.Drawing;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using Tanshu.Accounts.Entities;
|
||||
using System.Collections;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Common.KeyboardControl;
|
||||
|
||||
namespace Tanshu.Accounts.Helpers
|
||||
{
|
||||
@ -31,7 +33,12 @@ namespace Tanshu.Accounts.Helpers
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
var item = list[i];
|
||||
var status = SaleVoucherBI.GetTableStatus(item.Name);
|
||||
var control = GetButton(string.Format("g{0}", i), item.Name, size.X, size.Y, item, bcDelegate);
|
||||
if (status == "printed")
|
||||
control.BackColor = Color.Green;
|
||||
else if (status == "running")
|
||||
control.BackColor = Color.Red;
|
||||
//var control = GetButton(string.Format("g{0}", i), string.Format("{0} {1}", item.ProductGroupID, item.Name), size.X, size.Y, item, bcDelegate);
|
||||
panel.Controls.Add(control);
|
||||
buttonList.Add(control);
|
||||
@ -56,7 +63,7 @@ namespace Tanshu.Accounts.Helpers
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
var item = list[i];
|
||||
var control = GetButton(string.Format("p{0}", i), string.Format("{0} ({1})", item.Name, item.Units), size.X, size.Y, item, bcDelegate);
|
||||
var control = GetButton(string.Format("p{0}", i), item.Units == string.Empty ? item.Name : string.Format("{0} ({1})", item.Name, item.Units), size.X, size.Y, item, bcDelegate);
|
||||
//var control = GetButton(string.Format("g{0}", i), string.Format("{0} {1}", item.ProductGroupID, item.Name), size.X, size.Y, item, bcDelegate);
|
||||
panel.Controls.Add(control);
|
||||
buttonList.Add(control);
|
||||
@ -64,6 +71,24 @@ namespace Tanshu.Accounts.Helpers
|
||||
|
||||
|
||||
|
||||
}
|
||||
public static void GenerateGroups(ref FlowLayoutPanel panel, ref IList<UnselectableCheckbox> controlList, Point size, IList<ProductGroup> list, ButtonClickDelegate bcDelegate)
|
||||
{
|
||||
if (controlList.Count != 0)
|
||||
{
|
||||
for (int i = controlList.Count - 1; i >= 0; i--)
|
||||
{
|
||||
controlList[i].Dispose();
|
||||
}
|
||||
controlList = new List<UnselectableCheckbox>();
|
||||
}
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
var item = list[i];
|
||||
var control = GetUnselectableCheckbox(i.ToString(), item.Name, size.X, size.Y, item, bcDelegate);
|
||||
panel.Controls.Add(control);
|
||||
controlList.Add(control);
|
||||
}
|
||||
}
|
||||
public static void GenerateGroups(ref FlowLayoutPanel panel, ref List<Button> buttonList, Point size, int start, IList<ProductGroup> inList, ButtonClickDelegate bcDelegate)
|
||||
{
|
||||
@ -146,6 +171,22 @@ namespace Tanshu.Accounts.Helpers
|
||||
control.Click += new EventHandler(bcDelegate);
|
||||
return control;
|
||||
}
|
||||
private static UnselectableCheckbox GetUnselectableCheckbox(string name, string text, int width, int height, object tag, ButtonClickDelegate bcDelegate)
|
||||
{
|
||||
UnselectableCheckbox control = new UnselectableCheckbox()
|
||||
{
|
||||
Name = name,
|
||||
Text = text,
|
||||
Width = width,
|
||||
Height = height,
|
||||
Tag = tag,
|
||||
Appearance = Appearance.Button,
|
||||
|
||||
};
|
||||
if (bcDelegate != null)
|
||||
control.Click += new EventHandler(bcDelegate);
|
||||
return control;
|
||||
}
|
||||
private static CheckBox GetCheckbox(string name, string text, int width, int height, object tag, ButtonClickDelegate bcDelegate)
|
||||
{
|
||||
CheckBox control = new CheckBox()
|
||||
@ -156,7 +197,7 @@ namespace Tanshu.Accounts.Helpers
|
||||
Height = height,
|
||||
Tag = tag,
|
||||
Appearance = Appearance.Button,
|
||||
|
||||
|
||||
};
|
||||
if (bcDelegate != null)
|
||||
control.Click += new EventHandler(bcDelegate);
|
||||
|
||||
@ -21,7 +21,6 @@ namespace Tanshu.Accounts.Helpers
|
||||
filters.Add("Name");
|
||||
SetFilterColumns(filters);
|
||||
grid.Columns["WaiterID"].Visible = false;
|
||||
grid.Columns["timestamp"].Visible = false;
|
||||
}
|
||||
|
||||
protected override void FilterChanged(Dictionary<string, string> filter)
|
||||
|
||||
Reference in New Issue
Block a user