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 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;
            }
        }