Example #1
0
        private void startPOSToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CashDrawer cd = new CashDrawer();

            cd.BranchCode = inif.Read("BranchCode", "CompanyDetails");
            cd.ActiveUser = ActiveUser;
            cd._sqlClient = SQLCLient;
            cd._sqlServer = SQLServer;
            cd.ShowDialog();
        }
Example #2
0
        private void UserValidator(string Role)
        {
            string branchCode = inif.Read("BranchCode", "CompanyDetails");

            POS_Menu.Visible = false;
            ActiveRole       = Role;
            if (ActiveRole.ToLower() == "staff")
            {
                ToolAccess.Visible = false;
                POS PS = new POS();
                PS.inif      = inif;
                PS.MdiParent = this;
                PS.Show();
                POS_Menu.Visible  = true;
                cf.sqlconn_client = SQLCLient;
                string InitialValue = "0.00";
                if (cf.CheckCashDrawerOfDay(branchCode, ref InitialValue))
                {
                    DialogResult dr = MessageBox.Show("Warning: System detects that you have not yet settle the POS Drawer today.\nWould you like to configure it first?", "Configure Drawer", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (dr == DialogResult.Yes)
                    {
                        CashDrawer cd = new CashDrawer();
                        cd.BranchCode = inif.Read("BranchCode", "CompanyDetails");
                        cd.ActiveUser = ActiveUser;
                        cd._sqlClient = SQLCLient;
                        cd._sqlServer = SQLServer;
                        cd.ShowDialog();
                    }
                }
            }
            else
            {
                if (ActiveRole.ToLower() == "admin")
                {
                    ToolAccess.Visible = true;
                    string StandAlone = inif.Read("Stand-Alone", "System");
                    if (StandAlone.ToLower() == "false")
                    {
                        MessageBox.Show("Error: Your POS was not set to \"Stand-Alone\".\n Kindly set it true to use to have Administratve Module.", "POS: Stand-Alone is Off", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        ActiveUser         = string.Empty;
                        tssActiveUser.Text = string.IsNullOrEmpty(ActiveUser) ? "N/A" : ActiveUser;
                        tssLogout.Visible  = false;
                        tssLogin.Visible   = !tssLogout.Visible;
                        return;
                    }
                    else
                    {
                        Admin_Menu.Visible = true;
                        POS_Menu.Visible   = true;
                    }
                }
            }
        }