private void addTable() { i += 1; Table t = new Table(); t.NUMBER = i; t.AVAILABLE = 0; t.SIZE = "65;65"; t.LOC = "5;5"; t.STATUS = 3; TableUIAdmin tab = new TableUIAdmin(); tab.Size = Databases.getSize(t.SIZE); tab.Location = Databases.getLocation(t.LOC); tab.Table = t; tab.Text = t.NUMBER + ""; tab.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tab.MinimumSize = new Size(10, 10); tab.DoubleClick += (sender2, e2) => removebut(sender2, e2, tab); ControlMoverOrResizer.Init(tab); panel1.Controls.Add(tab); TableManager.saveTable(t); tables.Add(tab); }
private void removebut(object sender2, EventArgs e2, TableUIAdmin t) { tables.Remove(t); TableManager.deleteTable(t.Table); t.Hide(); t.Dispose(); }
public static List <TableUIAdmin> makeTablesAdmin() { List <TableUIAdmin> fin = new List <TableUIAdmin>(); if (orderCache.Count == 0) { loadTables(); } foreach (Table t in orderCache) { TableUIAdmin tab = new TableUIAdmin(); tab.Size = Databases.getSize(t.SIZE); tab.Location = Databases.getLocation(t.LOC); tab.Table = t; tab.Text = t.NUMBER + ""; tab.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tab.MinimumSize = new Size(10, 10); fin.Add(tab); } return(fin); }