Beispiel #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string   name = txtAcc.Text;
            string   pass = txtPass.Text;
            Employee myEm = null;

            foreach (Employee u in myEmployeeList)
            {
                if (u.IdString == name && u.Password == pass)
                {
                    myEm = new Employee(u);
                    break;
                }
            }
            if (myEm == null)
            {
                MessageBox.Show("Tài khoản hoặc mật khẩu không đúng");
                return;
            }

            if (myEm.Status == false)
            {
                MessageBox.Show("Nhân viên này đã không còn làm việc");
                return;
            }

            this.Hide();
            switch (myEm.Permission)
            {
            case ADMIN:
                fAdmin           = new frmAdmin();
                fAdmin.CurEmploy = myEm;
                if (fAdmin.ShowDialog() == DialogResult.Cancel)
                {
                    frmLogin_Load(null, null);
                }
                break;

            case SALE:
                fSale             = new frmSale();
                fSale.CurEmployee = myEm;
                if (fSale.ShowDialog() == DialogResult.Cancel)
                {
                    frmLogin_Load(null, null);
                }
                break;

            case WARE:
                fGood             = new frmGood();
                fGood.CurEmployee = myEm;
                if (fGood.ShowDialog() == DialogResult.Cancel)
                {
                    frmLogin_Load(null, null);
                }
                break;
            }
        }
        private void saleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var frm = new frmSale();

            frm.MdiParent   = this;
            frm.WindowState = FormWindowState.Maximized;

            frm.Show();
        }
Beispiel #3
0
 private void salesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (sale.IsDisposed)
     {
         sale = new frmSale();
     }
     sale.MdiParent = this;
     sale.Show();
     sale.BringToFront();
 }
Beispiel #4
0
        private void llbSale_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmSale fSale = new frmSale();

            fSale.CurEmployee = CurEmploy;
            if (fSale.ShowDialog() == DialogResult.Cancel)
            {
                this.frmAdmin_Load(null, null);
            }
        }
 private void importยอดขายToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //if (_cBeauty._LoginCompleted && !_menulist.Contains(importยอดขายToolStripMenuItem.Text) && _cBeauty._DPCODE_LOG_Main == "IT")
     if (_cBeauty._LoginCompleted && !_menulist.Contains(importยอดขายToolStripMenuItem.Text))
     {
         frmSale frm = new frmSale(_cBeauty, ref _menulist);
         frm.Text = importยอดขายToolStripMenuItem.Text;
         tabControl1.TabPages.Add(frm);
         _menulist.Add(importยอดขายToolStripMenuItem.Text);
     }
 }
        private void SaleButton_Click_1(object sender, EventArgs e)
        {
            panel.Controls.Clear();
            frmSale frm = new frmSale();

            frm.FormBorderStyle = FormBorderStyle.None;
            frm.TopLevel        = false;
            frm.AutoScroll      = true;
            frm.Dock            = DockStyle.Fill;
            panel.Controls.Add(frm);
            frm.Show();
        }