Example #1
0
        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;
        }
Example #2
0
 private void Form1_Closed(object sender, System.EventArgs e)
 {
     //MHClient = null;
     CardSwipe = null;
 }
Example #3
0
        //        /// <summary>
        //        /// The main entry point for the application.
        //        /// </summary>
        //        [STAThread]
        //        static void Main()
        //        {
        //            Application.Run(new Login1());
        //        }
        private void Login1_Load(object sender, System.EventArgs e)
        {
            FrmParent = (frmSplash)this.Owner;

            try
            {
                CardSwipe = new CARDSCAN.SerialPortScanClass();

            }
            catch(Exception Err)
            {
                MessageBox.Show(Err.Message,"Application Closing..");
                this.DialogResult = DialogResult.Abort;
                return;
            }
            FrmParent.Msg("Loading Card Reader Information...");

            //            //Retrieve the last known COMPORT VALUE
            RK = Registry.CurrentUser.OpenSubKey("Software\\Carver Lab\\Oyster V2.0\\Data");
            if(RK == null)
            {
                RK = Registry.CurrentUser.OpenSubKey("Software",true);
                RK.CreateSubKey("Carver Lab\\Oyster V2.0\\Data");
            }
            ConnectionString = RK.GetValue("ConnectionString","").ToString();
            g_COMPORT = (string)RK.GetValue("COMPORT","COM1");

            //RETRIEVE ALL COMPORTS ON THIS COMPUTER
            RK = Registry.LocalMachine.OpenSubKey("HARDWARE\\DEVICEMAP\\SERIALCOMM");
            string[] COM_PORTS = RK.GetSubKeyNames();
            int length = COM_PORTS.Length;
            COM_PORTS = RK.GetValueNames();
            length = COM_PORTS.Length;
            string nosey = "";
            if(length == 0)
            {
                cbConfigureCardScan.Items.Add("NO COMPORTS");
                g_COMPORT = "";
                NOCOM = true;
                btnLoginCardScan.Enabled = false;
               // btnScanIdCard.Enabled = false;
            }
            else
            {

                for(int i = 0; i < COM_PORTS.Length;i++)
                {
                    nosey = (string)RK.GetValue(COM_PORTS[i].ToString());
                    cbConfigureCardScan.Items.Add(nosey);
                    if(g_COMPORT == nosey)
                        cbConfigureCardScan.Text = nosey;

                    nosey = COM_PORTS[i].ToString();
                }
            }
            FrmParent.Msg("Please enter Login information.");
        }
Example #4
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            CScan = new CARDSCAN.SerialPortScanClass();
            CScan.StartScanner("COM2");
            this.CScan.SwipeReceived += new CARDSCAN._ISerialPortScanEvents_SwipeReceivedEventHandler(CardReaderEvent);

            ControlButtons = new ArrayList();
            ControlButtons.Add(imgControl_FastRewind);
            ControlButtons.Add(imgControl_Rewind);
            ControlButtons.Add(imgControl_Stop);
            ControlButtons.Add(imgControl_Play);
            ControlButtons.Add(imgControl_Pause);
            ControlButtons.Add(imgControl_Forward);
            ControlButtons.Add(imgControl_FastForward);
            ControlButtons.Add(imgLSynchronize);

            IsControlButtonEnabled = new ArrayList();
            btnPlayerButtons = new ArrayList();
            btnPlayerButtons.Add(imgFastRewind);
            btnPlayerButtons.Add(imgRewind);
            btnPlayerButtons.Add(imgStop);
            btnPlayerButtons.Add(imgPlay);
            btnPlayerButtons.Add(imgPause);
            btnPlayerButtons.Add(imgForward);
            btnPlayerButtons.Add(imgFastForward);
            //btnPlayerButtons.Add(imgSynchronize);

            for(int i=0;i<btnPlayerButtons.Count;i++)
            {
                CheckBox NewValue = new CheckBox();
                NewValue.Checked = false;
                IsControlButtonEnabled.Add(NewValue);
            }
            PlayerButtons(false);
            pnlLogin.BringToFront();
            pnlRecordingTab.Visible = false;
            pnlNotesTab.Visible = false;
            if(LUser != null)
                InitializeUserData();

            ShowViewerControls(false);

            UP.EnableContextMenu(0);
            UP.EnableFlowControl(0,0);
            UP.AdjustVolume(100);
            UP2.EnableContextMenu(0);
            UP2.EnableFlowControl(0,0);
            UP2.AdjustVolume(0);
            UPCamera.EnableContextMenu(0);
            UPCamera.EnableFlowControl(0,0);
            UPCamera.AdjustVolume(100);

            this.Focus();
            this.Select();
        }
Example #5
0
        //        /// <summary>
        //        /// The main entry point for the application.
        //        /// </summary>
        //        [STAThread]
        //        static void Main()
        //        {
        //            Application.Run(new Form1());
        //        }
        private void Form1_Load(object sender, System.EventArgs e)
        {
            frmSplash Splash = (frmSplash)this.Owner;

            g_Obj = new System.Object();
            try
            {
                CardSwipe = new CARDSCAN.SerialPortScanClass();
            }
            catch(Exception Err)
            {
                MessageBox.Show(Err.Message,"Application Closing..");
                Application.Exit();
                return;
            }
            UserLicense.OnTimedOut +=new EventHandler(UserLicense_OnTimedOut);
            UserLicense.ResetTimer();

            m_OCLWriter = new CarverLabUtility.OCLWriter("Oyster Executive",Application.ProductVersion,LoginUser.ID,ref OSystem);
            System.Diagnostics.Debug.Listeners.Add(m_OCLWriter);

            Trace.WriteLine("Logged In",System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name);
            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.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            //this.Opacity = 100;
        }
Example #6
0
 private void Form1_Closed(object sender, System.EventArgs e)
 {
     //MHClient = null;
     CardSwipe = null;
     UserLicense.Release();
 }