示例#1
0
        private void Main_Load(object sender, EventArgs e)
        {
            string  lsLoginOn    = lsIni.GetString("thahr30", "loginon", "0");
            string  lsPrivileges = lsIni.GetString("thahr30", "privilegeson", "0");
            Boolean lbCancel     = false;

            if (lsLoginOn == "1")
            {
                StaffLogin frm = new StaffLogin();
                frm.ShowDialog(this);
                if (frm.StaffName == "loginfail" || frm.StaffName == "")
                {
                    CloseForm();
                    lbCancel = true;
                }
                else
                {
                    lsStaffID = frm.StaffID;
                    lsGdb.Gdb = frm.Connnection;
                    if (lsPrivileges == "1")
                    {
                        SelectStaffPrivileges(lsStaffID);
                    }
                    SL1.Items[0].Text = "Database " + lsGdb.Gdb.Database + " Version " + lsGdb.Gdb.ServerVersion + " ";
                }
                lsStaffName = frm.StaffName;
                this.Text   = "Staff name " + frm.StaffName + lsLastUpdate;
                frm.Dispose();
            }
            //this.Text = "Staff name " + frm.StaffName + lsLastUpdate;
            if (lbCancel == false)
            {
                //CreateGraph(zg1);
            }
        }
示例#2
0
        private void logoff_Click(object sender, EventArgs e)
        {
            this.Hide();
            lsGdb.Gdb.Close();
            StaffLogin frm = new StaffLogin();

            frm.ShowDialog(this);
            if (frm.StaffName == "loginfail")
            {
                CloseForm();
            }
            else
            {
                string lsPrivileges = lsIni.GetString("thahr30", "privilegeson", "0");
                if (lsPrivileges == "1")
                {
                    lsStaffID = frm.StaffID;
                    lsGdb.Gdb = frm.Connnection;
                    SelectStaffPrivileges(lsStaffID);
                }
                this.Show();
            }
            lsStaffName = frm.StaffName;
            this.Text   = "Staff name " + frm.StaffName + lsLastUpdate;
            frm.Dispose();
        }
示例#3
0
        private void testLogin_Click(object sender, EventArgs e)
        {
            StaffLogin frm = new StaffLogin();

            frm.Connnection = lsGdb.Gdb;
            frm.ShowDialog(this);
        }