Exemplo n.º 1
0
        public void BindOrder(OrderDateModel OrderMain)
        {
            try
            {
                detailScreen();
                if (OrderMain.ListSeatOfOrder.Count > 0)
                {
                    OrderMain.IsLoadFromData = true;

                    Boolean addSet;
                    foreach (SeatModel seat in OrderMain.ListSeatOfOrder)
                    {
                        addSet = true;
                        if (OrderMain.ListOrderDetail.Count > 0)
                        {
                            for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                            {
                                if (OrderMain.ListOrderDetail[i].Seat == seat.Seat)
                                {
                                    if (addSet)
                                    {
                                        UCSeat ucSeat = new UCSeat();
                                        ucSeat.lblSeat.Text = "Seat " + seat.Seat.ToString();
                                        ucSeat.Tag = seat.Seat;

                                        flowLayoutPanel1.Controls.Add(ucSeat);
                                        indexControl = flowLayoutPanel1.Controls.Count;
                                        addSet = false;
                                    }
                                    addOrder(OrderMain.ListOrderDetail[i]);
                                    indexControl++;
                                    for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                                    {
                                        UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                        uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];

                                        addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                        indexControl++;
                                    }
                                }
                                else
                                {
                                    if (OrderMain.ListOrderDetail[i].Seat == 0)
                                    {
                                        addOrder(OrderMain.ListOrderDetail[i]);
                                        indexControl++;
                                        for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                                        {
                                            UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                            uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];

                                            addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                            indexControl++;
                                        }
                                    }
                                }

                            }
                        }

                    }
                }
                else
                {
                    if (OrderMain.ListOrderDetail.Count > 0)
                    {
                        OrderMain.IsLoadFromData = true;

                        for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                        {
                            addOrder(OrderMain.ListOrderDetail[i]);

                            for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                            {
                                UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];

                                addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);

                            }
                        }
                    }

                }
                this.lblSubtotal.Text = money.Format2(OrderMain.SubTotal());
                this.lblTax.Text = "N/A";
                this.lblTotal.Text = money.Format2(OrderMain.SubTotal());
            }
            catch (Exception ex)
            {
                SystemLog.LogPOS.WriteLog("POS::frmCustomerDisplay:::::::::::::::::::" + ex.Message);
            }
        }
Exemplo n.º 2
0
        private void btnAddSeat_Click(object sender, EventArgs e)
        {
            try
            {
                frmAddSeat frm = new frmAddSeat();

                if (frmOpacity.ShowDialog(this, frm) == System.Windows.Forms.DialogResult.OK)
                {

                    seat = frm.NumberSeat;
                    if (isChekSeat(seat))
                    {
                        frmMessager frmseat = new frmMessager("AddSeat", "Seat Exists");
                        frmOpacity.ShowDialog(this, frmseat);
                    }
                    else
                    {
                        SeatModel seatAdd = new SeatModel();
                        seatAdd.Seat = seat;

                        lstSeat.Add(seatAdd);
                        OrderMain.ListSeatOfOrder.Add(seatAdd);
                        UCSeat ucSeat = new UCSeat();
                        ucSeat.lblSeat.Text = "Seat " + seat;
                        ucSeat.Click += ucSeat_Click;
                        lblSeat.Text = seat.ToString();
                        flpOrder.Controls.Add(ucSeat);
                        flagUcSeatClick = 0;
                        ClearBackColorSeat();
                    }
                    //OrderMain.addSeat(seat);

                }
            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("btnAddSeat_Click::::::::::::::::::::::::::::::::" + ex.Message);
            }
        }
Exemplo n.º 3
0
        public void LoadOrder(string TableID, int orderID,FlowLayoutPanel flp)
        {
            int indexControl = 1;
            try
            {

                OrderMain = OrderService.GetOrderByTable(TableID, 0);

                if (OrderMain.ListSeatOfOrder.Count>0)
                {
                    OrderMain.IsLoadFromData = true;
                    //lblSeat.Text = OrderMain.Seat.ToString();
                    foreach (SeatModel seat in OrderMain.ListSeatOfOrder)
                    {
                        UCSeat ucSeat = new UCSeat();
                        ucSeat.lblSeat.Text = "Seat " + seat.Seat.ToString();
                       // ucSeat.Click += ucSeat_Click;
                        flpOldTable.Controls.Add(ucSeat);
                        indexControl = flpOldTable.Controls.Count;
                        if (OrderMain.ListOrderDetail.Count > 0)
                        {
                            for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                            {
                                if (OrderMain.ListOrderDetail[i].Seat == seat.Seat)
                                {
                                    addOrder(OrderMain.ListOrderDetail[i],flp);
                                    indexControl++;
                                    for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                                    {
                                        UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                        uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];
                                        //uc.Click += ucItemModifierOfMenu_Click;
                                        addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j],flp);
                                        indexControl++;
                                    }
                                }
                            }
                        }
                        else
                        {
                            OrderMain.FloorID = TableID;
                            int OrderID = OrderService.CountOrder() + 1;
                            OrderMain.OrderID = OrderID;
                        }
                    }
                }
                else
                {
                    if (OrderMain.ListOrderDetail.Count > 0)
                    {
                        OrderMain.IsLoadFromData = true;
                        for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                        {
                            addOrder(OrderMain.ListOrderDetail[i],flp);
                            indexControl++;
                            for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                            {
                                UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];
                                //uc.Click += ucItemModifierOfMenu_Click;
                                addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j],flp);
                                indexControl++;
                            }
                        }
                    }
                    else
                    {
                        OrderMain.FloorID = TableID;
                        int OrderID = OrderService.CountOrder() + 1;
                        OrderMain.OrderID = OrderID;
                    }
                }

            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("frmTranferTable:::::::::::::::::::LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message);
            }
        }
Exemplo n.º 4
0
        public void LoadOrderTKA(string TableID, int ClientID)
        {
            indexControl = 1;
            try
            {
                OrderMain = new OrderDateModel();
                OrderMain = OrderService.GetOrderByTKA(TableID, "");
                OrderMain.isTKA = 1;
                lblSubtotal.Text = money.Format2(Convert.ToDouble(OrderMain.TotalAmount));
                if (OrderMain.Seat > 0)
                {
                    OrderMain.IsLoadFromData = true;
                    lblSeat.Text = OrderMain.Seat.ToString();
                    for (int seat = 1; seat <= OrderMain.Seat; seat++)
                    {
                        UCSeat ucSeat = new UCSeat();
                        ucSeat.lblSeat.Text = "Seat " + seat.ToString();
                        ucSeat.Click += ucSeat_Click;
                        flpOrder.Controls.Add(ucSeat);
                        indexControl = flpOrder.Controls.Count;
                        if (OrderMain.ListOrderDetail.Count > 0)
                        {
                            for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                            {
                                if (OrderMain.ListOrderDetail[i].Seat == seat)
                                {
                                    addOrder(OrderMain.ListOrderDetail[i]);
                                    indexControl++;
                                    for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                                    {
                                        UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                        uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];
                                        uc.Click += ucItemModifierOfMenu_Click;
                                        addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                        indexControl++;
                                    }
                                }
                            }
                        }
                        else
                        {
                            OrderMain.FloorID = TableID + "" + (OrderService.CountOrder() + 1);
                            if (ClientID > 0)
                                OrderMain.ClientID = ClientID;
                            else
                                OrderMain.ClientID = 0;
                            OrderMain.ShiftID = UserLoginModel.ShiffID;
                            OrderMain.CreateBy = UserLoginModel.UserLoginInfo.StaffID;
                            OrderMain.UpdateBy = UserLoginModel.UserLoginInfo.StaffID;
                            int OrderID = OrderService.CountOrder() + 1;
                            OrderMain.OrderID = OrderID;
                        }
                    }
                }
                else
                {
                    if (OrderMain.ListOrderDetail.Count > 0)
                    {
                        OrderMain.IsLoadFromData = true;
                        for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                        {
                            addOrder(OrderMain.ListOrderDetail[i]);
                            indexControl++;
                            for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                            {
                                UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];
                                uc.Click += ucItemModifierOfMenu_Click;
                                addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                indexControl++;
                            }
                        }
                    }
                    else
                    {
                        OrderMain.FloorID = TableID + "" + (OrderService.CountOrder() + 1);
                        OrderMain.ClientID = ClientID;
                        OrderMain.ShiftID = UserLoginModel.ShiffID;
                        OrderMain.CreateBy = UserLoginModel.UserLoginInfo.StaffID;
                        OrderMain.UpdateBy = UserLoginModel.UserLoginInfo.StaffID;
                        int OrderID = OrderService.CountOrder() + 1;
                        OrderMain.OrderID = OrderID;
                    }
                }

            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message);
            }
        }
Exemplo n.º 5
0
        public void LoadOrderPrev(int orderID)
        {
            indexControl = 1;
            try
            {
                OrderMain = new OrderDateModel();
                OrderMain = OrderService.GetListOrderPrevOrder("", orderID, DateTime.Now.Date);
                lblSubtotal.Text = money.Format2(Convert.ToDouble(OrderMain.TotalAmount));
                if (OrderMain.Seat > 0)
                {
                    OrderMain.IsLoadFromData = true;
                    lblSeat.Text = OrderMain.Seat.ToString();
                    lblStatus.Text = "OLD";
                    for (int seat = 1; seat <= OrderMain.Seat; seat++)
                    {
                        UCSeat ucSeat = new UCSeat();
                        ucSeat.lblSeat.Text = "Seat " + seat.ToString();
                        ucSeat.Click += ucSeat_Click;
                        flpOrder.Controls.Add(ucSeat);
                        indexControl = flpOrder.Controls.Count;
                        if (OrderMain.ListOrderDetail.Count > 0)
                        {
                            for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                            {
                                if (OrderMain.ListOrderDetail[i].Seat == seat)
                                {
                                    addOrder(OrderMain.ListOrderDetail[i]);
                                    indexControl++;
                                    for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                                    {
                                        UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                        uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];
                                        uc.Click += ucItemModifierOfMenu_Click;
                                        addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                        indexControl++;
                                    }
                                }
                            }
                        }

                    }
                }
                else
                {
                    if (OrderMain.ListOrderDetail.Count > 0)
                    {
                        OrderMain.IsLoadFromData = true;
                        lblStatus.Text = "OLD";
                        for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                        {
                            addOrder(OrderMain.ListOrderDetail[i]);
                            indexControl++;
                            for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                            {
                                UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];
                                uc.Click += ucItemModifierOfMenu_Click;
                                addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                indexControl++;
                            }
                        }
                    }

                }

            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message);
            }
        }
Exemplo n.º 6
0
        public void LoadOrder(string TableID, int orderID)
        {
            indexControl = 1;
            try
            {
                OrderMain = new OrderDateModel();
                OrderMain = OrderService.GetOrderByTable(TableID, 0);
                OrderMain.ListOrderDetail = OrderMain.ListOrderDetail.OrderBy(x => x.OrderDetailID).ToList();
                if (OrderMain.TotalAmount > 0)
                {
                    lblSubtotal.Text = money.Format2(Convert.ToDouble(OrderMain.TotalAmount));
                }
                else
                {
                    lblSubtotal.Text = "0.0";
                }
                if (OrderMain.ListSeatOfOrder.Count > 0)
                {
                    OrderMain.IsLoadFromData = true;
                    lblSeat.Text = OrderMain.Seat.ToString();
                    lblStatus.Text = "OLD";
                    Boolean addSet;
                    foreach (SeatModel seat in OrderMain.ListSeatOfOrder)
                    {
                        addSet = true;
                        if (OrderMain.ListOrderDetail.Count > 0)
                        {
                            for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                            {
                                if (OrderMain.ListOrderDetail[i].Seat == seat.Seat)
                                {
                                    if (addSet)
                                    {
                                        UCSeat ucSeat = new UCSeat();
                                        ucSeat.lblSeat.Text = "Seat " + seat.Seat.ToString();
                                        ucSeat.Tag = seat.Seat;
                                        ucSeat.Click += ucSeat_Click;
                                        flpOrder.Controls.Add(ucSeat);
                                        indexControl = flpOrder.Controls.Count;
                                        addSet = false;
                                    }
                                    addOrder(OrderMain.ListOrderDetail[i]);
                                    indexControl++;
                                    for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                                    {
                                        UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                        uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];
                                        uc.Click += ucItemModifierOfMenu_Click;
                                        addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                        indexControl++;
                                    }
                                }
                                else
                                {
                                    if (OrderMain.ListOrderDetail[i].Seat == 0)
                                    {
                                        addOrder(OrderMain.ListOrderDetail[i]);
                                        indexControl++;
                                        for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                                        {
                                            UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                            uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];
                                            uc.Click += ucItemModifierOfMenu_Click;
                                            addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                            indexControl++;
                                        }
                                    }
                                }

                            }
                        }
                        else
                        {
                            OrderMain.FloorID = TableID;
                            OrderMain.ShiftID = UserLoginModel.ShiffID;
                            OrderMain.CreateBy = UserLoginModel.UserLoginInfo.StaffID;
                            OrderMain.UpdateBy = UserLoginModel.UserLoginInfo.StaffID;
                            int OrderID = OrderService.CountOrder() + 1;
                            OrderMain.OrderID = OrderID;
                            lblStatus.Text = "NEW";
                        }
                    }
                }
                else
                {
                    if (OrderMain.ListOrderDetail.Count > 0)
                    {
                        OrderMain.IsLoadFromData = true;
                        lblStatus.Text = "OLD";
                        for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                        {
                            addOrder(OrderMain.ListOrderDetail[i]);
                            indexControl++;
                            for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                            {
                                UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];
                                uc.Click += ucItemModifierOfMenu_Click;
                                addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                indexControl++;
                            }
                        }
                    }
                    else
                    {
                        OrderMain.FloorID = TableID;
                        OrderMain.ShiftID = UserLoginModel.ShiffID;
                        OrderMain.CreateBy = UserLoginModel.UserLoginInfo.StaffID;
                        OrderMain.UpdateBy = UserLoginModel.UserLoginInfo.StaffID;
                        int OrderID = OrderService.CountOrder() + 1;
                        OrderMain.OrderID = OrderID;
                        lblStatus.Text = "NEW";
                    }
                }
            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("frmOrder:::::::::::::::::::::::LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message);
            }
        }
Exemplo n.º 7
0
        public void LoadOrderTKA(string TableID, string ClientID)
        {
            indexControl = 1;
            flpTKAItem.Controls.Clear();
            try
            {
                OrderMain = new OrderDateModel();
                OrderMain = OrderService.GetOrderByTKA(TableID, "");
                OrderMain.isTKA = 1;
                lblSubTotal.Text = money.Format2(Convert.ToDouble(OrderMain.TotalAmount));
                if (OrderMain.Seat > 0)
                {
                    OrderMain.IsLoadFromData = true;
                    //lblSeat.Text = OrderMain.Seat.ToString();
                    for (int seat = 1; seat <= OrderMain.Seat; seat++)
                    {
                        UCSeat ucSeat = new UCSeat();
                        ucSeat.lblSeat.Text = "Seat " + seat.ToString();

                        if (OrderMain.ListOrderDetail.Count > 0)
                        {
                            for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                            {
                                if (OrderMain.ListOrderDetail[i].Seat == seat)
                                {
                                    addOrder(OrderMain.ListOrderDetail[i]);
                                    indexControl++;
                                    for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                                    {
                                        UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                        uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];

                                        addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                        indexControl++;
                                    }
                                }
                            }
                        }
                        else
                        {
                            OrderMain.FloorID = TableID + "" + (OrderService.CountOrder() + 1);

                            int OrderID = OrderService.CountOrder() + 1;
                            OrderMain.OrderID = OrderID;
                        }
                    }
                }
                else
                {
                    if (OrderMain.ListOrderDetail.Count > 0)
                    {
                        OrderMain.IsLoadFromData = true;
                        for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++)
                        {
                            addOrder(OrderMain.ListOrderDetail[i]);
                            indexControl++;
                            for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++)
                            {
                                UCItemModifierOfMenu uc = new UCItemModifierOfMenu();
                                uc.Tag = OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j];

                                addModifreToOrder(uc, OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j]);
                                indexControl++;
                            }
                        }
                    }
                    else
                    {
                        OrderMain.FloorID = TableID + "" + (OrderService.CountOrder() + 1);
                        int OrderID = OrderService.CountOrder() + 1;
                        OrderMain.OrderID = OrderID;
                    }
                }

            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("LoadOrder:::::::::::::::::::::::::::::::::" + ex.Message);
            }
        }
Exemplo n.º 8
0
 private void btnAddSeat_Click(object sender, EventArgs e)
 {
     frmAddSeat frm = new frmAddSeat();
     if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         Seat = frm.NumberSeat;
         SeatModel seatAdd = new SeatModel();
         seatAdd.Seat = Seat;
         lstSeat.Add(seatAdd);
         OrderSlpitNew.ListSeatOfOrder = lstSeat;
         UCSeat ucSeat = new UCSeat();
         ucSeat.lblSeat.Text = "Seat " + Seat;
         //ucSeat.Click += ucSeat_Click;
         lblSeat.Text = Seat.ToString();
         flpNewTable.Controls.Add(ucSeat);
     }
 }