コード例 #1
0
ファイル: frmSplash.cs プロジェクト: CarverLab/Oyster
        private void StartApplication()
        {
            frmMain = new Form1();
            frmMain.Owner = this;
            Login1 L = new Login1();

            System.Windows.Forms.DialogResult LDR = L.ShowDialog(this);

            if(LDR != DialogResult.OK)
            {
                Application.Exit();
                return;
            }
            else
            {
                Msg("Loading User data...");
                frmMain.OSystem = L.OSystem;
                frmMain.LoginUser = L.LoginUser;
                frmMain.g_COMPORT = L.g_COMPORT;
                frmMain.g_LoginDenied = L.OSystem.SystemAdminLoginDenied;
                frmMain.UserLicense = L.UserLicense;
            }
            L.Dispose();
            frmMain.Show();
            this.Opacity = 0;
            this.Visible = false;
        }
コード例 #2
0
ファイル: testMain.cs プロジェクト: CarverLab/Oyster
        private void Form1_Load(object sender, System.EventArgs e)
        {
            this.Opacity = 0;
            Splash = new frmSplash();
            Splash.lblVersion.Text = VERSION;
            Splash.lblStatus.Text = "Loading Login Screen...";
            Splash.Show();

            Login1 L = new Login1();

            System.Windows.Forms.DialogResult LDR = L.ShowDialog(this);

            if(LDR != DialogResult.OK)
            {
                Application.Exit();
                return;
            }
            else
            {
                Splash.Msg("Loading User data...");
                OSystem = L.OSystem;
                LoginUser = L.LoginUser;
                g_COMPORT = L.g_COMPORT;
                g_LoginDenied = OSystem.SystemAdminLoginDenied;
            }

            //            if(this.Tag is PassOysterLogin)
            //            {
            //
            //                PassOysterLogin POL = (PassOysterLogin)this.Tag;
            //                OSystem = POL.OSystem;
            //                LoginUser = POL.LoginUser;
            //                g_COMPORT = POL.COMPORT;
            //                g_LoginDenied = OSystem.SystemAdminLoginDenied;
            //                this.Tag = null;
            //            }
            //            else
            //                return;

            //ReadMediaBufferServerLocalAddress();

            g_Obj = new System.Object();
            try
            {
                CardSwipe = new CARDSCAN.SerialPortScanClass();
                //MHClient = new MHCOM.MediaHawkClientClass();
            }
            catch(Exception Err)
            {
                MessageBox.Show(Err.Message,"Application Closing..");
                Application.Exit();
                return;
            }

            gLogTime = new DateTime();
            gLogTime = System.DateTime.Now;
            gLastActivity = System.DateTime.Now;
            StatusTimer.Enabled = true;
            ActivityTimer.Enabled = true;
            HighestSectionType = LoginUser.HighestAuthorityLevel;
            MainSystemSection = OSystem.CurrentSystemSection("6419DC43-84B9-43e2-89FE-BB8C96D5CF6F");

            menuItem1.Visible = false;
            menuItem3.Visible = false;
            mnuSystem.Visible = false;
            mnuHelp.Visible = false;

            //For Oakland Permissions
            if(HighestSectionType.ID == OSystem.SectionTypeSysAdmin.ID)
            {
                menuItem3.Visible = true;
                mnuSystem.Visible = true;
                menuItem1.Visible = true;
            }
            else if(HighestSectionType.ID == OSystem.SectionTypeSysAdmin.NextSectionTypeID)
            {
                mnuSystem.Visible = true;
                menuItem3.Visible = true;
                menuItem1.Visible = true;
            }
            else
            {
                foreach(OysterClassLibrary.Permission P in HighestSectionType.CanShareRecordings)
                {
                    string peek = P.TargetSectionTypeId.ToString();
                    menuItem1.Visible = true;
                    break;
                }
            }

            ShowDisplay(ShowUserInfo);
            Splash.Msg("Building Users Hierarchy...");
            Status(LoginUser.Description + " logged in...");
            BuildUserHierarchy();
            BuildCameraView();
            treeView1.Focus();
            if(treeView1.SelectedNode != null)
            {
                if(treeView1.SelectedNode.Tag is OysterClassLibrary.Section)
                {

                }
                else
                {
                    treeView1.SelectedNode = treeView1.Nodes[0];
                }
            }
            else
            {
                treeView1.SelectedNode = treeView1.Nodes[0];
            }
            treeView1_MouseUp(treeView1,new MouseEventArgs(MouseButtons.Left,1,0,0,0));

            Splash.Msg("Completed..exiting Splash Screen");
            Splash.Dispose();
            this.Opacity = 100;
        }
コード例 #3
0
ファイル: frmServerLocation.cs プロジェクト: CarverLab/Oyster
        private void frmServerLocation_Load(object sender, System.EventArgs e)
        {
            FrmParent = (Login1)this.Owner;
            try
            {
                //MAD = new MyApplicationData(Application.StartupPath + @"\OS.DAT",true);

                serveraddress = FrmParent.OSystem.GetServerAddressFromConnectionString();

                //serveraddress = (string)MAD.FileEntrys["ServerAddress"];
                //password = (string)MAD.FileEntrys["ServerKey"];
            }
            catch(Exception Err)
            {string pError = Err.Message;
                serveraddress = "";
                //password = "";
            }

            textBox1.Text = serveraddress;
            textBox2.Text = "****************";
        }