Пример #1
0
 public MesaFatura(User u, TableUI t)
 {
     ord = t;
     log = u;
     InitializeComponent();
     this.Text = "Pedido da Mesa " + ord.Table.NUMBER;
 }
Пример #2
0
        private void openTable(TableUI t)
        {
            if (t.Table.ORDER == null)
            {
                Order o2 = new Order();
                o2.CREATORUSERID = log.IDENTIFIER;
                o2.ORDERTYPE     = 1;
                count           += 1;
                o2.ID            = count;
                o2.DATECREATED   = Time.get();
                o2.DONE          = false;
                o2.TABLE         = t.Table.NUMBER;
                o2.IDENTIFIER    = Databases.getIdentifier(Classes.Enum.IdentifierType.ORDER);

                t.Table.ORDER = o2;

                MesaFatura f = new MesaFatura(log, t);
                //f.FormClosed += (sender2, e2) => refreshDisplay(t);
                f.ShowDialog();
                return;
            }
            else
            {
                MesaFatura f = new MesaFatura(log, t);
                //f.FormClosed += (sender2, e2) => refreshDisplay(t);
                f.ShowDialog();
                return;
            }
        }
Пример #3
0
 private void mouseClick(MouseEventArgs e, TableUI t)
 {
     switch (e.Button)
     {
     case MouseButtons.Right:
     {
         clicked    = t;
         mtext.Text = "Mesa " + t.Table.NUMBER;
         rclik.Show(Cursor.Position.X, Cursor.Position.Y + 5);
     }
     break;
     }
 }
Пример #4
0
        public static List <TableUI> makeTables()
        {
            List <TableUI> fin = new List <TableUI>();

            loadTables();
            foreach (Table t in orderCache)
            {
                TableUI tab = new TableUI();
                tab.Size        = Databases.getSize(t.SIZE);
                tab.Location    = Databases.getLocation(t.LOC);
                tab.Table       = t;
                tab.BorderStyle = BorderStyle.None;

                if (t.AVAILABLE == 0)
                {
                    tab.BackColor = Color.LightGreen;
                }
                if (t.AVAILABLE == 1)
                {
                    tab.BackColor = Color.IndianRed;
                }
                if (t.AVAILABLE == 2)
                {
                    tab.BackColor = Color.FromArgb(254, 255, 111);
                }

                tab.Paint += new PaintEventHandler((sender, e) =>
                {
                    string n = t.NUMBER + "";
                    using (Font font = new Font("Arial", 20, System.Drawing.FontStyle.Regular, GraphicsUnit.Point))
                    {
                        TextFormatFlags flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.WordBreak;
                        TextRenderer.DrawText(e.Graphics, n, font, tab.ClientRectangle, Color.Black, flags);
                    }

                    Pen p         = new Pen(Color.Black);
                    SolidBrush sb = new SolidBrush(Color.Gray);
                    if (t.STATUS == 0)
                    {
                        sb = new SolidBrush(Color.LawnGreen);
                    }
                    if (t.STATUS == 1)
                    {
                        sb = new SolidBrush(Color.Red);
                    }
                    if (t.STATUS == 2)
                    {
                        sb = new SolidBrush(Color.Yellow);
                    }

                    int x = 3;
                    int y = tab.Size.Height - 17;
                    int r = 11;
                    e.Graphics.DrawEllipse(p, x, y, r, r);
                    e.Graphics.FillEllipse(sb, x, y, r, r);
                });

                foreach (Order o in OrderManager.loadOrders())
                {
                    if (o.ORDERTYPE == 1)
                    {
                        if (o.DONE != true)
                        {
                            if (o.TABLE == t.NUMBER)
                            {
                                tab.Table.ORDER = o;
                            }
                        }
                    }
                }

                fin.Add(tab);
            }

            return(fin);
        }
Пример #5
0
 void OnEnable()
 {
     this.self = (TableUI)target;
 }
 public ChangeItemForm(Session session)
 {
     InitializeComponent();
     ui = new TableUI("001", session);
 }
Пример #7
0
 /// <summary>
 /// Sets the L&F object that renders this component and repaints.
 /// </summary>
 public void setUI(TableUI @ui)
 {
 }