private void menuitem2_Click(object sender, System.EventArgs e)
        {
            //MessageBox.Show(sSelectedID);
            //Ticket oTicket = new Ticket(Global.CurrrentCompany);
            //oTicket.Find(Convert.ToInt32(Grid.ActiveRow.Cells["ID"].Text));

            Ticket oTicket = new Ticket(Global.CurrrentCompany);

            oTicket.OrderID   = Convert.ToInt32(oOrder.ID);
            oTicket.Quantity  = 1;
            oTicket.ProductID = ProductID;
            frmTicket frm = new frmTicket(oTicket);

            frm.ticketProcess       = frmTicket.TicketProcess.OrderEdit;
            frm.gEnvelope.Visible   = false;
            frm.TopMost             = true;
            frm.txtQuantity.Visible = true;
            frm.ShowDialog();
            if (oTicket.ID != 0)
            {
                oTicket.Find(oTicket.ID);
                oOrder.Items[this.ProductID].Tickets.Add(oTicket.ID.ToString(), oTicket);
            }
            LoadTickets();
        }
        private void menuitem1_Click(object sender, System.EventArgs e)
        {
            if (Grid.ActiveRow != null)
            {
                try
                {
                    sSelectedID = Grid.ActiveRow.Cells["ID"].Text;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

                if (Convert.ToInt32(Grid.ActiveRow.Cells["ID"].Text) > 0)
                {
                    //MessageBox.Show(sSelectedID);
                    //Ticket oTicket = new Ticket(Global.CurrrentCompany);
                    //oTicket.Find(Convert.ToInt32(Grid.ActiveRow.Cells["ID"].Text));

                    Ticket    oTicket = oOrder.Items[ProductID].Tickets[Grid.ActiveRow.Cells["ID"].Text];
                    frmTicket frm     = new frmTicket(oTicket);
                    frm.ticketProcess       = frmTicket.TicketProcess.OrderEdit;
                    frm.gEnvelope.Visible   = oTicket.IsBussines;
                    frm.TopMost             = true;
                    frm.txtQuantity.Visible = true;
                    frm.ShowDialog();
                    if (frm.isModified)
                    {
                        oOrder.Items[ProductID].Tickets.Load(oOrder, ProductID);
                    }
                    LoadTickets();
                }
            }
        }
Example #3
0
 public Main()
 {
     InitializeComponent();
     frmFilms             = new FilmList();
     frmSchedule          = new ScheduleList();
     frmRoom              = new frmRoom();
     frmLogin             = new Login();
     frmAreas             = new Areas();
     TicketN              = new frmTicket();
     frmConfirmTicket     = new ConfirmTicket();
     this.TopMost         = true;
     this.FormBorderStyle = FormBorderStyle.Fixed3D;
     this.WindowState     = FormWindowState.Maximized;
 }
Example #4
0
        private void menuitem1_Click(object sender, System.EventArgs e)
        {
            if (Grid.ActiveRow != null)
            {
                sSelectedID = Grid.ActiveRow.Cells["CompanyID"].Text;
                //MessageBox.Show(sSelectedID);
                Ticket oTicket = new Ticket(Global.CurrrentCompany);
                oTicket.Find(Convert.ToInt32(Grid.ActiveRow.Cells["CompanyID"].Text));
                frmTicket frm = new frmTicket(oTicket);

                frm.TopMost = true;
                frm.ShowDialog();
            }
        }
Example #5
0
        /**
         * Click Thanh toan
         */
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            frmConfirmTicket.Visible = false;
            string str  = "";
            string str1 = "";

            //load seat
            strl.ForEach(item =>
            {
                str += item + " ";
            });
            //load idseat


            BillDAO       bill = new BillDAO();
            BillDetailDAO bd   = new BillDetailDAO();

            bill.CreateBill(1, 1, frmConfirmTicket.lblTotal.Text);
            //this.Visible = false;
            int getvalue = bill.getMaxIdBill();

            ticketID.ForEach(item =>
            {
                bd.CreateBillDetail(Convert.ToInt32(item), getvalue);
                str1 += item + " ";
                new TicketDAO().changeStatusTicket(Convert.ToInt32(item));
            });



            //this.Visible = false;

            Console.WriteLine(str);
            Console.WriteLine(str1);
            TicketN                  = new frmTicket(str, str1);
            TicketN.MdiParent        = this;
            TicketN.lblBillId.Text   = getvalue.ToString();
            TicketN.lblCinema.Text   = C_Name;
            TicketN.lblRoom.Text     = Room_Name;
            TicketN.lblSchedule.Text = sche_Name;
            TicketN.lblFName.Text    = F_Name;
            TicketN.Show();
        }
Example #6
0
        private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            #region txtOrderID
            if (sender == txtOrderID)
            {
                if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab")
                {
                    if (txtOrderID.Text.Trim() == "")
                    {
                        txtOrderID.Clear();
                        txtOrderID.Focus();
                        return;
                    }

                    Int32 OrderID;
                    try
                    {
                        OrderID = Convert.ToInt32(txtOrderID.Text);
                    }
                    catch (Exception ex)
                    {
                        Global.ShowNotifier(ex.Message);
                        Global.playSimpleSound(3);
                        txtOrderID.Clear();
                        txtOrderID.Focus();
                        return;
                    }

                    if (oImprinting.Find(OrderID, Global.CurrrentLine))
                    {
                        if (oImprinting.ImprintItems.Count == 0)
                        {
                            Global.ShowNotifier("This order does exist but has no items with this product type: " + Global.CurrrentLine);

                            txtOrderID.Clear();
                            txtOrderID.Focus();
                            return;
                        }

                        if (CompanyID != oImprinting.CompanyID)
                        {
                            Global.ShowNotifier("Different Order's Company/Season");
                            txtOrderID.Clear();
                            txtOrderID.Focus();
                            return;
                        }

                        txtTeacher.Text = oImprinting.Teacher;
                        txtStudent.Text = oImprinting.Student;


                        if (oImprinting.Imprinted)
                        {
                            Global.ShowNotifier("Order already printed");
                            //return;
                        }

                        this.ShowOrder();
                        txtOrderID.Enabled = false;
                        //txtBoxes.Enabled = false;
                        txtProductID.BackColor = Color.White;
                        txtProductID.Focus();
                        return;
                    }
                    else
                    {
                        MessageBox.Show("Order not found...");
                        txtOrderID.Clear();
                        txtOrderID.Focus();
                        return;
                    }
                }
            }
            #endregion
            #region txtProductID
            if (sender == txtProductID)
            {
                if (e.KeyCode.ToString() == "F8")
                {
                    this.Grid.Focus();
                }

                if (e.KeyCode.ToString() == "F2")
                {
                    if (oImprinting.oProduct.View())
                    {
                        this.txtProductID.Text = oImprinting.oProduct.ID;
                        return;
                    }
                }

                if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab)
                {
                    txtDescription.Clear();
                    if (txtProductID.Text.ToUpper() == "DONE")
                    {
                        if (!oImprinting.IfDone())
                        {
                            Global.playSimpleSound(1);
                            txtDescription.Text = "You have products left";
                            Global.ShowNotifier(txtDescription.Text);
                            ActiveLeft();
                            txtProductID.Clear();
                            txtProductID.Focus();
                            return;
                        }

                        oImprinting.UpdateImprinted(true, Global.CurrrentLine);



                        Clear();
                        txtOrderID.Enabled = true;
                        txtOrderID.Focus();
                        return;
                    }

                    if (txtProductID.Text.ToUpper() == "ABORT")
                    {
                        Clear();
                        groupBox2.Focus();
                        txtOrderID.Enabled = true;
                        txtOrderID.Focus();
                        return;
                    }


                    Imprinting.ImprintItem oItem = oImprinting.GetItem(txtProductID.Text);
                    if (oItem == null)
                    {
                        oItem = oImprinting.GetItemTicket(txtProductID.Text);
                    }


                    if (oItem == null)
                    {
                        Global.playSimpleSound(2);
                        txtDescription.Text = "TICKET OR PRODUCT NOT IN ORDER";
                        Global.ShowNotifier(txtDescription.Text);
                        this.txtProductID.Clear();
                        this.txtProductID.Focus();
                        return;
                    }

                    txtProductID.Text = oItem.TicketID.ToString();
                    if (oItem.Printed)
                    {
                        Global.playSimpleSound(2);
                        txtDescription.Text = "TICKET ALREADY PRINTED";
                        Global.ShowNotifier(txtDescription.Text);

                        /*if (MessageBox.Show("Do you want reprint this Ticket?", "Re-print", MessageBoxButtons.YesNo, MessageBoxIcon.Warning,MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                         * {
                         *  oTicket.Find(Convert.ToInt32(txtProductID.Text));
                         *  frmTicket frm = new frmTicket(oTicket);
                         *  frm.Show();
                         *  if (!frm.Print())
                         *  {
                         *      Global.ShowNotifier("No Printed");
                         *      frm.Dispose();
                         *      return;
                         *  }
                         *  frm.Dispose();
                         *  oImprinting.ImprintItems[txtProductID.Text].Printed = true;
                         * }
                         * else*/
                        {
                            this.txtProductID.Clear();
                            this.txtProductID.Focus();
                            return;
                        }
                    }
                    else
                    {
                        oTicket.Find(Convert.ToInt32(txtProductID.Text));
                        frmTicket frm = new frmTicket(oTicket);
                        frm.Show();
                        if (!frm.Print())
                        {
                            Global.ShowNotifier("No Printed");
                            frm.Dispose();
                            return;
                        }
                        frm.Dispose();
                        oImprinting.ImprintItems[txtProductID.Text].Printed = true;
                    }


                    if (oImprinting.ImprintItems.Contains(txtProductID.Text))
                    {
                        this.txtDescription.Text = oImprinting.ImprintItems[txtProductID.Text].Description;
                        if (oImprinting.ImprintItems[txtProductID.Text].Printed)
                        {
                            this.ActiveRow(true);
                        }
                        else
                        {
                            this.ActiveRow(false);
                        }

                        // Grid.DataBind();

                        this.txtProductID.Clear();
                        return;
                    }
                }
            }
            #endregion

            #region txtGrid
            if (sender == this.Grid)
            {
                //MessageBox.Show(e.KeyData.ToString());
                if (Char.IsDigit(Convert.ToChar(e.KeyValue)))
                {
                    txtProductID.Focus();
                    txtProductID.Text += Convert.ToChar(e.KeyValue).ToString();
                    SendKeys.Send("{END}");
                    return;
                }

                if (e.KeyCode.ToString() == "F8")
                {
                    this.txtProductID.Focus();
                    return;
                }
                if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down || e.KeyCode == Keys.PageDown)
                {
                    //return;
                }
            }

            #endregion
            #region Default Option
            //Default option
            switch (e.KeyCode)
            {
            case Keys.Tab:
                if (!e.Shift)
                {
                    this.SelectNextControl(this.ActiveControl, true, true, true, true);
                }
                break;

            case Keys.Enter:
                this.SelectNextControl(this.ActiveControl, true, true, true, true);
                break;

            case Keys.Down:
                this.SelectNextControl(this.ActiveControl, true, true, true, true);
                break;

            case Keys.Up:
                this.SelectNextControl(this.ActiveControl, false, true, true, true);
                break;

            case Keys.F8:
                this.Grid.Focus();
                break;

            case Keys.F3:
                break;

            case Keys.PageDown:

                break;


                //case Keys.<some key>:
                // ......;
                // break;
            }
            #endregion
        }
Example #7
0
        private void btnTicket_Click(object sender, EventArgs e)
        {
            frmTicket objTicket = new frmTicket();

            objTicket.Show();
        }