Ejemplo n.º 1
0
 private void btnNewPubGroup_Click(object sender, System.EventArgs e)
 {
     FrmParent.PostActivity();
     frmGroupWizard GW = new frmGroupWizard();
     GW.Tag = true;
     DialogResult DR = GW.ShowDialog(this);
     if(DR == DialogResult.OK)
     {
         FrmParent.LoginUser = FrmParent.OSystem.Refresh();
         if(FrmParent.LoginUser.HighestAuthorityLevel.ID == FrmParent.OSystem.SectionTypeSysAdmin.ID)
         {
             lvPublic.Items.Clear();
             foreach(OysterClassLibrary.Group G in FrmParent.OSystem.GetALLGroups(false))
             {
                 bool PubOnce = false;
                 if(G.IsPublicAccess == true)
                 {
                     ListViewItem pubLVI = lvPublic.Items.Add(G.Description);
                     pubLVI.Tag = G;
                     if(PubOnce == false)
                     {
                         PubOnce = true;
                         pubLVI.Selected = true;
                         lvPublic_SelectedIndexChanged(lvPublic,new EventArgs());
                     }
                 }
             }
         }
         else
         {
             lvPublic.Items.Clear();
             foreach(OysterClassLibrary.Group G in FrmParent.LoginUser.CurrentGroups)
             {
                 bool PubOnce = false;
                 if(G.IsPublicAccess == true)
                 {
                     ListViewItem pubLVI = lvPublic.Items.Add(G.Description);
                     pubLVI.Tag = G;
                     if(PubOnce == false)
                     {
                         PubOnce = true;
                         pubLVI.Selected = true;
                         lvPublic_SelectedIndexChanged(lvPublic,new EventArgs());
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void btnPublicRenameGroup_Click(object sender, System.EventArgs e)
        {
            FrmParent.PostActivity();
            if(lvPublic.SelectedItems.Count == 0)
            {
                MessageBox.Show("You must first select the Group you wish to rename","No Group Selected");
                return;
            }
            OysterClassLibrary.Group Gp = (OysterClassLibrary.Group)lvPublic.SelectedItems[0].Tag;

            frmGroupWizard GW = new frmGroupWizard();
            GW.Tag = Gp;
            DialogResult DR = GW.ShowDialog(this);

            if(DR == DialogResult.OK)
            {
                FrmParent.LoginUser = FrmParent.OSystem.Refresh();
                lvPublic.Items.Clear();
                if(FrmParent.LoginUser.HighestAuthorityLevel.ID == FrmParent.OSystem.SectionTypeSysAdmin.ID)
                {

                    foreach(OysterClassLibrary.Group G in FrmParent.OSystem.GetALLGroups(false))
                    {

                        if(G.IsPublicAccess == true)
                        {
                            ListViewItem pubLVI = lvPublic.Items.Add(G.Description);
                            pubLVI.Tag = G;
                            if(G.ID == Gp.ID)
                            {

                                pubLVI.Selected = true;
                                lvPublic_SelectedIndexChanged(lvPublic,new EventArgs());
                            }
                        }
                    }
                }
                else
                {
                    foreach(OysterClassLibrary.Group G in FrmParent.LoginUser.CurrentGroups)
                    {

                        if(G.IsPublicAccess == true)
                        {
                            ListViewItem pubLVI = lvPublic.Items.Add(G.Description);
                            pubLVI.Tag = G;
                            if(G.ID == Gp.ID)
                            {

                                pubLVI.Selected = true;
                                lvPublic_SelectedIndexChanged(lvPublic,new EventArgs());
                            }
                        }
                    }
                }
            }
        }