Exemple #1
0
        private void frmmain_Load(object sender, EventArgs e)
        {
            Opacity = 0;
            timer1.Enabled = true;
            common.main = this;
            var sidebar = new frmsidebar();
            var login = new frmlogin();
            var viewres = new frmdgview();

            common.mnubar = mnubar;
            common.login = login;
            common.sidebar = sidebar;
            common.viewres = viewres;

            common.login.MdiParent = this;

            Location = new Point(0, 0);
            Size = Screen.PrimaryScreen.WorkingArea.Size;


            sidebar.MdiParent = this;

            viewres.MdiParent = this;
            //f1.MdiParent = this;


            sidebar.Dock = DockStyle.Left; //Sidebar
            viewres.Dock = DockStyle.Right;

            common.login.Show();
        }
Exemple #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            List<string> results = database.login_check(loginas.Text.ToLower(), label2.Text.ToLower(), txtusrname.Text,txtpass.Text);

            if (results.Count != 0)
            {
                MdiParent.MainMenuStrip.Enabled = true;
                MdiParent.MainMenuStrip.Items["mnusrname"].Text = (results[1]);
                common.main.SetLoginUser(results[0]);
                if (results[5] == "1")
                {
                    MdiParent.MainMenuStrip.Items["mnuadd"].Visible = true;
                    MdiParent.MainMenuStrip.Items["mnusearch"].Visible = true;
                }


                var sidebar = new frmsidebar();
                sidebar.MdiParent = MdiParent;
                sidebar.Dock = DockStyle.Left;
                common.sidebar = sidebar;
                common.sidebar.SetValues(results);
                common.sidebar.Show();
                Close();
            }
        }