using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HT_SKT_Stock
{
    public partial class FrmOutboundMenu : Form
    {
        public static FrmOutboundMenu _Form_OutboundMenuInstance;
        public String AppPath = "";


        public FrmOutboundMenu()
        {
            InitializeComponent();

            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmOutboundMenu_KeyDown);

            btnBack.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmOutboundMenu_KeyDown);

            btnMenu.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmOutboundMenu_KeyDown);

            btnStoreOutbound.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmOutboundMenu_KeyDown);

            btnReOutbound.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmOutboundMenu_KeyDown);

            btnProductionOutbound.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmOutboundMenu_KeyDown);

            btnKanbanTransfer.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmOutboundMenu_KeyDown);

            btnPOKAYOKEMatching.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmOutboundMenu_KeyDown);

        }

        private void FrmOutboundMenu_Load(object sender, EventArgs e)
        {
            if (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width == 240)
            {
                resolution.ScreenSize.VGAtoQVGA(this);
            }

            this.MaximizeBox = !this.MaximizeBox;
            this.MinimizeBox = !this.MinimizeBox;

            _Form_OutboundMenuInstance = this;


            String path = this.GetType().Assembly.GetModules()[0].FullyQualifiedName;
            Int32 en = path.LastIndexOf("\\");
            AppPath = path.Substring(0, en);

            lblUser.Text = "User : " + FrmLogin._Form_LoginInstance.userName;

        }

        private void btnBack_Click(object sender, EventArgs e)
        {
            FrmMainMenu._Form_MainMenuInstance.Show();
            //Bt.ScanLib.Control.btScanDisable();
            //this.Hide();
            this.Close();
        }

        private void btnMenu_Click(object sender, EventArgs e)
        {
            FrmMainMenu._Form_MainMenuInstance.Show();
            //Bt.ScanLib.Control.btScanDisable();
            //this.Hide();
            this.Close();
        }

        private void FrmOutboundMenu_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode.ToString())
            {

                case "F1":
                    btnBack_Click(sender, e);
                    break;

                case "F4":
                    btnMenu_Click(sender, e);
                    break;
            }
        }

        private void btnBack_KeyDown(object sender, KeyEventArgs e)
        {
            
        }

        private void btnBack_LostFocus(object sender, EventArgs e)
        {
        }

        private void btnStoreOutbound_Click(object sender, EventArgs e)
        {
            Form frmE = new FrmStoreOutbound();
            frmE.Show();
            this.Hide();
        }

        private void btnReOutbound_Click(object sender, EventArgs e)
        {
            Form frmE = new FrmReOutbound();
            frmE.Show();
            this.Hide();
        }

        private void btnProductionOutbound_Click(object sender, EventArgs e)
        {
            Form frmE = new FrmProductionOutbound();
            frmE.Show();
            this.Hide();
        }

        private void btnKanbanTransfer_Click(object sender, EventArgs e)
        {
            Form frmE = new FrmKanbanTransfer();
            frmE.Show();
            this.Hide();
        }

        private void btnPOKAYOKEMatching_Click(object sender, EventArgs e)
        {
            Form frmE = new FrmPOKAYOKEMatching();
            frmE.Show();
            this.Hide();
        }
    }
}