Breaking Changes. Upgrade Script in Sql directory. Deployed
This commit is contained in:
@ -16,11 +16,11 @@ namespace Tanshu.Accounts.Helpers
|
||||
|
||||
public static class ControlFactory
|
||||
{
|
||||
public static void GenerateTables(ref FlowLayoutPanel panel, ref List<Button> buttonList, Point size, int start, IList<FoodTable> inList, ButtonClickDelegate bcDelegate)
|
||||
public static void GenerateTables(ref FlowLayoutPanel panel, Point size, int start, IList<FoodTable> inList, ButtonClickDelegate bcDelegate)
|
||||
{
|
||||
IList<FoodTable> list = new List<FoodTable>();
|
||||
int pageLength, stop;
|
||||
PageSetup(ref panel, ref buttonList, start, inList as IList, out pageLength, out stop);
|
||||
PageSetup(ref panel, start, inList as IList, out pageLength, out stop);
|
||||
if (start != 0)
|
||||
list.Add(new FoodTable() { FoodTableID = start - pageLength, Name = "Previous" });
|
||||
for (int i = start; i < stop; i++)
|
||||
@ -33,22 +33,20 @@ namespace Tanshu.Accounts.Helpers
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
var item = list[i];
|
||||
var status = SaleVoucherBI.GetTableStatus(item.Name);
|
||||
var status = item.Status;
|
||||
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);
|
||||
}
|
||||
}
|
||||
public static void GenerateProducts(ref FlowLayoutPanel panel, ref List<Button> buttonList, Point size, int start, IList<Product> inList, ButtonClickDelegate bcDelegate)
|
||||
public static void GenerateProducts(ref FlowLayoutPanel panel, Point size, int start, IList<Product> inList, ButtonClickDelegate bcDelegate)
|
||||
{
|
||||
IList<Product> list = new List<Product>();
|
||||
int pageLength, stop;
|
||||
PageSetup(ref panel, ref buttonList, start, inList as IList, out pageLength, out stop);
|
||||
PageSetup(ref panel, start, inList as IList, out pageLength, out stop);
|
||||
if (start != 0)
|
||||
list.Add(new Product() { ProductID = start - pageLength, Name = "Previous" });
|
||||
for (int i = start; i < stop; i++)
|
||||
@ -64,37 +62,29 @@ namespace Tanshu.Accounts.Helpers
|
||||
{
|
||||
var item = list[i];
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
public static void GenerateGroups(ref FlowLayoutPanel panel, ref IList<UnselectableCheckbox> controlList, Point size, IList<ProductGroup> list, ButtonClickDelegate bcDelegate)
|
||||
// For Discount Form
|
||||
public static void GenerateGroups(ref FlowLayoutPanel panel, Point size, IList<string> list, ButtonClickDelegate bcDelegate)
|
||||
{
|
||||
if (controlList.Count != 0)
|
||||
{
|
||||
for (int i = controlList.Count - 1; i >= 0; i--)
|
||||
{
|
||||
controlList[i].Dispose();
|
||||
}
|
||||
controlList = new List<UnselectableCheckbox>();
|
||||
}
|
||||
panel.Controls.Clear();
|
||||
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);
|
||||
var control = GetUnselectableCheckbox(i.ToString(), item, 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)
|
||||
// For Main Form
|
||||
public static void GenerateGroups(ref FlowLayoutPanel panel, Point size, int start, IList<ProductGroup> inList, ButtonClickDelegate bcDelegate)
|
||||
{
|
||||
IList<ProductGroup> list = new List<ProductGroup>();
|
||||
int pageLength, stop;
|
||||
PageSetup(ref panel, ref buttonList, start, inList as IList, out pageLength, out stop);
|
||||
PageSetup(ref panel, start, inList as IList, out pageLength, out stop);
|
||||
if (start != 0)
|
||||
list.Add(new ProductGroup() { ProductGroupID = start - pageLength, Name = "Previous" });
|
||||
for (int i = start; i < stop; i++)
|
||||
@ -108,9 +98,7 @@ namespace Tanshu.Accounts.Helpers
|
||||
{
|
||||
var item = list[i];
|
||||
var control = GetButton(string.Format("g{0}", i), item.Name, 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);
|
||||
}
|
||||
}
|
||||
public static void GenerateModifiers(ref FlowLayoutPanel panel, ref IList<CheckBox> controlList, IList<Modifier> selection, Point size, int count, IList<Modifier> list, ButtonClickDelegate bcDelegate)
|
||||
@ -135,16 +123,9 @@ namespace Tanshu.Accounts.Helpers
|
||||
}
|
||||
}
|
||||
|
||||
private static void PageSetup(ref FlowLayoutPanel panel, ref List<Button> buttonList, int start, IList inList, out int pageLength, out int stop)
|
||||
private static void PageSetup(ref FlowLayoutPanel panel, int start, IList inList, out int pageLength, out int stop)
|
||||
{
|
||||
if (buttonList.Count != 0)
|
||||
{
|
||||
for (int i = buttonList.Count - 1; i >= 0; i--)
|
||||
{
|
||||
buttonList[i].Dispose();
|
||||
}
|
||||
buttonList = new List<Button>();
|
||||
}
|
||||
panel.Controls.Clear();
|
||||
pageLength = (panel.Height / (3 + 75 + 3));
|
||||
pageLength *= (panel.Width / (3 + 75 + 3));
|
||||
pageLength -= 2;
|
||||
|
||||
Reference in New Issue
Block a user