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 FrmPOKAYOKEMatching : Form
    {
        public static FrmPOKAYOKEMatching _Form_POKAYOKEMatchingInstance;
        public String AppPath = "";

        public FrmPOKAYOKEMatching()
        {
            InitializeComponent();

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

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

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

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

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

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

        }

        private void FrmPOKAYOKEMatching_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_POKAYOKEMatchingInstance = 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)
        {
            FrmOutboundMenu._Form_OutboundMenuInstance.Show();
            //Bt.ScanLib.Control.btScanDisable();
            //this.Hide();
            this.Close();
        }

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

        private void FrmPOKAYOKEMatching_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 btnMenu_Click(object sender, EventArgs e)
        {
            //FrmOutboundMenu._Form_OutboundMenuInstance.Show();
            FrmMainMenu._Form_MainMenuInstance.Show();
            //Bt.ScanLib.Control.btScanDisable();
            //this.Hide();
            this.Close();
        }

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

        private void button5_Click(object sender, EventArgs e)
        {

        }

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