Пример #1
0
        private void mdiReceiving_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'npos_dbDataSet.po_order' table. You can move, or remove it, as needed.
            this.po_orderTableAdapter.FillByPending(this.npos_dbDataSet.po_order, Convert.ToDateTime(dateTimePicker1.Text));
            String userName = frmLogin.User.user_name;

            login.catchUsername(userName);
            if (login.hasUser_Accounts())
            {
                btnR.Visible = true;
            }
        }
Пример #2
0
        private void mdiFrmInv_Load(object sender, EventArgs e)
        {
            login = new DAO.LoginDAO();
            String userName = frmLogin.User.user_name;

            login.catchUsername(userName);
            if (login.hasReports())
            {
                tsReporting.Enabled = true;
            }
            tsUser.Text = userName.ToString();
            timer1.Start();
        }
Пример #3
0
        private void frmDlgRefund_Load(object sender, EventArgs e)
        {
            terminalSelect = fl.tN;
            login          = new DAO.LoginDAO();
            String userName = frmLogin.User.user_name;

            login.catchUsername(userName);
            rdVAT.Text = TaxDisplay;
            if (login.hasUser_Accounts())
            {
                lbl1.Visible       = true;
                cBTerminal.Visible = true;
            }
        }
Пример #4
0
        private void onFormClose()
        {
            MySqlConnection con = new MySqlConnection();

            login = new DAO.LoginDAO();
            String userName = frmLogin.User.user_name;

            login.catchUsername(userName);
            frmMenu fm = new frmMenu();

            if (login.hasSales())
            {
                fm.unlockSales();
            }
            if (login.hasOrder())
            {
                fm.unlockOrder();
            }
            if (login.hasCustomers())
            {
                fm.unlockCustomers();
            }
            if (login.hasInventory())
            {
                fm.unlockInventory();
            }
            if (login.hasReports())
            {
                fm.unlockGeneralReports();
            }
            if (login.hasGC())
            {
                fm.unlockGiftCards();
            }
            if (login.hasUser_Accounts())
            {
                fm.unlockUserAccounts();
            }
            if (login.hasUserConf())
            {
                fm.unlockConfig();
            }
            con.Close();
            fm.Show();
            this.Hide();
        }
Пример #5
0
        private void checkRes()
        {
            login = new DAO.LoginDAO();
            String userName = frmLogin.User.user_name;

            login.catchUsername(userName);
            if (login.hasUser_Accounts())
            {
                lblX.Visible          = true;
                cBTerminalX.Visible   = true;
                lblZ.Visible          = true;
                cBTerminalZ.Visible   = true;
                lblSR.Visible         = true;
                cBTerminalSR.Visible  = true;
                lblSDR.Visible        = true;
                cBTerminalSDR.Visible = true;
                lblCDR.Visible        = true;
                cBTerminalCDR.Visible = true;
                lblCC.Visible         = true;
                cBCC.Visible          = true;
            }
        }
Пример #6
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            txtBoxQty.Text            = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
            eancom                    = dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
            txtBonxEAN.Text           = dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
            txtBoxRPrice.Text         = Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[4].Value).ToString("#,###,##0.00");
            txtBoxWholesalePrice.Text = Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[5].Value).ToString("#,###,##0.00");
            if (dataGridView1.SelectedRows[0].Cells[2].Value.ToString() == "")
            {
                btnPatch.Enabled = true;
            }
            if (dataGridView1.SelectedRows[0].Cells[7].Value.ToString() == "V")
            {
                rdVatable.Checked = true;
            }
            if (dataGridView1.SelectedRows[0].Cells[7].Value.ToString() == "E")
            {
                rdE.Checked = true;
            }
            if (dataGridView1.SelectedRows[0].Cells[7].Value.ToString() == "Z")
            {
                rdZ.Checked = true;
            }
            String userName = frmLogin.User.user_name;

            login.catchUsername(userName);
            if (login.hasUser_Accounts())
            {
                btnUp.Enabled = true;
            }
            txtBoxQty.ReadOnly            = false;
            txtBonxEAN.ReadOnly           = false;
            txtBoxRPrice.ReadOnly         = false;
            txtBoxWholesalePrice.ReadOnly = false;
            bcSave.Enabled    = true;
            btnReturn.Enabled = false;
            try
            {
                b.Alignment = AlignmentPositions.CENTER;
                b.Width     = 250;
                b.Height    = 100;
                TYPE t = TYPE.EAN13;
                b.IncludeLabel  = true;
                b.LabelPosition = LabelPositions.BOTTOMCENTER;
                barcode.Image   = b.Encode(t, dataGridView1.SelectedRows[0].Cells[2].Value.ToString());
            }
            catch (Exception)
            {
                b.Alignment = AlignmentPositions.CENTER;
                TYPE t = TYPE.CODE39;
                b.IncludeLabel  = true;
                b.LabelPosition = LabelPositions.BOTTOMCENTER;
                try
                {
                    barcode.Image = b.Encode(t, dataGridView1.SelectedRows[0].Cells[2].Value.ToString());
                }
                catch (Exception)
                {
                    barcode.Image = b.Encode(t, "0");
                }
            }
        }
Пример #7
0
 private void enterKey()
 {
     avo = new VO.UserAccountVO(txtBoxUsername.Text);
     try
     {
         if (login.isAuth(txtBoxUsername.Text, txtPassword.Text.Trim()))
         {
             currentUser         = avo;
             txtBoxUsername.Text = avo.user_name;
             login.catchUsername(txtBoxUsername.Text);
             if (login.canAccess())
             {
                 avo.user_name = txtBoxUsername.Text;
                 avo.PushLog();
                 this.Hide();
                 frmMenu fm = new frmMenu();
                 fm.Show();
                 if (login.hasSales())
                 {
                     fm.unlockSales();
                 }
                 if (login.hasOrder())
                 {
                     fm.unlockOrder();
                 }
                 if (login.hasCustomers())
                 {
                     fm.unlockCustomers();
                 }
                 if (login.hasInventory())
                 {
                     fm.unlockInventory();
                 }
                 if (login.hasReports())
                 {
                     fm.unlockGeneralReports();
                 }
                 if (login.hasGC())
                 {
                     fm.unlockGiftCards();
                 }
                 if (login.hasUser_Accounts())
                 {
                     fm.unlockUserAccounts();
                 }
                 if (login.hasUserConf())
                 {
                     fm.unlockConfig();
                 }
             }
             else
             {
                 MessageBox.Show("Your Account is Disable!\nContact Account Supervisor to Enable your Account", "Account Security", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                 txtBoxUsername.Text     = "";
                 txtBoxUsername.ReadOnly = false;
                 txtBoxUsername.Focus();
                 txtPassword.Text     = "";
                 txtPassword.ReadOnly = true;
             }
         }
         else
         {
             MessageBox.Show("Username and/or Password is Incorrect or Not Completed", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             txtBoxUsername.Text     = "";
             txtBoxUsername.ReadOnly = false;
             txtBoxUsername.Focus();
             txtPassword.Text     = "";
             txtPassword.ReadOnly = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }