Example #1
0
 public OCLWriter(string ApplicationName, string ApplicationVersion, int UserId,ref OysterClassLibrary.Oyster OSystem)
 {
     this.ApplicationName = ApplicationName;
     this.UserId = UserId;
     this.OSystem = OSystem;
     OSVersion = System.Environment.OSVersion.ToString();
     MachineName = System.Environment.MachineName;
     MachineIPAddress = System.Net.Dns.Resolve(Environment.MachineName).AddressList[0].ToString();
     UserName = System.Environment.UserDomainName + "\\" + System.Environment.UserName;
     this.ApplicationVersion = ApplicationVersion;
 }
Example #2
0
        /*
        // //////////////Menu Items -- CREATE
        private void mnuCreateNewUser_Click(object sender, System.EventArgs e)
        {
            Status("Creating New User");

            ShowDisplay(ShowUserCreate);
            IsCreating = true;

            this.AcceptButton = btnFinished;
            this.CancelButton = btnUserAbort;
            tbDisplayName.Focus();	//Create_User(g_objSection,g_objSectionType);

            //MediaPlayer.Visible = false;
            //HelpBrowser.Visible = false;
        }
        private void mnuCreateNewGroup_Click(object sender, System.EventArgs e)
        {
        //            IsCreating = true;
        //            Status("Creating New Course");
        //
        //            ShowDisplay(ShowGroupCreate);
        //            tbGroupDescription.Focus();
        //            //Create a group
        //            this.AcceptButton = btnFinishGroup;
        //            btnFinishGroup.Enabled = false;
        //            this.CancelButton = btnGroupAbort;
        //            EnableLV = true;
            if(g_objSection == null) return;
            AdministrativeSoftware.CreateBodyInfo CBI = new AdministrativeSoftware.CreateBodyInfo();

            CBI.OSystem = OSystem;
            CBI.cvosUser = LoginUser;
            CBI.PrevBody = g_objSection;

            Form CB = new frmCreateABody();
            CB.Tag = CBI;

            CB.ShowDialog(this);

            CBI = (AdministrativeSoftware.CreateBodyInfo)CB.Tag;
            if(CB.DialogResult == DialogResult.OK)
            {
                LoginUser = OSystem.Refresh();
                // obj = CVOS.GetUpdate();
                //                if(obj is OysterClassLibrary.User)
                //                    cvosUser = (OysterClassLibrary.User)obj;
                //                else
                //                {
                //                    cvosSysAdmin = (OysterClassLibrary.SystemAdmin)obj;
                //                    cvosUser = cvosSysAdmin.User;
                //                }

                Status("Successfully Created:" + CBI.BodyDescription);
                OpenToUser = 0;
                OpenToBody = 0;
                OpenToRecording = 0;
                OpenToRoom = 0;
                BuildUserHierarchy();
                ShowDisplay(ShowGroupInfo);
            }

            CB.Dispose();

        }

        private void mnuAddExistingUser_Click(object sender, System.EventArgs e)
        {
            Status("Adding Existing User(s)...");
            AddToGroup();
            //ShowDisplay(ShowGroupInfo);
            //Enable controls
            //btnFinishGroup.Enabled = true;
            //
            //			btnFinishGroup.Visible = false;
            //			btnGroupAbort.Visible = false;
            //			//btnGroupAbort.Enabled = true;
            //			btnAddToGroup.Enabled = true;
            //			btnAddToGroup.Visible = true;
            //			btnDeleteFromGroup.Enabled = false;
            //			btnDeleteFromGroup.Enabled = false;

        }

        private void mnuCreateRecording_Click(object sender, System.EventArgs e)
        {
            Status("Creating New Recording");
            IsCreating = true;
            ShowDisplay(ShowRecordingCreate);
        }

        private void mnuCreateNewRoom_Click(object sender, System.EventArgs e)
        {
            Status("Creating a New Room");
            IsCreating = true;
            ShowDisplay(ShowRoomCreate);
            tbRoomName.Focus();
            testMain.ActiveForm.AcceptButton = btnRoomFinished;
            testMain.ActiveForm.CancelButton = btnRoomAbort;
        }

        private void mnuCreateNewForwardingServer_Click(object sender, System.EventArgs e)
        {
            Status("Creating New Forwarding Server");
            IsCreating = true;
            IsForwardingServer = true;
            lbServersInfo.Text = "Creating New Forwarding Server";
            tbAddress.Text = "";
            tbAddress.Focus();
            tbFileDirectory.Text = "";
            tbAddress.ReadOnly = false;
            tbFileDirectory.ReadOnly = true;
            tbFileDirectory.Visible = false;
            lbFileDirectory.Visible = false;
            lbForwardingServer.Visible = true;
            cbForwardingServer.Visible = true;
            lbForwardingServer.Text = "Video Storage Server";
            tbForwardingServer.Visible = false;

            tbPort.ReadOnly = false;
            tbPort.Text = "22569";

            btnMBSFinish.Enabled = true;
            btnMBSFinish.Visible = true;
            btnMBSAbort.Enabled = true;
            btnMBSAbort.Visible = true;

            foreach(OysterClassLibrary.VideoStorageServer VSS in OSystem.VIDEOSTORAGESERVERS)
            {

                if(VSS.ControlAddress != "Not Assigned")
                {
                    cbForwardingServer.Items.Add(VSS.ControlAddress + ":" + VSS.ControlPort.ToString());
                    //cbForwardingServer.Text = VSS.ControlAddress + ":" + VSS.ControlPort.ToString();
                }
                else
                {
                    cbForwardingServer.Items.Add(VSS.ControlAddress);
                    cbForwardingServer.Text = VSS.ControlAddress;
                }

            }
            //lblAboutServers.Visible = false;
            testMain.ActiveForm.AcceptButton = btnMBSFinish;
            testMain.ActiveForm.CancelButton = btnMBSAbort;

        }
        private void mnuCreateNewMediaBufferServer_Click(object sender, System.EventArgs e)
        {
            Status("Creating New Media Buffer Server");
            IsCreating = true;
            IsForwardingServer = false;
            lbServersInfo.Text = "Creating New Media Buffer Server";
            tbAddress.Text = "";
            tbAddress.Focus();
            tbFileDirectory.Text = "";
            tbAddress.ReadOnly = false;

            cbForwardingServer.Items.Clear();
            cbForwardingServer.Enabled = true;

            tbFileDirectory.ReadOnly = false;
            tbFileDirectory.Visible = true;
            lbFileDirectory.Visible = true;
            lbForwardingServer.Visible = true;
            lbForwardingServer.Text = "Forwarding Server";
            cbForwardingServer.Visible = true;
            tbForwardingServer.Visible = false;
            tbPort.ReadOnly = false;
            tbPort.Text = "22568";

            foreach(OysterClassLibrary.ForwardingServer FS in OSystem.FORWARDINGSERVERS)
            {

                cbForwardingServer.Items.Add(FS.Address);
                //						if(RunOnce == true)
                //						{
                //							cbForwardingServer.Text = FS.Address;
                //							RunOnce = false;
                //						}
                if(FS.Address == "Not Assigned")
                    cbForwardingServer.Text = FS.Address;

            }

            btnMBSFinish.Enabled = true;
            btnMBSFinish.Visible = true;
            btnMBSAbort.Enabled = true;
            btnMBSAbort.Visible = true;
            testMain.ActiveForm.AcceptButton = btnMBSFinish;
            testMain.ActiveForm.CancelButton = btnMBSAbort;

            //lblAboutServers.Visible = false;
        }

        private void mnuCreateNewStreamingEncoder_Click(object sender, System.EventArgs e)
        {
            Status("Creating New Streaming Encoder");
            IsCreating = true;
            pnlCardReader.Visible = false;
            pnlStreamingEncoder.Visible = true;
            lbStreamingEncoder.Text = "Creating New Streaming Encoder";
            tbSEControlAddress.Text = "";
            tbSEControlAddress.Focus();
            tbSEControlPort.Text = "4430";
            tbStreamingAddress.Text = "";
            tbStreamingPort.Text = "4444";
            chkIsMulticast.Checked = true;
            chkIsControlableCamera.Checked = false;

            //Enable Controls
            tbSEControlAddress.ReadOnly = false;
            tbSEControlPort.ReadOnly = false;
            tbStreamingAddress.ReadOnly = false;
            tbStreamingPort.ReadOnly = false;
            tbMBS.ReadOnly = true;
            tbMBS.Visible = false;
            chkIsMulticast.Enabled = true;
            chkIsControlableCamera.Enabled = true;
            cbMBS.Visible = true;
            cbMBS.Items.Clear();
            btnSEFinish.Enabled = true;
            btnSEAbort.Enabled = true;
            tbSERoom.Enabled = true;
            tbSERoom.Visible = false;
            cbSERoom.Visible = true;
            cbSERoom.Items.Clear();

            foreach(OysterClassLibrary.Room R in OSystem.ROOMS)
            {

                if(R.Description == "Unresolved Errors")
                {
                    cbSERoom.Items.Add("Not Assigned");
                    cbSERoom.Text = "Not Assigned";
                }
                else
                    cbSERoom.Items.Add(R.Description);
            }

            foreach(OysterClassLibrary.MediaBufferServer MBS in OSystem.MEDIABUFFERSERVERS)
            {
                cbMBS.Items.Add(MBS.Address);
                cbMBS.Tag = MBS;
                if(MBS.Address == "Not Assigned")
                    cbMBS.Text = MBS.Address;
            }

            testMain.ActiveForm.AcceptButton = btnSEFinish;
            testMain.ActiveForm.CancelButton = btnSEAbort;

        }

        private void mnuCreateNewCardReader_Click(object sender, System.EventArgs e)
        {
            IsCreating = true;
            Status("Creating New Card Reader");
            pnlCardReader.Visible = true;
            pnlStreamingEncoder.Visible = false;
            lbCardReader.Text = "Creating New Card Reader";
            tbCardReaderAddress.Text = "";
            tbCardReaderAddress.Focus();
            tbCardReaderPort.Text = "14001";

            //Disable Controls
            tbCardReaderAddress.ReadOnly = false;

            btnCardReaderFinished.Enabled = true;
            btnCardReaderCancel.Enabled = true;
            lbCardReaderPort.Visible = true;
            tbCardReaderPort.Visible = true;
            tbCardReaderPort.ReadOnly = false;
            tbCRRoom.Enabled = true;
            tbCRRoom.ReadOnly = true;
            tbCRRoom.Visible = false;
            cbCRRoom.Visible = true;
            cbCRRoom.Items.Clear();

            foreach(OysterClassLibrary.Room R in OSystem.ROOMS)
            {
                if(R.Description == "Unresolved Errors")
                {
                    cbCRRoom.Items.Add("Not Assigned");
                    cbCRRoom.Text = "Not Assigned";
                }
                else
                    cbCRRoom.Items.Add(R.Description);
            }

            testMain.ActiveForm.AcceptButton = btnCardReaderFinished;
            testMain.ActiveForm.CancelButton = btnCardReaderCancel;
        }

        private void mnuCreateNewVSS_Click(object sender, System.EventArgs e)
        {
            Status("Creating New Video Storage Server");
            IsCreating = true;
            ShowDisplay(ShowVSSCreate);
            tbVSSControlAddress.Focus();
            testMain.ActiveForm.AcceptButton = btnVSSFinish;
            testMain.ActiveForm.CancelButton = btnVSSAbort;

        }

        private void mnuCreateAdministrator_Click(object sender, System.EventArgs e)
        {
            Status("Creating New Administrator");
            IsCreating = true;
            ShowDisplay(ShowUserCreate);
            lbUserInfo.Text = "Creating New Administrator";
            tbLoginName.Focus();
            cbSectionType.Text = "Administrator";

        }
        private void mnuCreateInstructor_Click(object sender, System.EventArgs e)
        {

            Status("Creating New Instructor");
            IsCreating = true;
            ShowDisplay(ShowUserCreate);
            lbUserInfo.Text = "Creating New Instructor";
            tbLoginName.Focus();
            cbSectionType.Text = "Instructor";
        }
        private void mnuCreateSupervisor_Click(object sender, System.EventArgs e)
        {

            Status("Creating New Supervisor");
            IsCreating = true;
            ShowDisplay(ShowUserCreate);
            lbUserInfo.Text = "Creating New Supervisor";
            tbLoginName.Focus();
            cbSectionType.Text = "Supervisor";
        }
        private void mnuCreateStudent_Click(object sender, System.EventArgs e)
        {
            Status("Creating New Student");
            IsCreating = true;
            ShowDisplay(ShowUserCreate);
            lbUserInfo.Text = "Creating New Student";
            tbLoginName.Focus();
            cbSectionType.Text = "Student";
        }

        // //////////////Menu Items -- EDIT
        private void mnuEditGroup_Click(object sender, System.EventArgs e)
        {
            //ShowDisplay(ShowGroupInfo);
            IsCreating = false;
            g_objCurrentSection = g_objSection;
            if(g_objSection.CreatedBySectionType.Description == "Instructor")
            {
                TreeNode Y = treeView1.SelectedNode;
                Y = Y.Parent; //Y now equals the User
                string testLoc = Y.Text;
                Y = Y.Parent; //Y now equals the title
                testLoc = Y.Text;
                Y = Y.Parent;
                testLoc = Y.Text; //Y now equals the Department!!!

                g_objSection = (OysterClassLibrary.Section)Y.Tag;
                testLoc = g_objSection.Description;
                ShowDisplay(ShowGroupInfo);

                cbGroupType.Items.Clear();
                //Placed this in for OakLand School
                cbGroupType.Items.Add(g_objCurrentSection.CreatedBySectionType.Description);
                cbGroupType.Text = g_objCurrentSection.CreatedBySectionType.Description;

                OysterClassLibrary.User Owner;
                OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                Owner = F.GetUser(g_objCurrentSection.OwnerID);
                F.Dispose();
                lbGroupLabel.Text = "Renaming Course: " + g_objCurrentSection.Description;
                lbGroupOwner.Text = "Course Instructor";
                lbGroupDescription.Text = "Course Description";

                EnableLV = true;
                tbGroupDescription.Text = g_objCurrentSection.Description;
                tbGroupOwner.Text = Owner.Description;
                tbGroupOwner.ReadOnly = true;

                tbGroupDescription.ReadOnly = false;
                btnFinishGroup.Enabled = true;
                btnGroupAbort.Enabled = true;
            }
            else
            {
                ShowDisplay(ShowGroupInfo);
                tbGroupDescription.ReadOnly = false;
                btnFinishGroup.Enabled = true;
                btnGroupAbort.Enabled = true;
                EnableLV =false;
            }

            //            tbGroupDescription.Text = g_objCurrentSection.Description;
            //            cbGroupOwner.Items.Clear();
            //            cbGroupOwner.Items.Add(Owner.Description);
            //            cbGroupOwner.Text = Owner.Description;
            //            tbGroupOwner.Text = Owner.Description;
            //
            //
            //            tbGroupOwner.BringToFront();
            //Aquire the Department and make it the g_objSection

            /////
            ///

            Status("Editing " + g_objSection.Description);
            //Enable controls
            //            tbGroupDescription.ReadOnly = false;
            //            tbGroupDescription.Focus();
            //            chkbEnableGroupType.Enabled = true;
            //            cbGroupOwner.Enabled =true;
            //            cbGroupType.Enabled = false;
            //            btnFinishGroup.Enabled = true;
            //            btnGroupAbort.Enabled = true;
            //            btnAddToGroup.Enabled = false;
            //            btnAddToGroup.Visible = false;
            //            btnDeleteFromGroup.Enabled = false;
            //            btnDeleteFromGroup.Enabled = false;

            this.AcceptButton = btnFinishGroup;
            this.CancelButton = btnGroupAbort;

        }
        private void mnuEditUser_Click(object sender, System.EventArgs e)
        {

            ShowDisplay(ShowUserInfo);
            Status("Editing User: "******"Editing Room: " + g_objRoom.Description);
            IsCreating = false;
            ShowDisplay(ShowRoomInfo);
            //Enable Controls
            tbRoomName.ReadOnly = false;
            tbRoomName.Focus();
            cbVideoStorageServer.Enabled = true;
            btnRoomFinished.Enabled = true;
            btnRoomAbort.Enabled = true;
            tbVideoStorageServer.Visible = false;
            cbVideoStorageServer.Visible = true;
            //			btnNewStreamingEncoder.Enabled = true;
            //			btnRemoveStreamingEncoder.Enabled = false;
            //			btnNewCardSwipe.Enabled = true;
            //			btnRemoveCardSwipe.Enabled = false;
            //Need a foreach to fill with a list of MBS
            testMain.ActiveForm.AcceptButton = btnRoomFinished;
            testMain.ActiveForm.CancelButton = btnRoomAbort;

        }

        private void mnuEditForwardingServer_Click(object sender, System.EventArgs e)
        {
            Status("Editing Forwarding Server: " + g_objFS.Address);
            IsCreating = false;
            IsForwardingServer = true;
            lbServersInfo.Text = "Editing Forwarding Server: " + g_objFS.Address;
            tbAddress.Text = g_objFS.Address;
            //tbCreated.Text = g_objFS.Created.ToString();
            //tbCreated.ReadOnly = true;
            tbAddress.ReadOnly = false;
            tbPort.ReadOnly = false;
            tbPort.Text = g_objFS.Port.ToString();
            tbAddress.Focus();
            btnMBSFinish.Enabled = true;
            btnMBSFinish.Visible = true;
            btnMBSAbort.Enabled = true;
            btnMBSAbort.Visible = true;

            tbFileDirectory.ReadOnly = true;
            tbFileDirectory.Visible = false;
            lbFileDirectory.Visible = false;
            lbForwardingServer.Visible = true;
            lbForwardingServer.Text = "Video Storage Server";
            cbForwardingServer.Visible = true;
            tbForwardingServer.Visible = false;
            foreach(OysterClassLibrary.VideoStorageServer VSS in OSystem.VIDEOSTORAGESERVERS)
            {

                if(VSS.ControlAddress == "Not Assigned")
                    cbForwardingServer.Items.Add(VSS.ControlAddress);
                else
                    cbForwardingServer.Items.Add(VSS.ControlAddress + ":" + VSS.ControlPort.ToString());

                if(VSS.ID == g_objFS.VideoStorageServerID)
                {
                    g_objVSS = VSS;
                    if(VSS.ControlAddress != "Not Assigned")
                    {
                        cbForwardingServer.Text = VSS.ControlAddress + ":" + VSS.ControlPort.ToString();
                    }
                    else
                    {
                        cbForwardingServer.Text = VSS.ControlAddress;
                    }
                }

            }
            //lblAboutServers.Visible = false;
            testMain.ActiveForm.AcceptButton = btnMBSFinish;
            testMain.ActiveForm.CancelButton = btnMBSAbort;
        }

        private void mnuEditVSS_Click(object sender, System.EventArgs e)
        {
            Status("Editing Video Storage Server: " + g_objVSS.ControlAddress + ": " + g_objVSS.ControlPort);
            ShowDisplay(ShowVSSInfo);
            IsCreating = false;
            tbVSSControlAddress.ReadOnly = false;
            tbVSSControlAddress.Focus();
            tbVSSControlPort.ReadOnly = false;
            tbVSSUploadAddress.ReadOnly = false;

            tbAddress.ReadOnly = true;
            tbFileDirectory.ReadOnly = true;
            //            btnMBSFinish.Visible = false;
            //            btnMBSAbort.Visible = false;
            btnVSSFinish.Enabled = true;
            btnVSSAbort.Enabled = true;
            btnVSSFinish.Visible = true;
            btnVSSAbort.Visible = true;
            chkIsUploadFTP.Enabled = true;

            testMain.ActiveForm.AcceptButton = btnVSSFinish;
            testMain.ActiveForm.CancelButton = btnVSSAbort;

        }

        private void mnuEditMediaBufferServer_Click(object sender, System.EventArgs e)
        {
            Status("Editing Media Buffer Server: " + g_objMBS.Address);
            IsCreating = false;
            IsForwardingServer = false;
            lbServersInfo.Text = "Editing Media Buffer Server: " + g_objMBS.Address;
            tbAddress.Text = g_objMBS.Address;
            tbAddress.Focus();
            tbFileDirectory.Text = g_objMBS.StorageDirectory;
            tbAddress.ReadOnly = false;
            tbFileDirectory.ReadOnly = false;
            btnMBSFinish.Enabled = true;
            btnMBSFinish.Visible = true;
            btnMBSAbort.Enabled = true;
            btnMBSAbort.Visible = true;
            tbFileDirectory.ReadOnly = false;
            tbFileDirectory.Visible = true;
            lbFileDirectory.Visible = true;
            lbForwardingServer.Text = "Forwarding Server";
            lbForwardingServer.Visible = true;
            cbForwardingServer.Visible = true;

            tbForwardingServer.Visible = false;
            tbPort.ReadOnly = false;

            tbPort.Text = g_objMBS.Port.ToString();
            cbForwardingServer.Items.Clear();
            foreach(OysterClassLibrary.ForwardingServer FS in OSystem.FORWARDINGSERVERS)
            {

                cbForwardingServer.Items.Add(FS.Address);
                if(FS.ID == g_objMBS.ForwardingServerID)
                {
                    g_objFS = FS;
                    cbForwardingServer.Text = FS.Address;
                }

            }
            testMain.ActiveForm.AcceptButton = btnMBSFinish;
            testMain.ActiveForm.CancelButton = btnMBSAbort;

            //lblAboutServers.Visible = false;
        }

        private void mnuEditStreamingEncoder_Click(object sender, System.EventArgs e)
        {
            IsCreating = false;
            pnlCardReader.Visible = false;
            pnlStreamingEncoder.Visible = true;
            lbStreamingEncoder.Text = "Editing Streaming Encoder: " + g_objSE.ControlAddress + ": " + g_objSE.ControlPort;
            Status("Editing Streaming Encoder: " + g_objSE.ControlAddress + ": " + g_objSE.ControlPort);
            tbSEControlAddress.Text = g_objSE.ControlAddress;
            tbSEControlAddress.Focus();
            tbSEControlPort.Text = g_objSE.ControlPort.ToString();
            tbStreamingAddress.Text = g_objSE.StreamAddress;
            tbStreamingPort.Text = g_objSE.StreamPort.ToString();
            chkIsMulticast.Checked = g_objSE.IsMulticast;
            chkIsControlableCamera.Checked = g_objSE.HasControlableCamera;

            //Enable Controls
            tbSEControlAddress.ReadOnly = false;
            tbSEControlPort.ReadOnly = false;
            tbStreamingAddress.ReadOnly = false;
            tbStreamingPort.ReadOnly = false;
            tbMBS.ReadOnly = true;
            tbMBS.Visible = false;
            chkIsMulticast.Enabled = true;
            chkIsControlableCamera.Enabled = true;
            cbMBS.Visible = true;
            cbMBS.Items.Clear();
            btnSEFinish.Enabled = true;
            btnSEAbort.Enabled = true;
            tbSERoom.Enabled = true;
            tbSERoom.Visible = false;
            cbSERoom.Visible = true;
            cbSERoom.Items.Clear();

            foreach(OysterClassLibrary.Room R in OSystem.ROOMS)
            {

                if(R.Description == "Unresolved Errors")
                {
                    cbSERoom.Items.Add("Not Assigned");
                }
                else
                    cbSERoom.Items.Add(R.Description);
                if(R.ID == g_objSE.RoomID)
                {
                    if(R.Description == "Unresolved Errors")
                        cbSERoom.Text = "Not Assigned";
                    else
                        cbSERoom.Text = R.Description;
                }
            }
            foreach(OysterClassLibrary.MediaBufferServer MBS in OSystem.MEDIABUFFERSERVERS)
            {
                cbMBS.Items.Add(MBS.Address);
                cbMBS.Tag = MBS;
                if(MBS.ID == g_objSE.MediaBufferServerID)
                    cbMBS.Text = MBS.Address;

            }
            testMain.ActiveForm.AcceptButton = btnSEFinish;
            testMain.ActiveForm.CancelButton = btnSEAbort;

        }

        private void mnuEditCardSwipe_Click(object sender, System.EventArgs e)
        {

            Status("Editing Card Reader:" + g_objCS.Address);
            IsCreating = false;
            pnlCardReader.Visible = true;
            pnlStreamingEncoder.Visible = false;
            lbCardReader.Text = "Editing Card Reader: " + g_objCS.Address;
            tbCardReaderAddress.Text = g_objCS.Address;

            tbCardReaderPort.Text = g_objCS.Port.ToString();
            //Disable Controls
            tbCardReaderAddress.ReadOnly = false;
            tbCardReaderAddress.Focus();

            btnCardReaderFinished.Enabled = true;
            btnCardReaderCancel.Enabled = true;

            lbCardReaderPort.Visible = true;
            tbCardReaderPort.Visible = true;
            tbCardReaderPort.ReadOnly = false;
            tbCRRoom.Enabled = true;
            tbCRRoom.Visible = false;
            cbCRRoom.Visible = true;
            cbCRRoom.Items.Clear();

            foreach(OysterClassLibrary.Room R in OSystem.ROOMS)
            {

                if(R.Description == "Unresolved Errors")
                {
                    cbCRRoom.Items.Add("Not Assigned");
                }
                else
                    cbCRRoom.Items.Add(R.Description);
                if(R.ID == g_objCS.RoomID)
                {
                    if(R.Description == "Unresolved Errors")
                        cbCRRoom.Text = "Not Assigned";
                    else
                        cbCRRoom.Text = R.Description;
                }
            }

            testMain.ActiveForm.AcceptButton = btnCardReaderFinished;
            testMain.ActiveForm.CancelButton = btnCardReaderCancel;
        }

        private void mnuRenameRecording_Click(object sender, System.EventArgs e)
        {
            Form RR = new UpdateRecording();

            RR.Tag = g_objRecording;
            RR.ShowDialog(this);

            if(RR.DialogResult == DialogResult.OK)
            {
                OpenToUser = 0;
                OpenToBody = 0;
                OpenToRecording = g_objRecording.ID;
                OpenToRoom = 0;
                BuildUserHierarchy();
                ShowDisplay(ShowRecordingInfo);
                Status("Rename Recording completed.");
                RR.Dispose();
            }
            else
                Status("Aborted Rename Recording operation.");
            RR.Dispose();
        }

        private void mnuReassignRecording_Click(object sender, System.EventArgs e)
        {
            AdministrativeSoftware.PassRecordingInfo PRI= new AdministrativeSoftware.PassRecordingInfo();

            ListView lvMember = new ListView();

            TreeNode XNode = g_RecordingNode;
            TreeNode LastBodyFound = new TreeNode();
            while(XNode != treeView1.TopNode)
            {
                XNode = XNode.Parent;
                if(XNode.Tag is OysterClassLibrary.Section)
                    LastBodyFound = XNode;
                else if(XNode.Tag is OysterClassLibrary.Section)
                    LastBodyFound = XNode;
                else if(XNode.Tag is OysterClassLibrary.SectionType)
                    PRI.objSectionType = (OysterClassLibrary.SectionType)XNode.Tag;
            }
            OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();

            OysterClassLibrary.Sections MembersOf = LoginUser.AllMemberSections;//F.GetMemberSections(LoginUser.ID,false);
            if(PRI.objSectionType == null)
                PRI.objSectionType = HighestSectionType;
            F.Dispose();
            if(LastBodyFound.Tag is OysterClassLibrary.Section)
            {
                OysterClassLibrary.Section B = (OysterClassLibrary.Section)LastBodyFound.Tag;
                ListViewItem LI = new ListViewItem();
                LI = lvMember.Items.Add(B.Description);
                LI.Tag = B;
                GatherAllBodys(lvMember,B.CurrentUsers);

                foreach(OysterClassLibrary.Section M in MembersOf)
                {

                    LI = lvMember.Items.Add(M.Description);
                    LI.Tag = M;
                }
            }
            else if(LastBodyFound.Tag is OysterClassLibrary.Section)
            {
                //                foreach(OysterClassLibrary.Section objB in cvosUser.Bodys)
                //                {
                //                    if(objB.IsDefault != true)
                //                    {
                //                        ListViewItem LI = lvMember.Items.Add(objB.Description);
                //                        LI.Tag = objB;
                //                        GatherAllBodys(lvMember,objB.Users);
                //
                //                    }
                //                }

                foreach(OysterClassLibrary.Section objM in MembersOf)
                {
                    ListViewItem LI = lvMember.Items.Add(objM.Description);
                    LI.Tag = objM;
                }
            }
            else if(LastBodyFound.Tag == null)
            {
                if(PRI.objSectionType.ID == OSystem.SectionTypeSysAdmin.ID)
                {
                    foreach(OysterClassLibrary.Section SystemBody in LoginUser.AllOwnedSections)
                    {
                        if(SystemBody.IsDefault == false)
                        {
                            ListViewItem LI = new ListViewItem();
                            LI = lvMember.Items.Add(SystemBody.Description);
                            LI.Tag = SystemBody;
                            GatherAllBodys(lvMember,SystemBody.CurrentUsers);
                        }
                    }
                }
                else
                {
                    foreach(OysterClassLibrary.Section objM in MembersOf)
                    {

                        string SeeMemberDescription = objM.Description;
                        ListViewItem LI = lvMember.Items.Add(objM.Description);
                        LI.Tag = objM;
                    }
                }
            }

            string UserName = LoginUser.Description;
            PRI.CurrentUser = LoginUser;
            PRI.Rec = g_objRecording;
            PRI.LV = lvMember;
            PRI.OSystem = OSystem;
            //PRI.objSectionType = CurrentSectionType;

            Form RA = new frmMoveRecording();

            RA.Tag = PRI;

            RA.ShowDialog(this);

            if(RA.DialogResult == DialogResult.OK)
            {
                LoginUser = OSystem.Refresh();
                // obj = CVOS.GetUpdate();
                //                if(obj is OysterClassLibrary.User)
                //                    cvosUser = (OysterClassLibrary.User)obj;
                //                else
                //                {
                //                    cvosSysAdmin = (OysterClassLibrary.SystemAdmin)obj;
                //                    cvosUser = cvosSysAdmin.User;
                //                }
                BuildUserHierarchy();

            }
            else
                // MessageBox.Show("Move Failed");

                RA.Dispose();

        }

        // //////////////Menu Items -- DELETE
        private void mnuRemoveUser_Click(object sender, System.EventArgs e)
        {
            //User doesn't exist
            System.Windows.Forms.DialogResult DR = new System.Windows.Forms.DialogResult();
            bool bSuccess = false;
            //int ErrorNumber = 0;
            if(g_objUser == null)
            {
                TreeNode X = treeView1.SelectedNode;
                if(X == null)return;
                g_objUser = (OysterClassLibrary.User)X.Tag;
            }

            if(g_objUser == null)return;

            string UserName = g_objUser.FirstName + " " + g_objUser.MiddleName + ". " + g_objUser.LastName;
            DR = System.Windows.Forms.MessageBox.Show("Removing " + UserName + " will delete " +
                UserName + "All Recordings within this Department will be permanently deleted!", "Do you wish to proceed with Remove User?", System.Windows.Forms.MessageBoxButtons.YesNo);
            if(DR == DialogResult.Yes)
            {
                OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                OysterClassLibrary.Section objBody = F.GetSection(g_objUser.CurrentSectionID);
                if(objBody == null)
                    return;

                try
                {
                    //OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                    try
                    {
                        F.RemoveUser(g_objUser.ID,objBody.ID);
                        F.Dispose();
                        bSuccess = true;
                    }
                    catch(Exception Err)
                    {
                        string peekError = Err.Message;
                        bSuccess = false;
                    }
                     //       bSuccess = objBody.DestroyUser(g_objUser,false,ref ErrorNumber);
                    if(bSuccess ==true)
                    {

                        Status("Successfully Removed " + g_objUser.Description + " from " + g_objSection.Description);
                        cbSectionType.Items.Clear();
                        cbSectionType.Text = "";
                        LoginUser = OSystem.Refresh();
                        BuildUserHierarchy();
                        ShowDisplay(ShowGroupInfo);
                    }
                }
                catch(Exception Err)
                {
                    MessageBox.Show(Err.Message);
                    return;
                }

            }

        }
        private void mnuDestroyGroup_Click(object sender, System.EventArgs e)
        {
            System.Windows.Forms.DialogResult DR = new System.Windows.Forms.DialogResult();
            bool bSuccess = false;

            DR = System.Windows.Forms.MessageBox.Show("Destroying " + g_objSection.Description + " will permanently destroy ALL Recordings that have been assigned to this Course!","Do you wish to proceed with Delete Course?",System.Windows.Forms.MessageBoxButtons.YesNo);

            if(DR == DialogResult.Yes)
            {
                Status(LoginUser.Description + " gave order to proceed with deletion...");
                OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                OysterClassLibrary.User objUser = F.GetUser(g_objSection.OwnerID);
                if(objUser == null)
                    return;
                try
                {
                    F.RemoveSection(g_objSection.ID);
                    F.Dispose();
                    bSuccess = true;
                }
                catch(Exception Err)
                {
                    string peekerror = Err.Message;
                    F.Dispose();
                    bSuccess = false;
                }
                //bSuccess = objUser.DestroyBody(g_objSection,ref ErrorNumber);
                if(bSuccess ==true)
                {

                    Status("Successfully deleted: " + g_objSection.Description);
                    cbSectionType.Items.Clear();
                    cbSectionType.Text = "";
                    LoginUser = OSystem.Refresh();
                    BuildUserHierarchy();
                    ShowDisplay(ShowGroupInfo);
                }
            }
        }
        private void mnuDestroyUser_Click(object sender, System.EventArgs e)
        {
            //User doesn't exist
            System.Windows.Forms.DialogResult DR = new System.Windows.Forms.DialogResult();
            bool bSuccess = false;
            //int ErrorNumber = 0;
            DR = System.Windows.Forms.MessageBox.Show("Destroying " + g_objUser.Description + " will permanently destroy ALL of " + g_objUser.Description + "'s Recordings and Groups! Along with every Group and Recording attached to those Groups!","Do you wish to proceed with Delete User?",System.Windows.Forms.MessageBoxButtons.YesNo);

            if(DR == DialogResult.Yes)
            {
                Status(LoginUser.Description + " gave order to proceed with deletion...");
                OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                OysterClassLibrary.Section objBody = F.GetSection(g_objUser.CurrentSectionID);
                if(objBody == null)
                    return;
                try
                {
                    F.RemoveUser(g_objUser.ID);
                    F.Dispose();
                    bSuccess = true;
                }
                catch(Exception Err)
                {
                    string peekerror = Err.Message;
                    F.Dispose();
                    bSuccess = false;
                }
                //bSuccess = objBody.DestroyUser(g_objUser,true, ref ErrorNumber);
                if(bSuccess ==true)
                {
                    Status("Permanently deleted " + g_objUser.Description + " from the entire System.");
                    cbSectionType.Items.Clear();
                    cbSectionType.Text = "";
                    LoginUser = OSystem.Refresh();
                    BuildUserHierarchy();
                    ShowDisplay(ShowGroupInfo);
                }
                else
                {
                    Status("Failed to permanently delete " + g_objUser.Description + " from the system!!!");
                    MessageBox.Show("Failed to permanently delete " + g_objUser.Description + " from the system!!!");
                }
            }
        }

        private void mnuDeleteMediaBufferServer_Click(object sender, System.EventArgs e)
        {
            DialogResult DR = new DialogResult();
            DR = MessageBox.Show(this,"This action will permanently delete Media Buffer Server: " + g_objMBS.Address,"Do you wish to delete this Media Buffer Server?",MessageBoxButtons.YesNo);
            if(DR == DialogResult.Yes)
            {
                Status(LoginUser.Description + " gave order to proceed with deletion..");
                bool bSuccess = false;
                try
                {
                    OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                    F.DeleteMediaBufferServer(g_objMBS.ID);
                    F.Dispose();
                    bSuccess = true;
                }
                catch(Exception Err)
                {
                    string peekError=Err.Message;
                    bSuccess = false;
                }
                if(bSuccess == false)
                {
                    MessageBox.Show("Delete Aborted... there are still devices connected to this Media Buffer Server");
                    Status("Delete Aborted... there are still devices connected to this Media Buffer Server");
                    return;
                }
                else
                {
                    Status("Successfully deleted Media Buffer Server: " + g_objMBS.Address);
                    LoginUser = OSystem.Refresh();
                    BuildUserHierarchy();
                    ShowDisplay(ShowVSSInfo);
                }
            }
            ShowDisplay(ShowVSSInfo);
        }

        private void mnuDeleteVSS_Click(object sender, System.EventArgs e)
        {
            if(g_objVSS == null)
            {
                TreeNode Y = treeView1.SelectedNode;
                g_objVSS = (OysterClassLibrary.VideoStorageServer)Y.Tag;
                if(g_objVSS == null) return;
            }

            DialogResult DR = new DialogResult();
            DR = MessageBox.Show(this,"This action will permanently delete Video Storage Server: " + g_objVSS.ControlAddress + ": " + g_objVSS.ControlPort,"Do you wish to delete this Video Storage Server?",MessageBoxButtons.YesNo);
            if(DR == DialogResult.Yes)
            {
                Status(LoginUser.Description + " gave order to proceed with deletion..");

                int test = g_objVSS.ID;
                try
                {
                    OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                    F.DeleteVideoStorageServer(g_objVSS.ID);
                    F.Dispose();
                    //cvosSysAdmin.DestroyVideoStorageServer(
                }
                catch(Exception Err)
                {
                    MessageBox.Show(Err.Message);
                    Status(Err.Message);
                    return;
                }

                Status("Successfully deleted Video Storage Server: " + g_objVSS.ControlAddress + ": " + g_objVSS.ControlPort);
                LoginUser = OSystem.Refresh();
                OpenToUser = 0;
                OpenToBody = 0;
                OpenToRecording = 0;
                OpenToRoom = 0;
                BuildUserHierarchy();
                ShowDisplay(ShowVSSInfo);

            }
            ShowDisplay(ShowVSSInfo);
        }

        private void mnuDeleteForwardingServer_Click(object sender, System.EventArgs e)
        {
            DialogResult DR = new DialogResult();
            DR = MessageBox.Show(this,"This action will permanently delete Forwarding Server: " + g_objFS.Address,"Do you wish to delete this Fowarding Server?",MessageBoxButtons.YesNo);
            if(DR == DialogResult.Yes)
            {
                Status(LoginUser.Description + " gave the order to proceed with deletion..");
                bool bSuccess = false;
                try
                {
                    //OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                    //TODO Create a DELETEFORWARDINGSERVER in OysterClassLibrary
                    //cvosSysAdmin.DestroyForwardingServer(g_objFS.ID);
                    //bSuccess = true;
                }
                catch(Exception Err)
                {
                    MessageBox.Show(Err.Message);
                    Status(Err.Message);
                    return;
                }
                if(bSuccess == false)
                {
                    MessageBox.Show("Delete Aborted... there are still devices connected to this Forwarding Server");
                    Status("Delete Aborted... there are still devices connected to this Forwarding Server");
                    return;
                }
                else
                {
                    Status("Successfully deleted Forwarding Server: " + g_objFS.Address);
                    LoginUser = OSystem.Refresh();
                    BuildUserHierarchy();
                    ShowDisplay(ShowVSSInfo);
                }
            }
            ShowDisplay(ShowVSSInfo);

        }

        private void mnuDeleteRecording_Click(object sender, System.EventArgs e)
        {
            DialogResult DR = new DialogResult();

            if((btnPlay.Enabled == true)||(btnPause.Enabled == true)||(btnStop.Enabled == true))
            {
                try
                {

                    MediaPlayer.Ctlcontrols.stop();

                    if(gLastRecording != "")
                    {
                        try
                        {

                            MediaPlayer.URL = "";
                        }
                        catch(Exception Err)
                        {
                            string peekerror = Err.Message;
                        }
                    }
                    btnPlay.Enabled = false;

                }
                catch(Exception Err)
                {
                    MessageBox.Show(Err.Message);
                }
                catch
                {
                }
            }

            DR = MessageBox.Show(this,"Do you wish to permanently delete Record: " + g_objRecording.DisplayName,"Deleting Recording",MessageBoxButtons.YesNo);

            if(DR == DialogResult.No)
                return;
            OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
            bool bSuccess = false;
            //NOTE: FOR OAKLAND PURPOSES ANY BODY COULD TECHNICALLY BE USED TO DESTROY A RECORDING... THIS IS ONLY TRUE
            //      BECAUSE RECORDING COPIES DO NOT EXIST IN THE SYSTEM SO THE BODYID IS NOT USED IN THE OAKLAND SYSTEM
            //      BUT FOR COMPATIBILITY SAKE THIS SOFTWARE HAS BEEN WRITTEN TO SUPPORT REMOVAL OF RECORDING COPIES THEREFORE
            //      THE FOLLOWING CODE REQUIRES THE ACTUAL BODY THAT THE RECORDING IS ATTACHED TO, BE THE BODY THAT DELETES THE
            //      THE RECORDING. ALL UNASSIGNED RECORDINGS IS IN THE USER'S DEFAULT BODY. ALL OTHER RECORDINGS ARE ATTACHED TO THE
            //      BODY THAT THE USER IS ATTACHED TO. THE FOLLOWING CODE TRAVERSES UP THE TREEVIEW TO AQUIRE THE APPROPRIATE BODY.

            TreeNode X = treeView1.SelectedNode;
            string test = X.Text;
            X = X.Parent;
            test = X.Text;
            OysterClassLibrary.Section B = F.GetSection(g_objRecording.CurrentSectionID);

            if(g_objRecording.CurrentUserID == g_objRecording.OwnerID)
            {
                try
                {
                    bool bTry = false;
                    if(DebugModeMH != true)
                    {
                        OysterClassLibrary.VideoStorageServer VideoSS = F.GetVideoStorageServer(g_objRecording.VideoStorageServerID);
                        bTry = MHClient.Connect(VideoSS.ControlAddress,(short)VideoSS.ControlPort,"root","generic",LocalIpAddress);
                    }
                    if((bTry == true)||(DebugModeMH == true))
                    {
                        try
                        {

                            try
                            {
                                F.RemoveRecording(g_objRecording.ID,g_objUser.ID,g_objCurrentSection.ID);
                                bSuccess = true;
                            }
                            catch(Exception Err)
                            {
                                string peekerror = Err.Message;
                                bSuccess = false;
                            }
                            if(bSuccess == true)
                            {
                                if(DebugModeMH != true)
                                {
                                    bSuccess = MHClient.EraseVideo(g_objRecording.Description);
                                }
                                if((bSuccess == true)||(DebugModeMH == true))
                                {
                                    LoginUser = OSystem.Refresh();
                                    BuildUserHierarchy();
                                    return;
                                }
                            }

                        }
                        catch(Exception error)
                        {
                            MessageBox.Show(error.Message);
                            return;
                        }
                    }
                    else
                    {
                        MessageBox.Show("Unable to connected to Video Storage Server: " + g_objRecording.VideoStorageServerControlAddress + ": " + g_objRecording.VideoStorageServerControlPort,"Delete Recording Aborted!");
                        return;
                    }
                }
                catch(Exception Err)
                {
                    MessageBox.Show(Err.Message);
                    return;
                }
            }
            else  // test == "Recordings" which means all we have to do is go up till we find the body it is attached to
            {
                try
                {
                    F.RemoveRecording(g_objRecording.ID,g_objRecording.CurrentUserID,g_objRecording.CurrentSectionID);
                    LoginUser = OSystem.Refresh();
                    BuildUserHierarchy();
                    return;
                }
                catch(Exception Err)
                {
                    MessageBox.Show(Err.Message);
                    return;
                }

            }
        }

        private void mnuDeleteStreamingEncoder_Click(object sender, System.EventArgs e)
        {

            if(g_objSE == null)
            {
                TreeNode Y = treeView1.SelectedNode;
                g_objSE = (OysterClassLibrary.StreamingEncoder)Y.Tag;

                if(g_objSE == null)return;
                Y = Y.Parent;
                g_objRoom = (OysterClassLibrary.Room)Y.Tag;
            }

            DialogResult DR = new DialogResult();
            DR = MessageBox.Show(this,"This action will permanently delete Streaming Encoder: " + g_objSE.ControlAddress + ": " + g_objSE.ControlPort,"Do you wish to delete this Streaming Encoder?",MessageBoxButtons.YesNo);
            if(DR == DialogResult.Yes)
            {
                OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                Status(LoginUser.Description + " gave order to proceed with deletion...");
                bool bSuccess = false;
                F.DeleteStreamingEncoder(g_objSE.ID);
                if(bSuccess == false)
                {
                    MessageBox.Show("Delete Aborted... devices exist that are dependant on this Streaming Encoder!");
                    Status("Delete Aborted... devices exist that are dependant on this Streaming Encoder!");
                    ShowDisplay(ShowRoomInfo);
                    return;
                }
                else
                {
                    Status("Delete Streaming Encoder: " + g_objSE.ControlAddress + ": " + g_objSE.ControlPort);
                    LoginUser = OSystem.Refresh();
                    OpenToUser = 0;
                    OpenToBody = 0;
                    OpenToRecording = 0;
                    OpenToRoom = g_objRoom.ID;
                    BuildUserHierarchy();
                    ShowDisplay(ShowRoomInfo);
                }
            }
            ShowDisplay(ShowRoomInfo);
        }

        private void mnuDeleteCardSwipe_Click(object sender, System.EventArgs e)
        {

            if(g_objCS == null)
            {
                TreeNode Y = treeView1.SelectedNode;
                g_objCS = (OysterClassLibrary.CardReader)Y.Tag;

                if(g_objCS == null)return;
                Y = Y.Parent;
                g_objRoom = (OysterClassLibrary.Room)Y.Tag;
            }

            DialogResult DR = new DialogResult();
            DR = MessageBox.Show(this,"This action will permanently delete Card Reader: " + g_objCS.Address,"Do you wish to delete this Card Reader?",MessageBoxButtons.YesNo);
            if(DR == DialogResult.Yes)
            {
                OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();

                Status(LoginUser.Description + " gave order to proceed with deletion...");
                bool bSuccess = false;
                try
                {
                    F.DeleteCardReader(g_objCS.ID);
                    bSuccess = true;
                }
                catch(Exception Err)
                {
                    string peekerror = Err.Message;
                    bSuccess = false;
                }

                if(bSuccess == false)
                {
                    MessageBox.Show("Delete Aborted... there are still devices connected to this Card Reader");
                    Status("Delete Aborted... there are still devices connected to this Card Reader");
                    ShowDisplay(ShowRoomInfo);
                    return;
                }
                else
                {
                    Status("Successfully deleted Card Reader:" + g_objCS.Address);
                    LoginUser = OSystem.Refresh();
                    OpenToUser = 0;
                    OpenToBody = 0;
                    OpenToRecording = 0;
                    OpenToRoom = g_objRoom.ID;
                    BuildUserHierarchy();
                    ShowDisplay(ShowRoomInfo);
                }
            }
            ShowDisplay(ShowRoomInfo);
        }

        private void mnuRemoveUsers_Click(object sender, System.EventArgs e)
        {
            DialogResult DR = new DialogResult();
            OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
            OysterClassLibrary.SectionType UT = F.GetSectionType(g_objSection.CreatedBySectionType.NextSectionTypeID);

            DR = MessageBox.Show(this,"You have the authority to permanently Remove any " + UT.Description  + " in this " + g_objSection.CreatedBySectionType.CreatesSectionTypeDescription + " . For each " + UT.Description  + " that you delete all of that " + UT.Description  + "'s Recordings will also be permanently deleted!","Show Delete " + UT.Description  + "(s) Screen?",MessageBoxButtons.YesNo);
            if(DR == DialogResult.No)
                return;

            Form RU = new RemoveUsers();

            g_OAU.AllUsers = null;
            g_OAU.CurrentUser = null;
            g_OAU.CurrentBody = g_objSection;
            g_OAU.ThisCurrentSectionType = g_objSection.CreatedBySectionType;
            g_OAU.TrueDelete = false;
            g_OAU.iLocalMBSAddress = LocalIpAddress;

            RU.Tag = g_OAU;

            RU.ShowDialog(this);

            if(RU.DialogResult == DialogResult.OK)
            {
                AdministrativeSoftware.RemoveUsers.User_List UL = (AdministrativeSoftware.RemoveUsers.User_List) RU.Tag;
                foreach(string sUser in UL.DeletedUsers)
                    Status("Removed User: "******" has aborted Remove User operation.");
                RU.Dispose();
            }
        }

        private void mnuDeleteUsers_Click(object sender, System.EventArgs e)
        {
            DialogResult DR = new DialogResult();

            DR = MessageBox.Show(this,"You have the authority to permanently delete any User in the System! For each User that you delete all of that User's Recordings will also be permanently deleted!","Show Delete User(s) Screen?",MessageBoxButtons.YesNo);
            if(DR == DialogResult.No)
                return;
            Status(g_objUser.Description + " is preparing to delete users....");
            Form RU = new RemoveUsers();

            g_OAU.AllUsers = OSystem.CurrentSystemUsers;
            g_OAU.CurrentUser = LoginUser;
            g_OAU.CurrentBody = null;
            g_OAU.ThisCurrentSectionType = LoginUser.HighestAuthorityLevel;
            g_OAU.TrueDelete = true;

            RU.Tag = g_OAU;
            RU.ShowDialog(this);

            if(RU.DialogResult == DialogResult.OK)
            {
                AdministrativeSoftware.RemoveUsers.User_List UL = (AdministrativeSoftware.RemoveUsers.User_List) RU.Tag;
                foreach(string sUser in UL.DeletedUsers)
                    Status("Permanently deleted User: "******" has aborted Delete User operation.");
                RU.Dispose();
            }
        }

        private void mnuDestroyRoom_Click(object sender, System.EventArgs e)
        {
            bool bSuccess = false;
            System.Windows.Forms.DialogResult DR = new System.Windows.Forms.DialogResult();
            DR = System.Windows.Forms.MessageBox.Show("This action will permanently delete this room and all devices attached to it!","Destroy Room?",System.Windows.Forms.MessageBoxButtons.YesNo);
            if(DR == DialogResult.Yes)
            {
                Status(LoginUser.Description + " gave order to proceed with deletion..");
                try
                {
                    OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                    F.DeleteRoom(g_objRoom.ID);
                    bSuccess = true;
                }
                catch(Exception Err)
                {
                    string peekerror = Err.Message;
                    bSuccess = false;
                }
                if(bSuccess == true)
                {
                    LoginUser = OSystem.Refresh();
                    OpenToBody = 0;
                    OpenToUser = 0;
                    OpenToRecording = 0;
                    OpenToRoom = 0;
                    BuildUserHierarchy();
                    ShowDisplay(ShowRoomInfo);
                }
            }
            else
            {
                Status("Failed to Delete Room: " + g_objRoom.Description);

            }
        }
        private void mnuRecordingDetails_Click(object sender, System.EventArgs e)
        {
            ShowDisplay(ShowRecordingInfo);
            lbRecordingInfo.Text= "Viewing Recording Information";
            //Disable Controls
            MediaPlayer.Visible = false;
            btnPlay.Enabled = false;
            btnPause.Enabled = false;
            btnStop.Enabled = false;
            btnReverse.Enabled = false;
            btnForward.Enabled = false;

            pnlMediaPlayer.Visible =true;
            btnPlay.Visible =false;
            btnPause.Visible = false;
            btnStop.Visible = false;
            btnForward.Visible = false;
            btnReverse.Visible = false;

            tbRecordingName.Visible = true;
            tbRecordingName.Text = g_objRecording.Description;
            lbRecordingName.Visible = true;
            tbRecordingName.ReadOnly = true;
            tbRecordingDisplayName.Visible = true;
            tbRecordingDisplayName.Text = g_objRecording.DisplayName;
            tbRecordingVSS.Visible = true;
            if(g_objRecording.VideoStorageServerControlAddress == "Not Assigned")
                tbRecordingVSS.Text = "Not Assigned";
            else
                tbRecordingVSS.Text = g_objRecording.VideoStorageServerControlAddress + ": " + g_objRecording.VideoStorageServerControlPort;
            tbRecordingSE.Visible = true;
            if(g_objRecording.StreamingEncoderControlAddress == "Not Assigned")
                tbRecordingSE.Text = "Not Assigned";
            else
                tbRecordingSE.Text = g_objRecording.StreamingEncoderControlAddress + ": " + g_objRecording.StreamingEncoderControlPort;
            tbRecordingCreated.Visible = true;
            tbRecordingCreated.Text = g_objRecording.CreatedDate.ToString();
            cbVSS.Items.Clear();
            cbVSS.Visible = false;
            lbVSS.Visible = true;
            lbRecordingSE.Visible = true;
            lbRecordingCreated.Visible = true;
            lbRecordingDisplayName.Visible = true;
            btnRecordingFinished.Visible = false;
            btnRecordingFinished.Enabled = false;
            btnRecordingCancel.Visible = false;
            btnRecordingCancel.Enabled = false;
        }

        // //////////////Menu Items -- MOVE
        private void mnuMoveUser_Click(object sender, System.EventArgs e)
        {
            treeView1.DoDragDrop(g_objUser,DragDropEffects.Copy);
        }

        private void mnuMoveNode_Click(object sender, System.EventArgs e)
        {
            bCancelDrag = false;
            string test;
            treeView1.DoDragDrop(g_Node,DragDropEffects.Move);
            test = g_Node.Text;
        }

        */
        // //////////// Helper Functions
        private void GatherAllBodys(ListView LV, OysterClassLibrary.Users MyUsers)
        {
            foreach(OysterClassLibrary.User NewUser in MyUsers)
            {
                foreach(OysterClassLibrary.Section NewBody in NewUser.NextOwnedSections)
                {
                    if(NewBody.IsDefault != true)
                    {
                        bool AddIt = true;
                        foreach(ListViewItem LVI in LV.Items)
                        {
                            OysterClassLibrary.Section S = (OysterClassLibrary.Section)LVI.Tag;

                            if((S.ID == NewBody.ID)||(S.IsDefault))
                            {
                                AddIt = false;
                            }
                        }
                        if(AddIt)
                        {
                            ListViewItem LI = LV.Items.Add(NewBody.Description);
                            LI.Tag = NewBody;
                            GatherAllBodys(LV,NewBody.CurrentUsers);
                        }
                    }
                }
            }
        }
Example #3
0
        //public void RecursiveDisplay(OysterClassLibrary.Section DrawBody, ref TreeNode NodeX, OysterClassLibrary.SectionType MyCurrentSectionType)
        public void RecursiveDisplay(OysterClassLibrary.Section DrawSection, ref TreeNode NodeX, OysterClassLibrary.SectionType MyCurrentSectionType)
        {
            OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();

            if(DrawSection.IsDefault == false)
            {

                TreeNode NodeBody = NodeX.Nodes.Add(DrawSection.Description);

                string testme = DrawSection.Description;
                NodeBody.Tag = DrawSection;
                NodeBody.ImageIndex = 1;
                NodeBody.SelectedImageIndex =1;
                NodeBody.ForeColor = System.Drawing.Color.DarkBlue;
                if((g_SelectedAnItem == false)&&(DrawSection.CreatedBySectionType.ID != OSystem.SectionTypeSysAdmin.ID))
                {
                    g_SelectedAnItem = true;
                    treeView1.SelectedNode = NodeBody;
                    NodeBody.EnsureVisible();
                    MouseEventArgs A = new MouseEventArgs(MouseButtons.Left,1,1,1,0);
                    treeView1_MouseUp(treeView1,A);
                }

                if(OpenToBody == DrawSection.ID)
                {
                    NodeBody.EnsureVisible();
                    treeView1.SelectedNode = NodeBody;
                    g_objSection = DrawSection;
                }
                //bool DidOnce = false;

                foreach(OysterClassLibrary.User DrawUser in DrawSection.CurrentUsers)
                {
                    TreeNode NodeUser = null;
                    int[] UO = OSystem.UnassignedIDs;

                    if(UO[0]== DrawUser.ID)
                    {
                        NodeUser = NodeBody.Nodes.Add(DrawUser.Description);
                        NodeUser.ForeColor = System.Drawing.Color.Red;
                        NodeUser.NodeFont = new Font("Arial",10,FontStyle.Bold);
                    }
                    else
                    {
                        NodeUser = NodeBody.Nodes.Add(DrawUser.Description);
                        NodeUser.ForeColor = System.Drawing.Color.Black;
                        NodeUser.NodeFont = new Font("Arial",10,FontStyle.Regular);
                    }

                    string test = DrawUser.Description;

                    test = DrawUser.CurrentSectionID.ToString();

                    NodeUser.Tag = DrawUser;

                    NodeUser.ImageIndex = 0;
                    NodeUser.SelectedImageIndex = 0;
                    if(OpenToUser == DrawUser.ID)
                    {
                        //    NodeUser.EnsureVisible();
                        treeView1.SelectedNode = NodeUser;
                        g_objUser = DrawUser;
                    }

                    OysterClassLibrary.SectionType UT =  F.GetSectionType(DrawSection.CreatedBySectionType.NextSectionTypeID);
                    TreeNode NodeLabel = null;

                    //if((DrawSection.CurrentRecordings.Count > 0)||(DrawUser.NextOwnedSections.Count > 0))
                    if(DrawUser.NextOwnedSections.Count > 0)
                    {
                        NodeLabel = new TreeNode();
                        NodeLabel = NodeUser.Nodes.Add(UT.Description);
                        NodeLabel.ImageIndex = 8;
                        NodeLabel.SelectedImageIndex = 8;
                    }
                    else
                    {

                        // NodeLabel = NodeUser.Nodes.Add("No Recordings");
                    }
                    //TreeNode NodeLabel = NodeLabel.Nodes.Add(DrawUser.Description);

                    foreach(OysterClassLibrary.Section B in DrawUser.NextOwnedSections)
                    {
                        OysterClassLibrary.SectionType prevUT = F.GetSectionType(B.CreatedBySectionType.PreviousSectionTypeID);

                        RecursiveDisplay(B,ref NodeLabel,prevUT);
                    }
                    //						RecursiveDisplay(DrawUser.Bodys,NodeUser);
                    if(DrawSection.CurrentRecordings.Count > 0)
                    {
                        bool drawonce = false;
                        testme = DrawSection.CurrentRecordings.Count.ToString();
                        //NodeRT.NodeFont = new Font("Arial",10,FontStyle.Bold);
                        TreeNode NodeRT = new TreeNode();

                        //IF Recording Sessions go ahead and prepare to draw
                        ListView lvSessions = new ListView();
                        foreach(OysterClassLibrary.Recording R in DrawSection.CurrentRecordings)
                        {
                            bool DoesHaveCopy = F.HasInstanceOfRecording(DrawUser.ID,R.ID,DrawSection.ID);
                            if(DoesHaveCopy == true)
                            {
                                if(R.SessionID != "")
                                {
                                    foreach(ListViewItem LVI in lvSessions.Items)
                                    {
                                        if(LVI.Text == R.SessionName)
                                            goto SkipItem;
                                    }

                                    ListViewItem LCI = lvSessions.Items.Add(R.SessionName);
                                    LCI.Tag = R.SessionID;

                                }
                            SkipItem:{}
                            }
                        }
                        TreeNode[] NodeSessions = new TreeNode[lvSessions.Items.Count];
                        int SessionCount = 0;

                        //End Recording Session Preparation

                        foreach(OysterClassLibrary.Recording DrawRecording in DrawSection.CurrentRecordings)
                        {
                            bool DoesHaveCopy = F.HasInstanceOfRecording(DrawUser.ID,DrawRecording.ID,DrawSection.ID);
                            if(DoesHaveCopy == true)
                            {

                                if(drawonce == false)
                                {
                                    drawonce = true;
                                    NodeRT = NodeUser.Nodes.Add("Recordings");
                                    NodeRT.ForeColor = System.Drawing.Color.DarkSlateBlue;
                                    NodeRT.ImageIndex = 6;
                                    NodeRT.SelectedImageIndex = 6;
                                    OysterClassLibrary.StreamingEncoder SE = OSystem.GetStreamingEncoderById(DrawRecording.StreamingEncoderID);
                                    foreach(ListViewItem LVI in lvSessions.Items)
                                    {
                                        NodeSessions[SessionCount] = NodeRT.Nodes.Add(LVI.Text);
                                        NodeSessions[SessionCount].ImageIndex = 3;
                                        NodeSessions[SessionCount].Tag = SE.CurrentRoom;
                                        NodeSessions[SessionCount].ImageIndex = 2;
                                        NodeSessions[SessionCount].SelectedImageIndex = 2;
                                        SessionCount++;
                                    }

                                }
                                //DrawRecording.BodyId = DrawBody.ID;
                                //                                if(DrawRecording.DisplayName == null)
                                //                                    DrawRecording.DisplayName = DrawRecording.Created.ToString();

                                TreeNode NodeRecording = new TreeNode();
                                if(DrawRecording.SessionID == "")
                                {
                                    NodeRecording = NodeRT.Nodes.Add(DrawRecording.DisplayName);
                                }
                                else
                                {
                                    for(int a=0; a < SessionCount;a++)
                                    {
                                        if(DrawRecording.SessionName == NodeSessions[a].Text)
                                            NodeRecording = NodeSessions[a].Nodes.Add(DrawRecording.DisplayName);
                                    }
                                }
                                if(DrawRecording.IsReady)
                                    NodeRecording.Tag = DrawRecording;
                                else
                                    NodeRecording.ForeColor = Color.Gray;
                                NodeRecording.ImageIndex = 3;
                                NodeRecording.SelectedImageIndex = 3;
                                NodeRecording.NodeFont = new Font("Arial",10,FontStyle.Regular);
                                if(OpenToRecording == DrawRecording.ID)
                                {
                                    //  NodeRecording.EnsureVisible();
                                    treeView1.SelectedNode = NodeRecording;
                                    g_objRecording = DrawRecording;
                                }
                            }
                        }
                        //						if( NodeLabel != null)
                        //                            NodeLabel.Nodes.Add(NodeRT);
                        //                        else if(NodeRT.Nodes.Count > 0)
                        //                            NodeUser.Nodes.Add(NodeRT);

                    }
                }

            }
            else
            {

                //                    foreach(OysterClassLibrary.Permission P in MyCurrentSectionType.CanViewUnassignedRecordings)
                //                    {
                //                        string testme = P.CanOperateOn.ToString();
                //
                //                        if((DrawBody.CreatedBySectionType.ID == P.CanOperateOn)&&(DrawBody.OwnerID != cvosUser.ID))
                //OAKLAND SPECIFIC CODE THAT ALLOWS ONLY SYSTEM ADMIN OR ADMIN TO VIEW UNASSIGNED RECORDINGS
                if(LoginUser.HighestAuthorityLevel.CanViewUnassignedRecordings.Count > 0)
                {
                    string testme = MyCurrentSectionType.Description;
                    if((DrawSection.CurrentRecordings.Count > 0)&&(DrawSection.OwnerID != LoginUser.ID))
                    {
                        //THIS LITTLE SECTION IS OAKLAND SPECIFIC.. THAT IS BECAUSE I HAD TOOO
                        TreeNode NodeURT = new TreeNode();
                        //                        if(DrawBody.CreatedBySectionType.ID == OSystem.SectionTypeSysAdmin.NextSectionTypeID)
                        //                        {
                        //                            NodeURT= NodeX.Nodes.Add("Recordings");
                        //                            NodeURT.ForeColor = Color.DarkBlue;
                        //                        }
                        //                        else
                        //                        {
                        NodeURT= NodeX.Nodes.Add("Unassigned Recordings");
                        NodeURT.ForeColor = Color.Brown;
                        NodeURT.ImageIndex = 6;
                        NodeURT.SelectedImageIndex = 6;

                        //                        }
                        //IF Recording Sessions go ahead and prepare to draw
                        ListView lvSessions = new ListView();
                        foreach(OysterClassLibrary.Recording R in DrawSection.CurrentRecordings)
                        {
                            if(R.SessionID != null)
                            {
                                foreach(ListViewItem LVI in lvSessions.Items)
                                {
                                    if(LVI.Text == R.SessionName)
                                        goto SkipItem;
                                }

                                ListViewItem LGI = lvSessions.Items.Add(R.SessionName);
                                LGI.Tag = R.SessionID;

                            }
                        SkipItem:{}
                        }
                        TreeNode[] NodeSessions = new TreeNode[lvSessions.Items.Count];
                        int SessionCount = 0;

                        foreach(ListViewItem LVI in lvSessions.Items)
                        {
                            //OysterClassLibrary.StreamingEncoder SE = OSystem.GetStreamingEncoderById(R.StreamingEncoderID);

                            NodeSessions[SessionCount] = NodeURT.Nodes.Add(LVI.Text);
                            NodeSessions[SessionCount].ImageIndex = 2;
                            NodeSessions[SessionCount].SelectedImageIndex = 2;
                            NodeSessions[SessionCount].Tag =  LVI.Tag;
                            SessionCount++;
                        }

                        //End Recording Session Preparation

                        foreach(OysterClassLibrary.Recording DrawRecording in DrawSection.CurrentRecordings)
                        {
                            // bool DoesOwnCopy = F.HasInstanceOfRecording(DrawSection.OwnerID,DrawRecording.ID,DrawSection.ID);
                            if(true)// if(DoesOwnCopy == true)
                            {
                                //DrawRecording.BodyId = DrawBody.ID;
                                //                                if(DrawRecording.DisplayName == null)
                                //                                    DrawRecording.DisplayName = DrawRecording.Created.ToString();

                                TreeNode NodeRecording = new TreeNode();
                                if(DrawRecording.SessionID == null)
                                {
                                    NodeRecording = NodeURT.Nodes.Add(DrawRecording.DisplayName);
                                }
                                else
                                {
                                    for(int a=0; a < SessionCount;a++)
                                    {
                                        if(DrawRecording.SessionName == NodeSessions[a].Text)
                                            NodeRecording = NodeSessions[a].Nodes.Add(DrawRecording.DisplayName);
                                    }
                                }

                                if(DrawRecording.IsReady)
                                    NodeRecording.Tag = DrawRecording;
                                else
                                    NodeRecording.ForeColor = Color.Gray;

                                NodeRecording.ImageIndex = 3;
                                NodeRecording.SelectedImageIndex = 3;

                                //NodeRecording.ForeColor = System.Drawing.Color.Brown;
                                NodeRecording.NodeFont = new Font("Arial",10,FontStyle.Regular);

                                if(OpenToRecording == DrawRecording.ID)
                                {
                                    //     NodeRecording.EnsureVisible();
                                    treeView1.SelectedNode = NodeRecording;
                                    g_objRecording = DrawRecording;
                                }
                            }
                        }
                    }
                    // else {TreeNode NodeURT = NodeX.Nodes.Add("No Unassigned Recordings");}
                }
            }
            F.Dispose();
        }
        private void GetThisRecording(string TargetDirectory, ref OysterClassLibrary.Recording CR)
        {
            string SafeName = "";
            string[] ThisFileName = CR.Description.Split('.');
            string sExt = "";

            if (ThisFileName.Length == 1)
                sExt = ".";
            else
                sExt = "." + ThisFileName[ThisFileName.Length - 1];

            SafeName = GetSafeNonDuplicateFilename(CR.DisplayName, TargetDirectory);

            //Setup the Current File Progress Bar Maximum
            pbCBar.Maximum = Convert.ToInt32(CurrentFileSize);
            pbCBar.Minimum = 0;
            pbCBar.Value = 0;

            MyGlobals.Logger.WriteLog("Getting wmv file: {0}", CR.Description);

            string localFileName = Path.Combine(TargetDirectory, SafeName);
            MyGlobals.Logger.WriteLog("Downloading {1} to {0}.", localFileName, CR.Description);

            _isDownloadingCurrentFile = true;
            IAsyncResult asyncResult = FtpSession.BeginGetFile(CR.Description, localFileName,
                new AsyncCallback(TransferComplete), CR);

            while (!asyncResult.IsCompleted)
            {
                Application.DoEvents();
                Thread.Sleep(100);
            }
            //asyncResult.AsyncWaitHandle.WaitOne();

            TotalBytesFromCompletedTransfers += FtpSession.EndGetFile(asyncResult);
            Application.DoEvents();

            CR.DownloadedName = localFileName;
            CR.IsDownloaded = true;
        }
Example #5
0
        void MakeXMLFile(string[] MPEGPathName, string XMLPath, OysterClassLibrary.User User, OysterClassLibrary.StreamingEncoder StreamingEncoder)
        {
            OysterClassLibrary.Oyster oyster = new OysterClassLibrary.Oyster();
            OysterClassLibrary.User usr = User;
            OysterClassLibrary.StreamingEncoder se = StreamingEncoder;
            OysterClassLibrary.Recording rec;
            bool bMakeSession = false, bFirstTime = true;
            string sSessionId = Guid.NewGuid().ToString(), sSessionName = "";

            FileInfo fiMPEG;

            if (chkSingleSession.Checked)
            {
                bMakeSession = true;
            }

            int i = 0;
            foreach (string mpegfile in MPEGPathName)
            {
                fiMPEG = new FileInfo(mpegfile);
                if (string.Compare(fiMPEG.Extension,".mpg",true) != 0)
                {
                    MessageBox.Show("All MPEG files must have a .mpg extension. Stopping.");
                    break;
                }
                string sDisplayName = fiMPEG.CreationTime.ToString("MM/dd/yyyy hh:mm tt");
                string sRecordingName;

                if (bFirstTime)
                {
                    bFirstTime = false;
                    sSessionName = sDisplayName;
                }
                if (bMakeSession)
                {
                    sRecordingName = "Camera " + (char) ('A' + i++);
                }
                else
                    sRecordingName = sDisplayName;
                string sFileTitle = fiMPEG.Name.Substring(0,fiMPEG.Name.Length - 4);
                rec = oyster.GetRecordingByName(sFileTitle + ".wmv");
                if (rec != null)
                {
                    if (MessageBox.Show(this,sFileTitle + ".wmv is already in the database. Delete it and continue?",
                        "Recording Already Exists...",MessageBoxButtons.YesNo)
                        == DialogResult.Yes)
                    {
                        oyster.DeleteRecordingById(rec.ID);
                    }
                    else
                    {
                        MessageBox.Show("Cannot continue with an already existing recording. Stopping.");
                        break;
                    }
                }
                // make a recording in the db for this user with this name in this room
                if (bMakeSession)
                {
                    rec = oyster.CreateRecording(sFileTitle + ".wmv",sRecordingName,usr.ID,
                        se.CurrentRoom.VideoStorageServerID,se.ID,sSessionId,sSessionName);
                }
                else
                {
                    rec = oyster.CreateRecording(sFileTitle + ".wmv",sRecordingName,usr.ID,
                        se.CurrentRoom.VideoStorageServerID,se.ID,null,null);
                }
                if (rec == null)
                {
                    MessageBox.Show("Recording " + sFileTitle + " could not be created. Stopping.");
                    break;
                }
                // make the xml file for this recording
                CarverLab.Utility.CARDVIDEO cv = new CarverLab.Utility.CARDVIDEO();
                System.Xml.Serialization.XmlSerializer xmlser = new System.Xml.Serialization.XmlSerializer(typeof(CarverLab.Utility.CARDVIDEO));
                System.IO.StreamWriter xmlfile = System.IO.File.CreateText(
                    XMLPath + @"\" + sFileTitle + ".xml");

                cv.FILENAME = mpegfile;
                cv.CARDID = usr.CardNumber;
                cv.DISPLAYNAME = sRecordingName;
                cv.FILETITLE = sFileTitle;
                cv.ROOMID = se.CurrentRoom.ID;
                cv.STREAMINGENCODERID = se.ID;
                cv.TIMESTART = DateTime.Now;
                cv.VIDEOSTORAGESERVERID = se.CurrentRoom.VideoStorageServerID;
                if (bMakeSession)
                {
                    cv.SESSIONID = sSessionId;
                    cv.SESSIONNAME = sSessionName;
                }
                xmlser.Serialize(xmlfile,cv);
            }
            MessageBox.Show(this,"Done.");
        }
Example #6
0
        private bool CheckForValidLicense(OysterClassLibrary.User LU)
        {
            try
            {
                System.Diagnostics.Process CurrentProcess = System.Diagnostics.Process.GetCurrentProcess();
                UInt32 uiUserSessionID = 0;
                ProcessIdToSessionId(Convert.ToUInt32(CurrentProcess.Id),out uiUserSessionID);
                //UInt32 LastWindowsSessionID = 0;
            //				string LastApplicationID = "0";
                //GetSessionToken(out LastWindowsSessionID, out LastApplicationID);
            //				if(LastWindowsSessionID == 0)
            //				{
            //					LastWindowsSessionID = uiUserSessionID;
            //				}
                string sComputerName = System.Net.Dns.GetHostName();

                string iLWSID = sComputerName + ":" + uiUserSessionID.ToString();
            //				UserLicense = OSystem.AcquireProductLoginLicense("Executive",LU.ID);
                UserLicense = OSystem.AcquireProductLoginLicense("Executive",LU.ID,iLWSID,m_csApplicationUniqueIdentifier);
            }
            catch(OysterClassLibrary.OysterLicenseException Err)
            {
                MessageBox.Show(Err.Message);
                return false;
            }
            return true;
        }
Example #7
0
 public AUser(string sName, OysterClassLibrary.User user)
 {
     m_sName = sName;
     m_User = user;
 }
Example #8
0
		private bool CheckForValidLicense(OysterClassLibrary.User LU)
		{
#if USE_LICENSING
			try
			{
				System.Diagnostics.Process CurrentProcess = System.Diagnostics.Process.GetCurrentProcess();
				UInt32 uiUserSessionID = 0;
				ProcessIdToSessionId(Convert.ToUInt32(CurrentProcess.Id),out uiUserSessionID);
				
				string sComputerName = System.Net.Dns.GetHostName();
				string iLWSID = sComputerName + ":" + uiUserSessionID.ToString();				
				UserLicense = OSystem.AcquireProductLoginLicense("Hardcopy",LU.ID,iLWSID,m_csApplicationUniqueIdentifier);
			}
			catch(OysterClassLibrary.OysterLicenseException Err)
			{
				MessageBox.Show(Err.Message);
				return false;
			}
#endif
			return true;
		}