예제 #1
0
        private void Shopmain_Load(object sender, EventArgs e)
        {
            if (!DBConnString.clsDB.IsConnected()) return;
            string strConn;
            strConn = DBConnString.strConn;
            Conn = new SqlConnection();
            if (Conn.State == ConnectionState.Open)
            {
                Conn.Close();
            }
            Conn.ConnectionString = strConn;
            Conn.Open();

            this.KeyPreview = true;
            this.Text = DBConnString.sCatalog;
            DialogResult dlg = MessageBox.Show(" คุณกำลังใช้งานของ" + DBConnString.sCatalog, "คุณแน่ใจว่าคุณเข้าใช้งานถูกต้อง", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dlg == DialogResult.OK)
            {
                Login login = new Login();

                login.ShowDialog();
                //lblUser.Text = clsCash.sUserLogin;
                //tssUser.Text = clsCash.sUserLogin;

                if (clsCash.sUserLoginStatus == 1)
                {
                    this.Close();
                }
                else
                {
                    this.Activate();
                    Program.frmSelectdb.Visible = false;

                    String txtOnlineUser = clsCash.sUserLogin + " (" + DBConnString.sCode + ")";

                    if (DBConnString.sCode == "7CSK")
                    {
                        BackgroundImage = Properties.Resources.PaleTurquoise;
                        txtOnlineUser = clsCash.sUserLogin + " (เซ่เวนซีสงขลา)";
                    }
                    if (DBConnString.sCode == "SHOP")
                    {
                        BackgroundImage = Properties.Resources.Bisque;
                        //DisableMenu();
                        txtOnlineUser = clsCash.sUserLogin + " (ร้านคูไต้เจี่ย)";
                    }
                    if (DBConnString.sCode == "KTC")
                    {
                        BackgroundImage = Properties.Resources.PaleGreen;
                        //DisableMenu();
                        txtOnlineUser = clsCash.sUserLogin + " (เคทีซี)";
                    }

                    GetdiffTime();
                    timer1.Enabled = true;
                }
            }
            else
            {
                this.Close();
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: itktc/projectktc-v2
        private void tsChangeUser_Click(object sender, EventArgs e)
        {
            Login login = new Login();

                  login.ShowDialog();
                  lblUser.Text = clsCash.sUserLogin;
                  tssUser.Text = clsCash.sUserLogin;
        }
예제 #3
0
파일: Main.cs 프로젝트: itktc/projectktc-v2
        private void Main_Load(object sender, EventArgs e)
        {
            //frmSelectDb start = new frmSelectDb();
            //start.Close();
            //test

            this.KeyPreview = true;
            this.Text = DBConnString.sCatalog;
            DialogResult dlg = MessageBox.Show(" คุณกำลังใช้งานของ" + DBConnString.sCatalog, "คุณแน่ใจว่าคุณเข้าใช้งานถูกต้อง", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dlg == DialogResult.OK)
            {
                Login login = new Login();

                login.ShowDialog();
                lblUser.Text = clsCash.sUserLogin;
                tssUser.Text = clsCash.sUserLogin;

                if (clsCash.sUserLoginStatus == 1)
                {

                    this.Close();
                }
                else
                {
                    this.Activate();

                }
            }
            else
            {

                this.Close();
            }
        }
예제 #4
0
        private void Main_Load(object sender, EventArgs e)
        {
            if (!DBConnString.clsDB.IsConnected()) return;
            string strConn;
            strConn = DBConnString.strConn;
            Conn = new SqlConnection();
            if (Conn.State == ConnectionState.Open)
            {
                Conn.Close();
            }
            Conn.ConnectionString = strConn;
            Conn.Open();

            this.KeyPreview = true;
            this.Text = DBConnString.sCatalog;
            DialogResult dlg = MessageBox.Show(" คุณกำลังใช้งานของ" + DBConnString.sCatalog, "คุณแน่ใจว่าคุณเข้าใช้งานถูกต้อง", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dlg == DialogResult.OK)
            {
                Login login = new Login();

                login.ShowDialog();
                lblUser.Text = clsCash.sUserLogin;
                tssUser.Text = clsCash.sUserLogin;

                if (clsCash.sUserLoginStatus == 1)
                {
                    this.Close();
                }
                else
                {
                    this.Activate();

                    Program.frmSelectdb.Visible = false;
                    //System.Diagnostics.Process.Start(Application.StartupPath + "\\KTCERP.exe");

                    String txtOnlineUser = clsCash.sUserLogin + " (" + DBConnString.sCode + ")";

                    //เงื่อนไข  เพื่อให้เพิ่ม ลบ แก้ไข้อมูล ประเภทการเบิกเพื่อผลิตได้เฉพาะ KTC เท่านั้น(Iyayben)
                    if (DBConnString.sCatalog.Trim() == "ระบบบริษัท KTC Netting")
                    {
                        menuDrawToProduce.Enabled = true;
                    }
                    else
                    {
                        menuDrawToProduce.Enabled = false;
                    }
                    if (DBConnString.sCode == "7CSK")
                    {
                        BackgroundImage = Properties.Resources.PaleTurquoise;
                        txtOnlineUser = clsCash.sUserLogin + " (เซ่เวนซีสงขลา)";
                        จดการโอนรานคไตเจยToolStripMenuItem.Visible = false;
                        จดการโอนToolStripMenuItem1.Visible = false;
                    }
                    if (DBConnString.sCode == "SHOP")
                    {
                        BackgroundImage = Properties.Resources.Bisque;
                        DisableMenu();
                        txtOnlineUser = clsCash.sUserLogin + " (ร้านคูไต้เจี่ย)";
                        จดการเบกโอนToolStripMenuItem.Visible = false;
                        จดการโอนToolStripMenuItem.Visible = false;
                    }
                    if (DBConnString.sCode == "KTC")
                    {
                        BackgroundImage = Properties.Resources.PaleGreen;
                        DisableMenu();
                        txtOnlineUser = clsCash.sUserLogin + " (เคทีซี)";
                    }

                    GetdiffTime();
                    timer1.Enabled = true;
                }

            }
            else
            {
                this.Close();
            }
        }