Exemple #1
0
        private void frmAddRecording_Load(object sender, System.EventArgs e)
        {
            if(this.Owner is System_Properties)
            {
                FrmSP = (System_Properties)this.Owner;
                frm1 = (Form1)FrmSP.Owner;
            }
            else if(this.Owner is frmGroups)
            {
                frmGroups FrmGps = (frmGroups)this.Owner;
                frm1 = (Form1)FrmGps.Owner;
            }
            else
            {
                MessageBox.Show("Recordings must be called by either System_Properties or Groups");
                this.DialogResult = DialogResult.Abort;
                return;
            }
            oclGroup = (OysterClassLibrary.Group)this.Tag;

            OysterClassLibrary.Recordings AR = frm1.LoginUser.AllRecordings;

            foreach(OysterClassLibrary.Recording R in AR)
            {
                if(R.OwnerID == frm1.LoginUser.ID)
                {
                    foreach(OysterClassLibrary.Recording IR in oclGroup.CurrentRecordings)
                    {
                        if(IR.ID == R.ID)
                        {
                            //Skip the addition of the current recording because it is already in the group
                            goto skipme;
                        }
                    }
                    ListViewItem LVI = lvRecordings.Items.Add(R.DisplayName);
                    if(R.SessionName != "")
                        LVI.SubItems.Add(R.SessionName);
                    else
                        LVI.SubItems.Add("N/A");

                    LVI.Tag = R;
                    bool AddItem = true;
                    foreach(ListViewItem LI in lvSessions.Items)
                    {
                        string SessionID = (string)LI.Tag;

                        if(SessionID == R.SessionID)
                        {
                            AddItem = false;
                            break;
                        }
                    }
                    if(AddItem == true)
                    {
                        if(R.SessionID != "")
                        {
                            ListViewItem lstItem = lvSessions.Items.Add(R.SessionName);
                            lstItem.SubItems.Add(R.CreatedDate.ToString());
                            lstItem.Tag = R.SessionID;
                        }
                    }
                }
            //Skips the adding of the current recording because it is already in the group
            skipme:{}
            }
            LISTVIEW_COLUMN_ORGANIZER(lvRecordings,new System.Windows.Forms.ColumnClickEventArgs(2));
            LISTVIEW_COLUMN_ORGANIZER(lvSessions,new System.Windows.Forms.ColumnClickEventArgs(1));
        }
Exemple #2
0
 private void mnuSystem_Click(object sender, System.EventArgs e)
 {
     System_Properties SP = new System_Properties();
     PassOysterSystemData POSD = new PassOysterSystemData();
     //POSD.LoginUser = LoginUser;
     //POSD.OSystem = OSystem;
     //SP.Tag = POSD;
     SP.ShowDialog(this);
     BuildUserHierarchy();
     BuildCameraView();
 }
Exemple #3
0
        private void toolBarMain_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            switch(e.Button.Text)
            {
                case "Users":
                    BuildUserHierarchy();
                    break;
                case "System":
                    System_Properties SP = new System_Properties();
                    PassOysterSystemData POSD = new PassOysterSystemData();
                    POSD.LoginUser = LoginUser;
                    POSD.OSystem = OSystem;
                    SP.Tag = POSD;
                    SP.ShowDialog(this);
                    break;
                case "Help":
                    //ShowDisplay(ShowHelpInfo);
                    if(FRMHelp != null)
                    {
                        if(FRMHelp.Visible == true)
                        {
                            if(FRMHelp.WindowState == FormWindowState.Minimized)
                                FRMHelp.WindowState = FormWindowState.Normal;
                            else
                                FRMHelp.WindowState = FormWindowState.Minimized;
                        }
                        else
                        {
                            FRMHelp.Dispose();
                            FRMHelp = new frmHelp();
                            FRMHelp.Show();
                        }

                        FRMHelp.Focus();
                    }
                    else
                    {
                        FRMHelp = new frmHelp();
                        FRMHelp.Show();
                    }
                    break;
                case "Log Off":
                    frmLogOff DR = new frmLogOff();
                    DR.ShowDialog(this);
                    if(DR.DialogResult == DialogResult.Cancel)
                    {
                        return;
                    }

                    if(OSystem != null)
                        OSystem.ReleaseResources();
                    //                    if(LoginUser != null)
                    //                        LoginUser.ReleaseCameras();
                    Application.Exit();
                    break;
                default :
                    //MessageBox.Show("This feature has not yet been implement.");
                    break;
            }
            tbActionBar.Buttons[0].Visible = false;
            tbActionBar.Buttons[1].Visible = false;
            tbActionBar.Buttons[2].Visible = false;
            tbActionBar.Buttons[3].Visible = false;
            tbActionBar.Buttons[4].Visible = false;
            tbActionBar.Buttons[5].Visible = false;
            tbActionBar.Buttons[6].Visible = false;
        }
Exemple #4
0
        private void frmGroupWizard_Load(object sender, System.EventArgs e)
        {
            if(this.Tag is OysterClassLibrary.Group)
            {
                G = (OysterClassLibrary.Group)this.Tag;
                this.Text = "Rename Group: " + G.Description;
                tbDescription.Text = G.Description;
            }
            else if(this.Tag is bool)
            {
                IsPublicAccess = (bool)this.Tag;
                if(IsPublicAccess == true)
                {
                    this.Text = "Creating New Public Group";
                }
                else
                    this.Text = "Creating New Private Group";
            }
            else
                this.Text = "Creating New Private Group";

            if(this.Owner is System_Properties)
            {
                FrmParent = (System_Properties)this.Owner;
                frm1 = (Form1)FrmParent.FrmParent;
            }
            else
            {
                MessageBox.Show("This form must be called from the System_Properties Window!","Invalid call to form...closing");
                this.DialogResult = DialogResult.Abort;
                return;
            }
        }